Commit 05254766 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

Avoid rendering frames when shadow type argument is GTK_SHADOW_NONE in

gtk_paint_* functions.
parent 9d64a583
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment