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>
This commit is contained in:
Chris Wilson 2012-10-26 13:57:30 +01:00
parent ef431b2d35
commit 31eb704b2a
1 changed files with 17 additions and 17 deletions

View File

@ -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;