diff options
author | Benjamin Otte <otte@redhat.com> | 2010-02-23 21:01:13 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-02-23 21:03:31 +0100 |
commit | 8bb06915ed6628c6d8978b6c2fec474bbf08d7e9 (patch) | |
tree | 8e1e9bc1a1bb0e68f1963e260f2b130975d9d9b0 /src/cairo-image-surface.c | |
parent | b7c42b6aaa2dba09ed3ff9ae85eae27bec268713 (diff) |
image: split cairo_image_surface_coerce()
Split into a general cairo_image_surface_coerce() that coerces to one of
the 3 supported formats (ARGB32, RGB24, A8) based on content and the
more general cairo_image_surface_coerce_to_format() that coerces to a
specified format.
Diffstat (limited to 'src/cairo-image-surface.c')
-rw-r--r-- | src/cairo-image-surface.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index 8dbf2e70..854e98df 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -4320,8 +4320,18 @@ const cairo_surface_backend_t _cairo_image_surface_backend = { /* A convenience function for when one needs to coerce an image * surface to an alternate format. */ cairo_image_surface_t * -_cairo_image_surface_coerce (cairo_image_surface_t *surface, - cairo_format_t format) +_cairo_image_surface_coerce (cairo_image_surface_t *surface) +{ + return _cairo_image_surface_coerce_to_format (surface, + _cairo_format_from_content (surface->base.content)); + +} + +/* A convenience function for when one needs to coerce an image + * surface to an alternate format. */ +cairo_image_surface_t * +_cairo_image_surface_coerce_to_format (cairo_image_surface_t *surface, + cairo_format_t format) { cairo_image_surface_t *clone; cairo_status_t status; |