]> Pileus Git - ~andy/gtk/commitdiff
Avoid rendering frames when shadow type argument is GTK_SHADOW_NONE in
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Tue, 28 Dec 2010 14:15:39 +0000 (23:15 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Tue, 28 Dec 2010 14:15:39 +0000 (23:15 +0900)
gtk_paint_* functions.

gtk/gtkstyle.c

index 635bacfc6360359b53b17fed6e01d229acb61f57..40c39286723f7a29676c0961b84dd92186c59bc2 100644 (file)
@@ -1639,6 +1639,9 @@ gtk_default_draw_shadow (GtkStyle      *style,
   GtkStyleContext *context;
   GtkStylePrivate *priv;
 
+  if (shadow_type == GTK_SHADOW_NONE)
+    return;
+
   if (widget)
     context = gtk_widget_get_style_context (widget);
   else
@@ -1995,7 +1998,9 @@ gtk_default_draw_box (GtkStyle      *style,
   else
     {
       gtk_render_background (context, cr, x, y, width, height);
-      gtk_render_frame (context, cr, x, y, width, height);
+
+      if (shadow_type != GTK_SHADOW_NONE)
+       gtk_render_frame (context, cr, x, y, width, height);
     }
 
   cairo_restore (cr);
@@ -2255,6 +2260,9 @@ gtk_default_draw_shadow_gap (GtkStyle       *style,
   GtkStylePrivate *priv;
   GtkStateFlags flags = 0;
 
+  if (shadow_type == GTK_SHADOW_NONE)
+    return;
+
   if (widget)
     context = gtk_widget_get_style_context (widget);
   else
@@ -2361,15 +2369,17 @@ gtk_default_draw_box_gap (GtkStyle       *style,
                          (gdouble) width,
                          (gdouble) height);
 
-  gtk_render_frame_gap (context, cr,
-                        (gdouble) x,
-                        (gdouble) y,
-                        (gdouble) width,
-                        (gdouble) height,
-                        gap_side,
-                        (gdouble) gap_x,
-                        (gdouble) gap_x + gap_width);
 
+  if (shadow_type != GTK_SHADOW_NONE)
+    gtk_render_frame_gap (context, cr,
+                         (gdouble) x,
+                         (gdouble) y,
+                         (gdouble) width,
+                         (gdouble) height,
+                         gap_side,
+                         (gdouble) gap_x,
+                         (gdouble) gap_x + gap_width);
+  
   cairo_restore (cr);
   gtk_style_context_restore (context);
 }