summaryrefslogtreecommitdiff
path: root/src/cairo-image-surface-private.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-01 16:31:49 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-01 16:36:03 +0000
commitc391093f40472c2300f38d0e5857858f85586b60 (patch)
treee64ce1e4f706860de65439821ed3659eb3b174c0 /src/cairo-image-surface-private.h
parent15830fdb1087f18dcd6351de1034a5025b8ed343 (diff)
downloadcairo-c391093f40472c2300f38d0e5857858f85586b60.tar.gz
image: Add a convenience function for creating an image from another's data
The GL backend would like to extract a rectangle from another surface and convert it to a different pixel format. The _cairo_image_surface_create_from_image() does that by returning a new image that has the contents of the specified rectangle in the source Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-image-surface-private.h')
-rw-r--r--src/cairo-image-surface-private.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cairo-image-surface-private.h b/src/cairo-image-surface-private.h
index 6a159d8a4..8ca694c5e 100644
--- a/src/cairo-image-surface-private.h
+++ b/src/cairo-image-surface-private.h
@@ -226,6 +226,13 @@ cairo_private cairo_image_surface_t *
_cairo_image_surface_clone_subimage (cairo_surface_t *surface,
const cairo_rectangle_int_t *extents);
+/* Similar to clone; but allow format conversion */
+cairo_private cairo_image_surface_t *
+_cairo_image_surface_create_from_image (cairo_image_surface_t *other,
+ pixman_format_code_t format,
+ int x, int y, int width, int height,
+ int stride);
+
CAIRO_END_DECLS
#endif /* CAIRO_IMAGE_SURFACE_PRIVATE_H */