summaryrefslogtreecommitdiff
path: root/src/cairo-image-surface.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2012-04-04 19:53:09 +0930
committerAdrian Johnson <ajohnson@redneon.com>2012-04-04 19:53:09 +0930
commit7a262fd398c8a1f3c9052e8d9ec459e27ff91b4d (patch)
tree89f79271f9ca17de8924466920c460193cab391a /src/cairo-image-surface.c
parentcc247c346b75353f16ab40ac74c54cdd9663d16b (diff)
downloadcairo-7a262fd398c8a1f3c9052e8d9ec459e27ff91b4d.tar.gz
fix bug in _cairo_image_analyze_color
Diffstat (limited to 'src/cairo-image-surface.c')
-rw-r--r--src/cairo-image-surface.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 8208a1500..e860e1b7a 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -1130,9 +1130,12 @@ _cairo_image_analyze_color (cairo_image_surface_t *image)
if (image->color != CAIRO_IMAGE_UNKNOWN_COLOR)
return image->color;
- if (image->format == CAIRO_FORMAT_A1 || image->format == CAIRO_FORMAT_A8)
+ if (image->format == CAIRO_FORMAT_A1)
return image->color = CAIRO_IMAGE_IS_MONOCHROME;
+ if (image->format == CAIRO_FORMAT_A8)
+ return image->color = CAIRO_IMAGE_IS_GRAYSCALE;
+
if (image->format == CAIRO_FORMAT_ARGB32) {
image->color = CAIRO_IMAGE_IS_MONOCHROME;
for (y = 0; y < image->height; y++) {