From 1d609d672273da494fd596606b59ab1c0010ae6d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 5 May 2009 17:11:55 +0100 Subject: [image] Treat A1 image surfaces as BILEVEL_ALPHA Categorise the transparency of FORMAT_A1 image surfaces as BILEVEL_ALPHA. --- src/cairo-image-surface.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/cairo-image-surface.c') 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; -- cgit v1.2.3