summaryrefslogtreecommitdiff
path: root/gtk/gtkstyle.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-12-28 23:15:39 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-12-28 23:15:39 +0900
commit05254766c7c174cbc4951ec6df1ad64826f6c9f5 (patch)
tree5ce9219a8f17797819a8573eb9978d4b9b1672be /gtk/gtkstyle.c
parent9d64a5833dcb5afd66f3150a365180cdea595906 (diff)
downloadgtk+-05254766c7c174cbc4951ec6df1ad64826f6c9f5.tar.gz
Avoid rendering frames when shadow type argument is GTK_SHADOW_NONE in
gtk_paint_* functions.
Diffstat (limited to 'gtk/gtkstyle.c')
-rw-r--r--gtk/gtkstyle.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 635bacfc63..40c3928672 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -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);
}