sna: Only use the simple stipple upload path if wholly contained
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 4 Nov 2013 11:48:04 +0000 (11:48 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 4 Nov 2013 11:48:04 +0000 (11:48 +0000)
If the stipple box is outside of the stipple pixmap, we need to
carefully upload the stipple using the modulus operation.

Buzilla: https://bugs.launchpad.net/bugs/1247785
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_accel.c

index b8d89d6..28cdd74 100644 (file)
@@ -13648,7 +13648,9 @@ sna_poly_fill_rect_stippled_blt(DrawablePtr drawable,
                                                           gc, n, rect,
                                                           extents, clipped);
 
-       if (extents->x2 - gc->patOrg.x - drawable->x <= stipple->drawable.width &&
+       if (extents->x1 - gc->patOrg.x - drawable->x >= 0 &&
+           extents->x2 - gc->patOrg.x - drawable->x <= stipple->drawable.width &&
+           extents->y1 - gc->patOrg.y - drawable->y >= 0 &&
            extents->y2 - gc->patOrg.y - drawable->y <= stipple->drawable.height) {
                if (stipple->drawable.width <= 8 && stipple->drawable.height <= 8)
                        return sna_poly_fill_rect_stippled_8x8_blt(drawable, bo, damage,