summaryrefslogtreecommitdiff
path: root/src/sna/sna_composite.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-08 02:09:25 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-08 09:04:37 +0000
commit8e6166a0e87a00248d0d4925953c923850f5b840 (patch)
tree9a938a1f0e2e0251d45d955d093faea721f92f0b /src/sna/sna_composite.c
parent3f73cc706ff39cd4c10433791f12b5f829f62e6d (diff)
sna: Becareful not to reduce operators for superluminal colors
wine-1.4 is such an example of a crazy application. References: https://bugs.freedesktop.org/show_bug.cgi?id=42606 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_composite.c')
-rw-r--r--src/sna/sna_composite.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index 225008fb..38ff99de 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -644,7 +644,7 @@ sna_composite_rectangles(CARD8 op,
return;
}
- if (color->alpha <= 0x00ff) {
+ if ((color->red|color->green|color->blue|color->alpha) <= 0x00ff) {
switch (op) {
case PictOpOver:
case PictOpOutReverse:
@@ -661,6 +661,22 @@ sna_composite_rectangles(CARD8 op,
op = PictOpOverReverse;
break;
}
+ }
+ if (color->alpha <= 0x00ff) {
+ switch (op) {
+ case PictOpOver:
+ case PictOpOutReverse:
+ return;
+ case PictOpInReverse:
+ op = PictOpClear;
+ break;
+ case PictOpAtopReverse:
+ op = PictOpOut;
+ break;
+ case PictOpXor:
+ op = PictOpOverReverse;
+ break;
+ }
} else if (color->alpha >= 0xff00) {
switch (op) {
case PictOpOver: