[gnome-shell] StThemeNodeDrawing: fill background behind translucent gradients



commit b4ec342d0603f1dc39cdadec62d9dcd7ec49f17d
Author: Ray Strode <rstrode redhat com>
Date:   Mon Jan 24 16:00:51 2011 -0500

    StThemeNodeDrawing: fill background behind translucent gradients
    
    If a background gradient isn't fully opaque, then we need to first
    fill in the background color so the border color doesn't leak into
    the interior.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=640465

 src/st/st-theme-node-drawing.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
index 088ab48..777c36a 100644
--- a/src/st/st-theme-node-drawing.c
+++ b/src/st/st-theme-node-drawing.c
@@ -452,7 +452,8 @@ st_theme_node_has_visible_outline (StThemeNode *node)
 }
 
 static cairo_pattern_t *
-create_cairo_pattern_of_background_gradient (StThemeNode *node)
+create_cairo_pattern_of_background_gradient (StThemeNode *node,
+                                             gboolean    *needs_background_fill)
 {
   cairo_pattern_t *pattern;
 
@@ -482,6 +483,12 @@ create_cairo_pattern_of_background_gradient (StThemeNode *node)
                                      node->background_gradient_end.green / 255.,
                                      node->background_gradient_end.blue / 255.,
                                      node->background_gradient_end.alpha / 255.);
+  if (node->background_color.alpha > 0 ||
+      node->background_gradient_end.alpha > 0)
+    *needs_background_fill = TRUE;
+  else
+    *needs_background_fill = FALSE;
+
   return pattern;
 }
 
@@ -787,8 +794,8 @@ st_theme_node_render_background_with_border (StThemeNode *node)
    */
   if (node->background_gradient_type != ST_GRADIENT_NONE)
     {
-      pattern = create_cairo_pattern_of_background_gradient (node);
-      draw_solid_background = FALSE;
+      pattern = create_cairo_pattern_of_background_gradient (node,
+                                                             &draw_solid_background);
     }
   else
     {



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