diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-04 20:07:49 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-04 20:07:49 +0000 |
commit | b899a4b69696141ca8b897a7abf52649b09f7b3b (patch) | |
tree | d797815eeaf7760906b2a241d774e81014c0e1b4 | |
parent | c107b90a44abb45c837ff8924939872be5b490eb (diff) |
sna: Always pass the clear colour for PictOpClear
Having made that optimisation for Composite, and then made the
assumption that it is always true in the backends, we failed to clear
the unbounded area outside of a trapezoid since we passed in the
original colour and the operation was optimised as a continuation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna.h | 1 | ||||
-rw-r--r-- | src/sna/sna_composite.c | 10 | ||||
-rw-r--r-- | src/sna/sna_trapezoids.c | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h index 9df8cfdc..73e24908 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -274,6 +274,7 @@ struct sna { void *WakeupData; CloseScreenProcPtr CloseScreen; + PicturePtr clear; struct { uint32_t fill_bo; uint32_t fill_pixel; diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index 8eb0c942..5b815964 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -43,20 +43,18 @@ #define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v)) -static PicturePtr clear; - Bool sna_composite_create(struct sna *sna) { xRenderColor color ={ 0 }; int error; - clear = CreateSolidPicture(0, &color, &error); - return clear != NULL; + sna->clear = CreateSolidPicture(0, &color, &error); + return sna->clear != NULL; } void sna_composite_close(struct sna *sna) { - FreePicture(clear, 0); + FreePicture(sna->clear, 0); } static inline bool @@ -436,7 +434,7 @@ sna_composite(CARD8 op, if (op == PictOpClear) { DBG(("%s: discarding source and mask for clear\n", __FUNCTION__)); mask = NULL; - src = clear; + src = sna->clear; } if (mask && sna_composite_mask_is_opaque(mask)) { diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index eb6c9685..c2a41907 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -2776,7 +2776,7 @@ mono_trapezoids_span_converter(CARD8 op, PicturePtr src, PicturePtr dst, memset(&mono.op, 0, sizeof(mono.op)); if (mono.sna->render.composite(mono.sna, PictOpClear, - src, NULL, dst, + mono.sna->clear, NULL, dst, 0, 0, 0, 0, mono.clip.extents.x1, mono.clip.extents.y1, @@ -4321,7 +4321,7 @@ mono_triangles_span_converter(CARD8 op, PicturePtr src, PicturePtr dst, memset(&mono.op, 0, sizeof(mono.op)); if (mono.sna->render.composite(mono.sna, PictOpClear, - src, NULL, dst, + mono.sna->clear, NULL, dst, 0, 0, 0, 0, mono.clip.extents.x1, mono.clip.extents.y1, |