diff options
author | Carl Worth <cworth@cworth.org> | 2006-05-24 17:05:51 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2006-05-24 17:19:00 -0700 |
commit | d0dd3b822e98358e88f8c9261ef633331548ccfd (patch) | |
tree | 19c0af4030f3946e69e4c1c3060c0cbe38c31f51 /src/cairo-surface.c | |
parent | 0796845ae6923f3ccef5df231b7d9a2c145063fd (diff) |
New API: Add new function cairo_surface_get_content
This assumes that the directfb, glitz, and quartz backends
always create surfaces with content of COLOR_ALPHA which might
be totally wrong.
Diffstat (limited to 'src/cairo-surface.c')
-rw-r--r-- | src/cairo-surface.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 422152f50..a4ec2de8e 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -43,6 +43,7 @@ const cairo_surface_t _cairo_surface_nil = { &cairo_image_surface_backend, /* backend */ + CAIRO_CONTENT_COLOR, CAIRO_SURFACE_TYPE_IMAGE, -1, /* ref_count */ CAIRO_STATUS_NO_MEMORY, /* status */ @@ -60,6 +61,7 @@ const cairo_surface_t _cairo_surface_nil = { const cairo_surface_t _cairo_surface_nil_file_not_found = { &cairo_image_surface_backend, /* backend */ + CAIRO_CONTENT_COLOR, CAIRO_SURFACE_TYPE_IMAGE, -1, /* ref_count */ CAIRO_STATUS_FILE_NOT_FOUND, /* status */ @@ -77,6 +79,7 @@ const cairo_surface_t _cairo_surface_nil_file_not_found = { const cairo_surface_t _cairo_surface_nil_read_error = { &cairo_image_surface_backend, /* backend */ + CAIRO_CONTENT_COLOR, CAIRO_SURFACE_TYPE_IMAGE, -1, /* ref_count */ CAIRO_STATUS_READ_ERROR, /* status */ @@ -146,6 +149,20 @@ cairo_surface_get_type (cairo_surface_t *surface) } /** + * cairo_surface_get_content: + * @surface: a #cairo_surface_t + * + * Return value: The content type of @surface which indicates whether + * the surface contains color and/or alpha information. See + * #cairo_content_t. + **/ +cairo_content_t +cairo_surface_get_content (cairo_surface_t *surface) +{ + return surface->content; +} + +/** * cairo_surface_status: * @surface: a #cairo_surface_t * @@ -165,9 +182,12 @@ cairo_surface_status (cairo_surface_t *surface) void _cairo_surface_init (cairo_surface_t *surface, - const cairo_surface_backend_t *backend) + const cairo_surface_backend_t *backend, + cairo_content_t content) { surface->backend = backend; + + surface->content = content; surface->type = backend->type; |