[gtk+/wip/blur: 6/7] shadow: add blur to icon-shadow (icon)
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/blur: 6/7] shadow: add blur to icon-shadow (icon)
- Date: Tue, 17 Apr 2012 20:22:51 +0000 (UTC)
commit 4f417f0c563fa6214a50a836bc3848742bb67694
Author: Andrea Cimitan <andrea cimitan canonical com>
Date: Mon Apr 16 13:02:59 2012 +0100
shadow: add blur to icon-shadow (icon)
gtk/gtkcssshadowvalue.c | 35 ++++++++++++++++++++++++++++++-----
gtk/gtkthemingengine.c | 2 +-
2 files changed, 31 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
index dc8578d..e6ff1dd 100644
--- a/gtk/gtkcssshadowvalue.c
+++ b/gtk/gtkcssshadowvalue.c
@@ -386,12 +386,37 @@ _gtk_css_shadow_value_paint_icon (const GtkCssValue *shadow,
cairo_save (cr);
pattern = cairo_pattern_reference (cairo_get_source (cr));
- gdk_cairo_set_source_rgba (cr, _gtk_css_rgba_value_get_rgba (shadow->color));
- cairo_translate (cr,
- _gtk_css_number_value_get (shadow->hoffset, 0),
- _gtk_css_number_value_get (shadow->voffset, 0));
- cairo_mask (cr, pattern);
+ if (_gtk_css_number_value_get (shadow->radius, 0) > 0)
+ {
+ cairo_t *blur_cr;
+ cairo_surface_t *surface;
+
+ _gtk_css_shadow_value_blur_surface_create (shadow, cr,
+ &blur_cr, &surface);
+
+ /* Create the path on the surface to blur. */
+ gdk_cairo_set_source_rgba (blur_cr, _gtk_css_rgba_value_get_rgba (shadow->color));
+
+ cairo_translate (blur_cr,
+ _gtk_css_number_value_get (shadow->hoffset, 0),
+ _gtk_css_number_value_get (shadow->voffset, 0));
+ cairo_mask (blur_cr, pattern);
+
+ _gtk_css_shadow_value_blur_surface_paint (shadow, cr, surface);
+
+ cairo_destroy (blur_cr);
+ cairo_surface_destroy (surface);
+ }
+ else
+ {
+ gdk_cairo_set_source_rgba (cr, _gtk_css_rgba_value_get_rgba (shadow->color));
+
+ cairo_translate (cr,
+ _gtk_css_number_value_get (shadow->hoffset, 0),
+ _gtk_css_number_value_get (shadow->voffset, 0));
+ cairo_mask (cr, pattern);
+ }
cairo_restore (cr);
cairo_pattern_destroy (pattern);
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index a085dc4..50c0d04 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -2928,7 +2928,7 @@ gtk_theming_engine_render_icon_pixbuf (GtkThemingEngine *engine,
static void
gtk_theming_engine_render_icon (GtkThemingEngine *engine,
cairo_t *cr,
- GdkPixbuf *pixbuf,
+ GdkPixbuf *pixbuf,
gdouble x,
gdouble y)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]