summaryrefslogtreecommitdiff
path: root/gtk/gtkthemingengine.c
diff options
context:
space:
mode:
authorAndrea Cimitan <andrea.cimitan@canonical.com>2012-04-18 15:40:52 +0100
committerAndrea Cimitan <andrea.cimitan@canonical.com>2012-04-18 16:02:32 +0100
commitb40f90f47b19bafb27d4ca46e52dc884276827fe (patch)
treee38752b63813cea7b947c03d84190c8edbbdbc9e /gtk/gtkthemingengine.c
parent654553cc706d6e21e7e2b631ac9521e530c58fb1 (diff)
downloadgtk+-wip/blur.tar.gz
Optimize blur rendering by always choosing the smaller surface to blur, since rendering speed is inversely proportional to the dimension of the surface to blurwip/blur
Diffstat (limited to 'gtk/gtkthemingengine.c')
-rw-r--r--gtk/gtkthemingengine.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index a085dc421e..9de5254f8d 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -178,7 +178,7 @@ static GdkPixbuf * gtk_theming_engine_render_icon_pixbuf (GtkThemingEngine *e
GtkIconSize size);
static void gtk_theming_engine_render_icon (GtkThemingEngine *engine,
cairo_t *cr,
- GdkPixbuf *pixbuf,
+ GdkPixbuf *pixbuf,
gdouble x,
gdouble y);
@@ -2928,15 +2928,22 @@ 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)
{
+ cairo_rectangle_t rect;
+
cairo_save (cr);
gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
- _gtk_css_shadows_value_paint_icon (_gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_ICON_SHADOW), cr);
+ rect.x = x;
+ rect.y = y;
+ rect.width = gdk_pixbuf_get_width (pixbuf);
+ rect.height = gdk_pixbuf_get_height (pixbuf);
+
+ _gtk_css_shadows_value_paint_icon (_gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_ICON_SHADOW), cr, &rect);
cairo_paint (cr);