diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-30 10:40:32 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-30 10:45:26 +0000 |
commit | d4062705178856cffc83030fa40f758e9d884566 (patch) | |
tree | 0f7314b193fa8a6b925f5286d75c0a317f179677 /src/sna/sna_composite.c | |
parent | da3f8656744f7c801608c7c89a859c0f7dc9e6e0 (diff) |
sna/composite: Fix incorrect operator reduction for RenderFillRectangles
As exemplified by KDE (using Kate) on gen3, it would attempt to render a
large set of boxes using OVER and a transparent colour. As gen3 copied
across some of the BLT assumptions, it was incorrectly reducing that to
a CLEAR and thus rendering incorrectly.
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.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index e9dc965f..0373bad4 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -601,6 +601,42 @@ sna_composite_rectangles(CARD8 op, if (!num_rects) return; + if (color->alpha <= 0x00ff) { + switch (op) { + case PictOpOver: + case PictOpOutReverse: + case PictOpAdd: + return; + case PictOpInReverse: + case PictOpSrc: + op = PictOpClear; + break; + case PictOpAtopReverse: + op = PictOpOut; + break; + case PictOpXor: + op = PictOpOverReverse; + break; + } + } else if (color->alpha >= 0xff00) { + switch (op) { + case PictOpOver: + op = PictOpSrc; + break; + case PictOpInReverse: + return; + case PictOpOutReverse: + op = PictOpClear; + break; + case PictOpAtopReverse: + op = PictOpOverReverse; + break; + case PictOpXor: + op = PictOpOut; + break; + } + } + if (!pixman_region_not_empty(dst->pCompositeClip)) { DBG(("%s: empty clip, skipping\n", __FUNCTION__)); return; |