summaryrefslogtreecommitdiff
path: root/gtk/gtkcairoblur.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-09-19 22:23:47 +0200
committerBenjamin Otte <otte@redhat.com>2012-09-20 02:45:41 +0200
commit267d1793c6ebf1d7b2dd0e4814c19ca7a21515d9 (patch)
treeed867a824ceb0c2125528c9a6032da9b58a3112a /gtk/gtkcairoblur.c
parent1cecaf6d7e0fa539ac23edc0df0be444a6a04ae8 (diff)
downloadgtk+-267d1793c6ebf1d7b2dd0e4814c19ca7a21515d9.tar.gz
blur: Fix pixel sizes
The code accesses pixels in a chunks of 4 bytes, so we must only support formats where the size of a single pixel is 4 bytes. Fix RGB24 to be 4 bytes (the alpha channel is ignored) and disallow A8.
Diffstat (limited to 'gtk/gtkcairoblur.c')
-rw-r--r--gtk/gtkcairoblur.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gtk/gtkcairoblur.c b/gtk/gtkcairoblur.c
index fb08401d04..7748431ec3 100644
--- a/gtk/gtkcairoblur.c
+++ b/gtk/gtkcairoblur.c
@@ -227,8 +227,7 @@ _gtk_cairo_blur_surface (cairo_surface_t* surface,
g_return_if_fail (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE);
format = cairo_image_surface_get_format (surface);
- g_return_if_fail (format == CAIRO_FORMAT_A8 ||
- format == CAIRO_FORMAT_RGB24 ||
+ g_return_if_fail (format == CAIRO_FORMAT_RGB24 ||
format == CAIRO_FORMAT_ARGB32);
if (radius == 0)
@@ -248,12 +247,10 @@ _gtk_cairo_blur_surface (cairo_surface_t* surface,
_expblur (pixels, width, height, 4, radius, 16, 7);
break;
case CAIRO_FORMAT_RGB24:
- _expblur (pixels, width, height, 3, radius, 16, 7);
- break;
- case CAIRO_FORMAT_A8:
- _expblur (pixels, width, height, 1, radius, 16, 7);
+ _expblur (pixels, width, height, 4, radius, 16, 7);
break;
default:
+ g_assert_not_reached ();
break;
}