Fix off-by-one error in source_image_needs_out_of_bounds_workaround()
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Fri, 11 Sep 2009 01:33:24 +0000 (21:33 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Fri, 11 Sep 2009 01:33:24 +0000 (21:33 -0400)
If extents->x2/y2 are equal to image->width/height, then the clip is
still inside the drawable, so no workaround is necessary.

pixman/pixman-bits-image.c

index 6b80189..4e78ce1 100644 (file)
@@ -612,14 +612,14 @@ source_image_needs_out_of_bounds_workaround (bits_image_t *image)
     {
        if (!image->common.client_clip)
        {
-           /* There is no client clip, so the drawable in question
-            * is a window if the clip region extends beyond the
-            * drawable geometry.
+           /* There is no client clip, so if the clip region extends beyond the
+            * drawable geometry, it must be because the X server generated the
+            * bogus clip region.
             */
            const pixman_box32_t *extents = pixman_region32_extents (&image->common.clip_region);
 
-           if (extents->x1 >= 0 && extents->x2 < image->width &&
-               extents->y1 >= 0 && extents->y2 < image->height)
+           if (extents->x1 >= 0 && extents->x2 <= image->width &&
+               extents->y1 >= 0 && extents->y2 <= image->height)
            {
                return FALSE;
            }