diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-10-26 13:57:30 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-10-26 14:22:25 +0100 |
commit | 31eb704b2ad7c861ec4e61fb9de0e9592fc6d269 (patch) | |
tree | 896a13aad10e256804cde4315a57e1601cf1bd9d | |
parent | ef431b2d35c1bf4d77bbcc73688951d22f6aa135 (diff) |
sna: Ensure that the trap is clipped if it ends within the boundary pixel
Reported-and-tested-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56395
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_trapezoids.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index 482abd36..008ba2e2 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -3073,13 +3073,13 @@ lerp32_unaligned_box_row(PixmapPtr scratch, uint32_t color, uint8_t covered) { int16_t x1 = pixman_fixed_to_int(trap->left.p1.x) + dx; - int16_t fx1 = grid_coverage(SAMPLES_X, trap->left.p1.x); + uint16_t fx1 = grid_coverage(SAMPLES_X, trap->left.p1.x); int16_t x2 = pixman_fixed_to_int(trap->right.p2.x) + dx; - int16_t fx2 = grid_coverage(SAMPLES_X, trap->right.p2.x); + uint16_t fx2 = grid_coverage(SAMPLES_X, trap->right.p2.x); if (x1 < extents->x1) x1 = extents->x1, fx1 = 0; - if (x2 > extents->x2) + if (x2 >= extents->x2) x2 = extents->x2, fx2 = 0; DBG(("%s: x=(%d.%d, %d.%d), y=%dx%d, covered=%d\n", __FUNCTION__, @@ -3171,13 +3171,13 @@ pixsolid_unaligned_box_row(struct pixman_inplace *pi, uint8_t covered) { int16_t x1 = pixman_fixed_to_int(trap->left.p1.x); - int16_t fx1 = grid_coverage(SAMPLES_X, trap->left.p1.x); + uint16_t fx1 = grid_coverage(SAMPLES_X, trap->left.p1.x); int16_t x2 = pixman_fixed_to_int(trap->right.p1.x); - int16_t fx2 = grid_coverage(SAMPLES_X, trap->right.p1.x); + uint16_t fx2 = grid_coverage(SAMPLES_X, trap->right.p1.x); if (x1 < extents->x1) x1 = extents->x1, fx1 = 0; - if (x2 > extents->x2) + if (x2 >= extents->x2) x2 = extents->x2, fx2 = 0; if (x1 < x2) { @@ -3276,9 +3276,9 @@ composite_unaligned_boxes_inplace__solid(CARD8 op, uint32_t color, extents = REGION_RECTS(&clip); while (count--) { int16_t y1 = dy + pixman_fixed_to_int(t->top); - int16_t fy1 = pixman_fixed_frac(t->top); + uint16_t fy1 = pixman_fixed_frac(t->top); int16_t y2 = dy + pixman_fixed_to_int(t->bottom); - int16_t fy2 = pixman_fixed_frac(t->bottom); + uint16_t fy2 = pixman_fixed_frac(t->bottom); DBG(("%s: t=(%d, %d), (%d, %d), extents (%d, %d), (%d, %d)\n", __FUNCTION__, @@ -3291,7 +3291,7 @@ composite_unaligned_boxes_inplace__solid(CARD8 op, uint32_t color, if (y1 < extents->y1) y1 = extents->y1, fy1 = 0; - if (y2 > extents->y2) + if (y2 >= extents->y2) y2 = extents->y2, fy2 = 0; if (y1 < y2) { @@ -3363,13 +3363,13 @@ pixman: extents = REGION_RECTS(&clip); while (count--) { int16_t y1 = pixman_fixed_to_int(t->top); - int16_t fy1 = pixman_fixed_frac(t->top); + uint16_t fy1 = pixman_fixed_frac(t->top); int16_t y2 = pixman_fixed_to_int(t->bottom); - int16_t fy2 = pixman_fixed_frac(t->bottom); + uint16_t fy2 = pixman_fixed_frac(t->bottom); if (y1 < extents->y1) y1 = extents->y1, fy1 = 0; - if (y2 > extents->y2) + if (y2 >= extents->y2) y2 = extents->y2, fy2 = 0; if (y1 < y2) { if (fy1) { @@ -3429,13 +3429,13 @@ pixmask_unaligned_box_row(struct pixman_inplace *pi, uint8_t covered) { int16_t x1 = pixman_fixed_to_int(trap->left.p1.x); - int16_t fx1 = grid_coverage(SAMPLES_X, trap->left.p1.x); + uint16_t fx1 = grid_coverage(SAMPLES_X, trap->left.p1.x); int16_t x2 = pixman_fixed_to_int(trap->right.p1.x); - int16_t fx2 = grid_coverage(SAMPLES_X, trap->right.p1.x); + uint16_t fx2 = grid_coverage(SAMPLES_X, trap->right.p1.x); if (x1 < extents->x1) x1 = extents->x1, fx1 = 0; - if (x2 > extents->x2) + if (x2 >= extents->x2) x2 = extents->x2, fx2 = 0; if (x1 < x2) { @@ -3526,9 +3526,9 @@ composite_unaligned_boxes_inplace(CARD8 op, extents = REGION_RECTS(&clip); while (count--) { int16_t y1 = pixman_fixed_to_int(t->top); - int16_t fy1 = pixman_fixed_frac(t->top); + uint16_t fy1 = pixman_fixed_frac(t->top); int16_t y2 = pixman_fixed_to_int(t->bottom); - int16_t fy2 = pixman_fixed_frac(t->bottom); + uint16_t fy2 = pixman_fixed_frac(t->bottom); if (y1 < extents->y1) y1 = extents->y1, fy1 = 0; |