summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-03-19 10:25:05 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-03-19 10:25:05 +0000
commit6802ee00e52515ca886b956f6c0a0e27d708fb31 (patch)
tree317f83ba867c8e2d5ad01f28297fba6cd43873e5
parent15be6b7c9a89bfdac923d2a27649f539c430366f (diff)
sna: Assert after applying clipping that the draw rectangle is wholly contained
Otherwise we ignore the purpose of applying the clip! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4f08e99d..a192d060 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -12149,7 +12149,7 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
if (clip.data == NULL) {
const BoxRec *box = &clip.extents;
- DBG(("%s: single clip box [(%d, %d), (%d, %d)]",
+ DBG(("%s: single clip box [(%d, %d), (%d, %d)]\n",
__FUNCTION__, box->x1, box->y1, box->x2, box->y2));
while (n--) {
BoxRec r;
@@ -12162,10 +12162,6 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
DBG(("%s: rectangle [(%d, %d), (%d, %d)]\n",
__FUNCTION__, r.x1, r.y1, r.x2, r.y2));
- assert(r.x1 + dx >= 0);
- assert(r.y1 + dy >= 0);
- assert(r.x2 + dx <= pixmap->drawable.width);
- assert(r.y2 + dy <= pixmap->drawable.height);
if (box_intersect(&r, box)) {
int height = r.y2 - r.y1;
@@ -12174,6 +12170,11 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
if (tile_y < 0)
tile_y += tile_height;
+ assert(r.x1 + dx >= 0);
+ assert(r.y1 + dy >= 0);
+ assert(r.x2 + dx <= pixmap->drawable.width);
+ assert(r.y2 + dy <= pixmap->drawable.height);
+
while (height) {
int width = r.x2 - r.x1;
int dst_x = r.x1, tile_x;
@@ -12234,14 +12235,15 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
region.extents.y1,
region.extents.x2,
region.extents.y2));
+
+ region.data = NULL;
+ RegionIntersect(&region, &region, &clip);
+
assert(region.extents.x1 + dx >= 0);
assert(region.extents.y1 + dy >= 0);
assert(region.extents.x2 + dx <= pixmap->drawable.width);
assert(region.extents.y2 + dy <= pixmap->drawable.height);
- region.data = NULL;
- RegionIntersect(&region, &region, &clip);
-
nbox = RegionNumRects(&region);
box = RegionRects(&region);
DBG(("%s: split into %d boxes after clipping\n", __FUNCTION__, nbox));