[cairo-commit] 4 commits - src/cairo-gl-private.h src/cairo-image-surface.c src/cairo-image-surface-inline.h src/cairo-image-surface-private.h src/cairoint.h src/cairo-surface.c src/cairo-surface-private.h
Chris Wilson
ickle at kemper.freedesktop.org
Thu May 31 10:33:22 PDT 2012
src/cairo-gl-private.h | 2 +-
src/cairo-image-surface-inline.h | 7 +++++++
src/cairo-image-surface-private.h | 3 ---
src/cairo-image-surface.c | 12 +-----------
src/cairo-surface-private.h | 3 +++
src/cairo-surface.c | 16 ++++++++++++----
src/cairoint.h | 3 ---
7 files changed, 24 insertions(+), 22 deletions(-)
New commits:
commit c0a92bf8329c5a8aee76ac96034435d4fce043dc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu May 31 18:30:58 2012 +0100
surface: replace map-to-image clone's use of user_data with parent pointer
Removes an another undeclared PLT entry and prevents mixing of user_data
with internal state.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/cairo-image-surface-inline.h b/src/cairo-image-surface-inline.h
index 132d553..f6bed71 100644
--- a/src/cairo-image-surface-inline.h
+++ b/src/cairo-image-surface-inline.h
@@ -56,6 +56,12 @@ _cairo_image_surface_set_parent (cairo_image_surface_t *image,
image->parent = parent;
}
+static inline cairo_bool_t
+_cairo_image_surface_is_clone (cairo_image_surface_t *image)
+{
+ return image->parent != NULL;
+}
+
/**
* _cairo_surface_is_image:
* @surface: a #cairo_surface_t
diff --git a/src/cairo-image-surface-private.h b/src/cairo-image-surface-private.h
index 8f7364c..9660180 100644
--- a/src/cairo-image-surface-private.h
+++ b/src/cairo-image-surface-private.h
@@ -220,9 +220,6 @@ cairo_private cairo_image_surface_t *
_cairo_image_surface_clone_subimage (cairo_surface_t *surface,
const cairo_rectangle_int_t *extents);
-cairo_private cairo_bool_t
-_cairo_image_surface_is_clone (cairo_image_surface_t *surface);
-
CAIRO_END_DECLS
#endif /* CAIRO_IMAGE_SURFACE_PRIVATE_H */
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 33170cd..23e6ca6 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -1206,8 +1206,6 @@ _cairo_image_analyze_color (cairo_image_surface_t *image)
return image->color = CAIRO_IMAGE_IS_COLOR;
}
-static const cairo_user_data_key_t clone_key;
-
cairo_image_surface_t *
_cairo_image_surface_clone_subimage (cairo_surface_t *surface,
const cairo_rectangle_int_t *extents)
@@ -1242,9 +1240,7 @@ _cairo_image_surface_clone_subimage (cairo_surface_t *surface,
if (unlikely (status))
goto error;
- status = cairo_surface_set_user_data (image, &clone_key, surface, NULL);
- if (unlikely (status))
- goto error;
+ _cairo_image_surface_set_parent (to_image_surface (image), surface);
return to_image_surface (image);
@@ -1252,9 +1248,3 @@ error:
cairo_surface_destroy (image);
return to_image_surface (_cairo_surface_create_in_error (status));
}
-
-cairo_bool_t
-_cairo_image_surface_is_clone (cairo_image_surface_t *image)
-{
- return cairo_surface_get_user_data (&image->base, &clone_key) != NULL;
-}
commit 9e933d4b8790f0f8309bdd980f4558d51ccec168
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu May 31 18:25:09 2012 +0100
gl: Add missing cairo-private to _cairo_gl_composite_with_clip
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h
index 4e911fe..97abaf0 100644
--- a/src/cairo-gl-private.h
+++ b/src/cairo-gl-private.h
@@ -745,7 +745,7 @@ _cairo_gl_composite_glyphs (void *_dst,
int dst_y,
cairo_composite_glyphs_info_t *info);
-cairo_int_status_t
+cairo_private cairo_int_status_t
_cairo_gl_composite_glyphs_with_clip (void *_dst,
cairo_operator_t op,
cairo_surface_t *_src,
commit 9275b4d5aa45320bc3804980337c7aff6c34c029
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu May 31 18:22:11 2012 +0100
surface: Eliminate PLT entries for map-to-image
Use the internal symbols internally.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 8a7cbb0..e208022 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -1846,12 +1846,17 @@ _cairo_surface_acquire_source_image (cairo_surface_t *surface,
}
cairo_status_t
-_cairo_surface_default_acquire_source_image (void *surface,
+_cairo_surface_default_acquire_source_image (void *_surface,
cairo_image_surface_t **image_out,
void **image_extra)
{
- *image_out = (cairo_image_surface_t *)
- cairo_surface_map_to_image (surface, NULL);
+ cairo_surface_t *surface = _surface;
+ cairo_rectangle_int_t extents;
+
+ if (unlikely (! surface->backend->get_extents (surface, &extents)))
+ return _cairo_error (CAIRO_STATUS_INVALID_SIZE);
+
+ *image_out = _cairo_surface_map_to_image (surface, &extents);
*image_extra = NULL;
return (*image_out)->base.status;
}
@@ -1879,7 +1884,10 @@ _cairo_surface_default_release_source_image (void *surface,
cairo_image_surface_t *image,
void *image_extra)
{
- cairo_surface_unmap_image (surface, &image->base);
+ cairo_status_t ignored;
+
+ ignored = _cairo_surface_unmap_image (surface, image);
+ (void)ignored;
}
commit 2c6ba9a8733044ad8685e6e8312e945a7a49ce3a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu May 31 18:08:05 2012 +0100
image: silence make check
The check for standalone headers requires that the
cairo-image-surface-inline.h include the cairo-surface-private.h
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/cairo-image-surface-inline.h b/src/cairo-image-surface-inline.h
index d529bde..132d553 100644
--- a/src/cairo-image-surface-inline.h
+++ b/src/cairo-image-surface-inline.h
@@ -38,6 +38,7 @@
#ifndef CAIRO_IMAGE_SURFACE_INLINE_H
#define CAIRO_IMAGE_SURFACE_INLINE_H
+#include "cairo-surface-private.h"
#include "cairo-image-surface-private.h"
CAIRO_BEGIN_DECLS
diff --git a/src/cairo-surface-private.h b/src/cairo-surface-private.h
index d23fc05..63202fb 100644
--- a/src/cairo-surface-private.h
+++ b/src/cairo-surface-private.h
@@ -106,6 +106,9 @@ struct _cairo_surface {
};
cairo_private cairo_surface_t *
+_cairo_surface_create_in_error (cairo_status_t status);
+
+cairo_private cairo_surface_t *
_cairo_int_surface_create_in_error (cairo_int_status_t status);
cairo_private cairo_surface_t *
diff --git a/src/cairoint.h b/src/cairoint.h
index 2c9f2dd..b27f8ad 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1255,9 +1255,6 @@ _cairo_stroke_style_dash_approximate (const cairo_stroke_style_t *style,
/* cairo-surface.c */
-cairo_private cairo_surface_t *
-_cairo_surface_create_in_error (cairo_status_t status);
-
cairo_private cairo_status_t
_cairo_surface_copy_mime_data (cairo_surface_t *dst,
cairo_surface_t *src);
More information about the cairo-commit
mailing list