diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-05-05 17:11:55 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-05-05 21:17:05 +0100 |
commit | 1d609d672273da494fd596606b59ab1c0010ae6d (patch) | |
tree | 2cd9f856f991dd5901a981fca1059c61e2764716 /src/cairo-image-surface.c | |
parent | aac132a76a2af3719088678295169f1962a555e6 (diff) |
[image] Treat A1 image surfaces as BILEVEL_ALPHA
Categorise the transparency of FORMAT_A1 image surfaces as BILEVEL_ALPHA.
Diffstat (limited to 'src/cairo-image-surface.c')
-rw-r--r-- | src/cairo-image-surface.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index 3225a722..a027f728 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -1578,8 +1578,13 @@ _cairo_image_analyze_transparency (cairo_image_surface_t *image) if ((image->base.content & CAIRO_CONTENT_ALPHA) == 0) return image->transparency = CAIRO_IMAGE_IS_OPAQUE; - if ((image->base.content & CAIRO_CONTENT_COLOR) == 0) - return image->transparency = CAIRO_IMAGE_HAS_ALPHA; + + if ((image->base.content & CAIRO_CONTENT_COLOR) == 0) { + if (image->format == CAIRO_FORMAT_A1) + return image->transparency = CAIRO_IMAGE_HAS_BILEVEL_ALPHA; + else + return image->transparency = CAIRO_IMAGE_HAS_ALPHA; + } if (image->format != CAIRO_FORMAT_ARGB32) return image->transparency = CAIRO_IMAGE_HAS_ALPHA; |