diff options
author | Benjamin Otte <otte@gnome.org> | 2009-09-17 10:42:12 +0200 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2009-11-04 15:50:12 +0100 |
commit | fd0e861ddbc44544a5a9c65a557fc02f81979fa9 (patch) | |
tree | 9069961ac66121053f7c9a617f0629db761ae1db | |
parent | a9f37953c71e16f65122097462e51b035783a965 (diff) |
Export cairo_image_surface_create_with_pixman_format()
The function is necessary for all users that need to support arbitrary
pixman formats, where the cairo_format_t enum is not enough.
-rw-r--r-- | src/cairo-image-surface.c | 32 | ||||
-rw-r--r-- | src/cairo-xlib-surface.c | 2 | ||||
-rw-r--r-- | src/cairo.h | 7 | ||||
-rw-r--r-- | src/cairoint.h | 7 | ||||
-rw-r--r-- | src/test-fallback16-surface.c | 2 |
5 files changed, 26 insertions, 24 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index b0a26bf9..0bec118f 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -334,7 +334,7 @@ _cairo_image_surface_create_with_masks (unsigned char *data, ASSERT_NOT_REACHED; } - return _cairo_image_surface_create_with_pixman_format (data, + return cairo_image_surface_create_with_pixman_format (data, pixman_format, width, height, @@ -364,11 +364,11 @@ _cairo_format_to_pixman_format_code (cairo_format_t format) } cairo_surface_t * -_cairo_image_surface_create_with_pixman_format (unsigned char *data, - pixman_format_code_t pixman_format, - int width, - int height, - int stride) +cairo_image_surface_create_with_pixman_format (unsigned char *data, + unsigned int pixman_format, + int width, + int height, + int stride) { cairo_surface_t *surface; pixman_image_t *pixman_image; @@ -428,7 +428,7 @@ cairo_image_surface_create (cairo_format_t format, pixman_format = _cairo_format_to_pixman_format_code (format); - return _cairo_image_surface_create_with_pixman_format (NULL, pixman_format, + return cairo_image_surface_create_with_pixman_format (NULL, pixman_format, width, height, -1); } slim_hidden_def (cairo_image_surface_create); @@ -562,10 +562,12 @@ cairo_image_surface_create_for_data (unsigned char *data, } pixman_format = _cairo_format_to_pixman_format_code (format); - return _cairo_image_surface_create_with_pixman_format (data, - pixman_format, - width, height, - stride); + + return cairo_image_surface_create_with_pixman_format (data, + pixman_format, + width, + height, + stride); } slim_hidden_def (cairo_image_surface_create_for_data); @@ -767,10 +769,10 @@ _cairo_image_surface_create_similar (void *abstract_other, cairo_image_surface_t *other = abstract_other; if (content == other->base.content) { - return _cairo_image_surface_create_with_pixman_format (NULL, - other->pixman_format, - width, height, - 0); + return cairo_image_surface_create_with_pixman_format (NULL, + other->pixman_format, + width, height, + 0); } return _cairo_image_surface_create_with_content (content, diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 92605ff6..20ba21cb 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -808,7 +808,7 @@ _get_image_surface (cairo_xlib_surface_t *surface, (surface->visual == NULL || surface->visual->class == TrueColor)) { image = (cairo_image_surface_t*) - _cairo_image_surface_create_with_pixman_format ((unsigned char *) ximage->data, + cairo_image_surface_create_with_pixman_format ((unsigned char *) ximage->data, pixman_format, ximage->width, ximage->height, diff --git a/src/cairo.h b/src/cairo.h index 8be80439..abbd1d10 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -2159,6 +2159,13 @@ cairo_image_surface_create_for_data (unsigned char *data, int height, int stride); +cairo_public cairo_surface_t * +cairo_image_surface_create_with_pixman_format (unsigned char *data, + unsigned int pixman_format, + int width, + int height, + int stride); + cairo_public unsigned char * cairo_image_surface_get_data (cairo_surface_t *surface); diff --git a/src/cairoint.h b/src/cairoint.h index 5912173f..7ea5d164 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -2181,13 +2181,6 @@ _pixman_format_to_masks (pixman_format_code_t pixman_format, cairo_format_masks_t *masks); cairo_private cairo_surface_t * -_cairo_image_surface_create_with_pixman_format (unsigned char *data, - pixman_format_code_t pixman_format, - int width, - int height, - int stride); - -cairo_private cairo_surface_t * _cairo_image_surface_create_with_masks (unsigned char *data, cairo_format_masks_t *format, int width, diff --git a/src/test-fallback16-surface.c b/src/test-fallback16-surface.c index 91699efc..5d004ad6 100644 --- a/src/test-fallback16-surface.c +++ b/src/test-fallback16-surface.c @@ -66,7 +66,7 @@ _cairo_test_fallback16_surface_create (cairo_content_t content, format = content & CAIRO_CONTENT_ALPHA ? PIXMAN_a1r5g5b5: PIXMAN_r5g6b5; - backing = _cairo_image_surface_create_with_pixman_format (NULL, format, + backing = cairo_image_surface_create_with_pixman_format (NULL, format, width, height, -1); if (cairo_surface_status (backing)) |