[gtk+] renderbackground: Pull out a gdk_rgba_is_clear check



commit c9e6fcd5fa4d7cdebe832866b0ea3c98fb3955fb
Author: Timm Bäder <mail baedert org>
Date:   Tue Jan 9 05:59:19 2018 +0100

    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.

 gtk/gtkrenderbackground.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c
index 0d3f31a..612c9c0 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--)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]