[cairo-commit] src/cairoint.h src/cairo-recording-surface.c src/cairo-recording-surface-private.h src/cairo-surface-wrapper.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Aug 14 06:46:28 PDT 2011


 src/cairo-recording-surface-private.h |   15 +++++++++++++--
 src/cairo-recording-surface.c         |   14 --------------
 src/cairo-surface-wrapper.c           |   15 +++++++++++----
 src/cairoint.h                        |    3 ---
 4 files changed, 24 insertions(+), 23 deletions(-)

New commits:
commit 0053a44f6b9806eb61452859ba1eb2ca8c72f564
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Aug 14 14:45:00 2011 +0100

    record: Offset the clip by the replay transformation as well
    
    Fixes push-group-offset which reduces to a replay of a recording surface
    inside a recording surface and forgot to offset the clip imposed by the
    extents of the first recording surface into device space.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-recording-surface-private.h b/src/cairo-recording-surface-private.h
index b7d0ebf..5a897da 100644
--- a/src/cairo-recording-surface-private.h
+++ b/src/cairo-recording-surface-private.h
@@ -184,7 +184,18 @@ _cairo_recording_surface_get_bounds (cairo_surface_t *surface,
     return TRUE;
 }
 
-cairo_private cairo_bool_t
-_cairo_surface_is_recording (const cairo_surface_t *surface);
+/**
+ * _cairo_surface_is_recording:
+ * @surface: a #cairo_surface_t
+ *
+ * Checks if a surface is a #cairo_recording_surface_t
+ *
+ * Return value: %TRUE if the surface is a recording surface
+ **/
+static inline cairo_bool_t
+_cairo_surface_is_recording (const cairo_surface_t *surface)
+{
+    return surface->backend->type == CAIRO_SURFACE_TYPE_RECORDING;
+}
 
 #endif /* CAIRO_RECORDING_SURFACE_H */
diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index 1b00c72..0a83375 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -1147,20 +1147,6 @@ _cairo_recording_surface_get_extents (void		    *abstract_surface,
     return TRUE;
 }
 
-/**
- * _cairo_surface_is_recording:
- * @surface: a #cairo_surface_t
- *
- * Checks if a surface is a #cairo_recording_surface_t
- *
- * Return value: %TRUE if the surface is a recording surface
- **/
-cairo_bool_t
-_cairo_surface_is_recording (const cairo_surface_t *surface)
-{
-    return surface->backend == &cairo_recording_surface_backend;
-}
-
 static const cairo_surface_backend_t cairo_recording_surface_backend = {
     CAIRO_SURFACE_TYPE_RECORDING,
     _cairo_recording_surface_finish,
diff --git a/src/cairo-surface-wrapper.c b/src/cairo-surface-wrapper.c
index 615deb0..5e62869 100644
--- a/src/cairo-surface-wrapper.c
+++ b/src/cairo-surface-wrapper.c
@@ -120,12 +120,19 @@ _cairo_surface_wrapper_get_clip (cairo_surface_wrapper_t *wrapper,
     cairo_clip_t *copy;
 
     copy = _cairo_clip_copy (clip);
-    if (wrapper->has_extents)
+    if (wrapper->has_extents) {
 	copy = _cairo_clip_intersect_rectangle (copy, &wrapper->extents);
-    if (wrapper->extents.x | wrapper->extents.y)
+	if (wrapper->extents.x | wrapper->extents.y)
+	    copy = _cairo_clip_translate (copy,
+					  -wrapper->extents.x,
+					  -wrapper->extents.y);
+    }
+    if (! _cairo_matrix_is_identity (&wrapper->transform)) {
+	/* XXX */
 	copy = _cairo_clip_translate (copy,
-				      -wrapper->extents.x,
-				      -wrapper->extents.y);
+				      wrapper->transform.x0,
+				      wrapper->transform.y0);
+    }
     if (! _cairo_matrix_is_identity (&wrapper->target->device_transform)) {
 	/* XXX */
 	copy = _cairo_clip_translate (copy,
diff --git a/src/cairoint.h b/src/cairoint.h
index 9a76557..f393857 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2001,9 +2001,6 @@ _cairo_image_analyze_color (cairo_image_surface_t      *image);
 cairo_private cairo_bool_t
 _cairo_surface_is_image (const cairo_surface_t *surface) cairo_pure;
 
-cairo_private cairo_bool_t
-_cairo_surface_is_recording (const cairo_surface_t *surface) cairo_pure;
-
 /* cairo-pen.c */
 cairo_private cairo_status_t
 _cairo_pen_init (cairo_pen_t	*pen,


More information about the cairo-commit mailing list