[gtk+/wip/cssvalue: 64/137] theming: Use peek_property() calls to query shadows



commit 09f4d2701f823d6878a63ff2afcd16142e670e15
Author: Benjamin Otte <otte redhat com>
Date:   Wed Mar 28 01:03:39 2012 +0200

    theming: Use peek_property() calls to query shadows

 gtk/gtkthemingbackground.c |    5 +----
 gtk/gtkthemingengine.c     |   18 +++---------------
 2 files changed, 4 insertions(+), 19 deletions(-)
---
diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c
index fee8606..1515429 100644
--- a/gtk/gtkthemingbackground.c
+++ b/gtk/gtkthemingbackground.c
@@ -303,14 +303,11 @@ _gtk_theming_background_apply_shadow (GtkThemingBackground *bg,
 {
   GtkShadow *box_shadow;
 
-  gtk_style_context_get (bg->context, bg->flags,
-                         "box-shadow", &box_shadow,
-                         NULL);
+  box_shadow = _gtk_css_value_get_shadow (_gtk_style_context_peek_property (bg->context, "box-shadow"));
 
   if (box_shadow != NULL)
     {
       _gtk_box_shadow_render (box_shadow, cr, &bg->padding_box);
-      _gtk_shadow_unref (box_shadow);
     }
 }
 
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index d5eb10b..e951105 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -2132,16 +2132,13 @@ gtk_theming_engine_render_layout (GtkThemingEngine *engine,
       fg_color.alpha = CLAMP (fg_color.alpha + ((other_fg.alpha - fg_color.alpha) * progress), 0, 1);
     }
 
-  gtk_theming_engine_get (engine, flags,
-                          "text-shadow", &text_shadow,
-                          NULL);
+  text_shadow = _gtk_css_value_get_shadow (_gtk_theming_engine_peek_property (engine, "text-shadow"));
 
   prepare_context_for_layout (cr, x, y, layout);
 
   if (text_shadow != NULL)
     {
       _gtk_text_shadow_paint_layout (text_shadow, cr, layout);
-      _gtk_shadow_unref (text_shadow);
     }
 
   gdk_cairo_set_source_rgba (cr, &fg_color);
@@ -2769,9 +2766,7 @@ render_spinner (GtkThemingEngine *engine,
   radius = MIN (width / 2, height / 2);
 
   gtk_theming_engine_get_color (engine, state, &color);
-  gtk_theming_engine_get (engine, state,
-                          "icon-shadow", &shadow,
-                          NULL);
+  shadow = _gtk_css_value_get_shadow (_gtk_theming_engine_peek_property (engine, "icon-shadow"));
 
   cairo_save (cr);
   cairo_translate (cr, x + width / 2, y + height / 2);
@@ -2781,7 +2776,6 @@ render_spinner (GtkThemingEngine *engine,
       _gtk_icon_shadow_paint_spinner (shadow, cr,
                                       radius,
                                       progress);
-      _gtk_shadow_unref (shadow);
     }
 
   _gtk_theming_engine_paint_spinner (cr,
@@ -2949,23 +2943,17 @@ gtk_theming_engine_render_icon (GtkThemingEngine *engine,
                                 gdouble x,
                                 gdouble y)
 {
-  GtkStateFlags state;
   GtkShadow *icon_shadow;
 
-  state = gtk_theming_engine_get_state (engine);
-
   cairo_save (cr);
 
   gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
 
-  gtk_theming_engine_get (engine, state,
-                          "icon-shadow", &icon_shadow,
-                          NULL);
+  icon_shadow = _gtk_css_value_get_shadow (_gtk_theming_engine_peek_property (engine, "icon-shadow"));
 
   if (icon_shadow != NULL)
     {
       _gtk_icon_shadow_paint (icon_shadow, cr);
-      _gtk_shadow_unref (icon_shadow);
     }
 
   cairo_paint (cr);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]