[cairo-commit] 2 commits - src/cairo-image-surface.c

Benjamin Otte company at kemper.freedesktop.org
Fri Apr 30 14:36:06 PDT 2010


 src/cairo-image-surface.c |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

New commits:
commit 358f57c8765f823f8e6db7629ea6ca48fcd392b8
Author: Benjamin Otte <otte at redhat.com>
Date:   Fri Apr 30 23:29:24 2010 +0200

    image: remove useless optimization
    
    The optimization is done way smarter inside
    _cairo_matrix_transform_bounding_box()

diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 3ef89a9..387b083 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -1227,14 +1227,9 @@ sampled_area (const cairo_surface_pattern_t *pattern,
     x2 = extents->x + (int) extents->width;
     y2 = extents->y + (int) extents->height;
 
-    if (_cairo_matrix_is_translation (&pattern->base.matrix)) {
-	x1 += pattern->base.matrix.x0; x2 += pattern->base.matrix.x0;
-	y1 += pattern->base.matrix.y0; y2 += pattern->base.matrix.y0;
-    } else {
-	_cairo_matrix_transform_bounding_box (&pattern->base.matrix,
-					      &x1, &y1, &x2, &y2,
-					      NULL);
-    }
+    _cairo_matrix_transform_bounding_box (&pattern->base.matrix,
+                                          &x1, &y1, &x2, &y2,
+                                          NULL);
 
     filter = _cairo_pattern_analyze_filter (&pattern->base, &pad);
     sample->x = floor (x1 - pad);
commit 94aa6d24b6d5ab4528a0b0a9b1b0c6eb7218f861
Author: Benjamin Otte <otte at redhat.com>
Date:   Fri Apr 30 23:24:41 2010 +0200

    fallback: Create pixman image for correct rectangle
    
    This was most prominently shown by the a1-image-sample test, but
    multiple tests exposed the problem with the xlib-fallback code.

diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 68775d7..3ef89a9 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -4063,8 +4063,8 @@ _cairo_image_surface_composite (cairo_operator_t	 op,
     extents.source.width  = width;
     extents.source.height = height;
 
-    extents.mask.x = dst_x;
-    extents.mask.y = dst_y;
+    extents.mask.x = mask_x;
+    extents.mask.y = mask_y;
     extents.mask.width  = width;
     extents.mask.height = height;
 
@@ -4088,7 +4088,7 @@ _cairo_image_surface_composite (cairo_operator_t	 op,
 
     extents.is_bounded = _cairo_operator_bounded_by_either (op);
 
-    src = _pixman_image_for_pattern (src_pattern, &extents.bounded, &src_offset_x, &src_offset_y);
+    src = _pixman_image_for_pattern (src_pattern, &extents.source, &src_offset_x, &src_offset_y);
     if (unlikely (src == NULL))
 	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
@@ -4096,7 +4096,7 @@ _cairo_image_surface_composite (cairo_operator_t	 op,
 	pixman_image_t *mask;
 	int mask_offset_x, mask_offset_y;
 
-	mask = _pixman_image_for_pattern (mask_pattern, &extents.bounded, &mask_offset_x, &mask_offset_y);
+	mask = _pixman_image_for_pattern (mask_pattern, &extents.mask, &mask_offset_x, &mask_offset_y);
 	if (unlikely (mask == NULL)) {
 	    pixman_image_unref (src);
 	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);


More information about the cairo-commit mailing list