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

Benjamin Otte company at kemper.freedesktop.org
Thu Aug 26 02:20:44 PDT 2010


 src/cairo-surface-subsurface.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit e19b213e84ab8b8ead5e0c700e5b906590e22aa1
Author: Benjamin Otte <otte at redhat.com>
Date:   Thu Aug 26 11:18:29 2010 +0200

    subsurface: Make subsurfaces their own type
    
    Do not try to hide being a subsurface.
    This would cause confusion when users where calling surface-type
    specific getters on subsurfaces.
    
    FIXME: We still need public API to access a subsurface's target though.

diff --git a/src/cairo-surface-subsurface.c b/src/cairo-surface-subsurface.c
index 5611850..a2cdb7e 100644
--- a/src/cairo-surface-subsurface.c
+++ b/src/cairo-surface-subsurface.c
@@ -507,7 +507,6 @@ cairo_surface_create_for_rectangle (cairo_surface_t *target,
 			 &_cairo_surface_subsurface_backend,
 			 NULL, /* device */
 			 target->content);
-    surface->base.type = target->type;
 
     /* XXX forced integer alignment */
     surface->extents.x = ceil (x);
commit e65bf64c4a6e2c7ff673449b8459b3150e438e21
Author: Benjamin Otte <otte at redhat.com>
Date:   Thu Aug 26 11:17:06 2010 +0200

    subsurface: Properly account for device offsets in the target

diff --git a/src/cairo-surface-subsurface.c b/src/cairo-surface-subsurface.c
index 3cbb516..5611850 100644
--- a/src/cairo-surface-subsurface.c
+++ b/src/cairo-surface-subsurface.c
@@ -515,6 +515,11 @@ cairo_surface_create_for_rectangle (cairo_surface_t *target,
     surface->extents.width = floor (x + width) - surface->extents.x;
     surface->extents.height = floor (y + height) - surface->extents.y;
 
+    ret = _cairo_matrix_is_integer_translation (&target->device_transform, &tx, &ty);
+    assert (ret);
+    surface->extents.x += tx;
+    surface->extents.y += ty;
+
     if (_cairo_surface_get_extents (target, &target_extents))
         ret = _cairo_rectangle_intersect (&surface->extents, &target_extents);
 
@@ -524,11 +529,6 @@ cairo_surface_create_for_rectangle (cairo_surface_t *target,
 	surface->extents.x += sub->extents.x;
 	surface->extents.y += sub->extents.y;
 	target = sub->target;
-    } else {
-	ret = _cairo_matrix_is_integer_translation (&target->device_transform, &tx, &ty);
-	assert (ret);
-	surface->extents.x += tx;
-	surface->extents.y += ty;
     }
 
     surface->target = cairo_surface_reference (target);


More information about the cairo-commit mailing list