diff options
author | Timm Bäder <mail@baedert.org> | 2016-04-30 21:06:07 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2016-05-02 19:28:33 +0200 |
commit | 38181bc3d2fa329334ac74773047c362db10fcce (patch) | |
tree | ad82f286a7d022e9294c285b285a01d9a48629a3 /gtk/gtkcssshadowvalue.c | |
parent | ef7ccab188ea27de30390d674c0690f90d0b21f5 (diff) | |
download | gtk+-38181bc3d2fa329334ac74773047c362db10fcce.tar.gz |
shadowsvalue: Don't draw invisible box shadows
Diffstat (limited to 'gtk/gtkcssshadowvalue.c')
-rw-r--r-- | gtk/gtkcssshadowvalue.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c index 93b4dcf927..35d3df764a 100644 --- a/gtk/gtkcssshadowvalue.c +++ b/gtk/gtkcssshadowvalue.c @@ -516,6 +516,10 @@ _gtk_css_shadow_value_paint_layout (const GtkCssValue *shadow, { g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW); + /* We don't need to draw invisible shadows */ + if (gtk_rgba_is_clear (_gtk_css_rgba_value_get_rgba (shadow->color))) + return; + if (!cairo_has_current_point (cr)) cairo_move_to (cr, 0, 0); @@ -558,6 +562,10 @@ _gtk_css_shadow_value_paint_icon (const GtkCssValue *shadow, g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW); + /* We don't need to draw invisible shadows */ + if (gtk_rgba_is_clear (_gtk_css_rgba_value_get_rgba (shadow->color))) + return; + cairo_save (cr); pattern = cairo_pattern_reference (cairo_get_source (cr)); @@ -875,6 +883,10 @@ _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow, g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW); + /* We don't need to draw invisible shadows */ + if (gtk_rgba_is_clear (_gtk_css_rgba_value_get_rgba (shadow->color))) + return; + cairo_clip_extents (cr, &x1c, &y1c, &x2c, &y2c); if ((shadow->inset && !_gtk_rounded_box_intersects_rectangle (padding_box, x1c, y1c, x2c, y2c)) || (!shadow->inset && _gtk_rounded_box_contains_rectangle (padding_box, x1c, y1c, x2c, y2c))) |