diff options
author | Timm Bäder <mail@baedert.org> | 2018-01-09 05:59:19 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-01-10 08:46:22 +0100 |
commit | c9e6fcd5fa4d7cdebe832866b0ea3c98fb3955fb (patch) | |
tree | 9ef0c0de8059a707a59897b1fadea346a00624d1 /gtk | |
parent | b6ee3490c3336e8a2ff700a2787cc456787a5247 (diff) | |
download | gtk+-c9e6fcd5fa4d7cdebe832866b0ea3c98fb3955fb.tar.gz |
renderbackground: Pull out a gdk_rgba_is_clear check
We only call snapshot_color once, and this way it's clearer that nothing
will happen for a clear color from the caller side.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkrenderbackground.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c index 0d3f31a671..612c9c01bf 100644 --- a/gtk/gtkrenderbackground.c +++ b/gtk/gtkrenderbackground.c @@ -86,9 +86,6 @@ gtk_theming_background_snapshot_color (GtkThemingBackground *bg, (gtk_css_style_get_value (bg->style, GTK_CSS_PROPERTY_BACKGROUND_CLIP), n_values - 1)); - if (gdk_rgba_is_clear (bg_color)) - return; - if (gsk_rounded_rect_is_rectilinear (&bg->boxes[clip])) { gtk_snapshot_append_color (snapshot, @@ -658,7 +655,8 @@ gtk_css_style_snapshot_background (GtkCssStyle *style, gtk_snapshot_push_blend (snapshot, blend_mode, "Background<%u>Blend<%u>", idx, blend_mode); } - gtk_theming_background_snapshot_color (&bg, snapshot, bg_color, background_image); + if (!gdk_rgba_is_clear (bg_color)) + gtk_theming_background_snapshot_color (&bg, snapshot, bg_color, background_image); for (idx = number_of_layers - 1; idx >= 0; idx--) { |