summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-09-19 17:28:40 +0200
committerBenjamin Otte <otte@redhat.com>2012-09-20 02:45:41 +0200
commit1cecaf6d7e0fa539ac23edc0df0be444a6a04ae8 (patch)
tree968a0e41ed2506319b873176289f70bb68e25777
parent43673dafdca7985d0bd896e14a57ae43acb5035c (diff)
downloadgtk+-1cecaf6d7e0fa539ac23edc0df0be444a6a04ae8.tar.gz
blur: Take the radius as a double parameter
It's only ever used like that
-rw-r--r--gtk/gtkcairoblur.c15
-rw-r--r--gtk/gtkcairoblurprivate.h4
2 files changed, 7 insertions, 12 deletions
diff --git a/gtk/gtkcairoblur.c b/gtk/gtkcairoblur.c
index c85e2e2ee6..fb08401d04 100644
--- a/gtk/gtkcairoblur.c
+++ b/gtk/gtkcairoblur.c
@@ -173,23 +173,19 @@ _expblur (guchar* pixels,
gint width,
gint height,
gint channels,
- gint radius,
+ double radius,
gint aprec,
gint zprec)
{
gint alpha;
- gint row = 0;
- gint col = 0;
-
- if (radius < 1)
- return;
+ int row, col;
/* Calculate the alpha such that 90% of
* the kernel is within the radius.
* (Kernel extends to infinity) */
alpha = (gint) ((1 << aprec) * (1.0f - expf (-2.3f / (radius + 1.f))));
- for (; row < height; row++)
+ for (row = 0; row < height; row++)
_blurrow (pixels,
width,
height,
@@ -199,7 +195,7 @@ _expblur (guchar* pixels,
aprec,
zprec);
- for(; col < width; col++)
+ for(col = 0; col < width; col++)
_blurcol (pixels,
width,
height,
@@ -217,11 +213,10 @@ _expblur (guchar* pixels,
* @radius: the blur radius.
*
* Blurs the cairo image surface at the given radius.
- *
*/
void
_gtk_cairo_blur_surface (cairo_surface_t* surface,
- guint radius)
+ double radius)
{
cairo_format_t format;
guchar* pixels;
diff --git a/gtk/gtkcairoblurprivate.h b/gtk/gtkcairoblurprivate.h
index 0b93bb5939..e048bac8cd 100644
--- a/gtk/gtkcairoblurprivate.h
+++ b/gtk/gtkcairoblurprivate.h
@@ -29,8 +29,8 @@
G_BEGIN_DECLS
-void _gtk_cairo_blur_surface (cairo_surface_t* surface,
- guint radius);
+void _gtk_cairo_blur_surface (cairo_surface_t *surface,
+ double radius);
G_END_DECLS