[gnome-shell] BigRectangle: Use pre-multiplied colors



commit 66459eff965fe06a2b78dc454a6ebc4789a45243
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu May 14 10:00:22 2009 -0400

    BigRectangle: Use pre-multiplied colors
    
    With recent Clutter changes to the default blend mode, premultiplied
    colors should be used for cogl_material_set_color() in the normal
    case.
    
    http://bugzilla.gnome.org/show_bug.cgi?id=585473

 src/big/rectangle.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/big/rectangle.c b/src/big/rectangle.c
index 2b1fb7d..8ca104d 100644
--- a/src/big/rectangle.c
+++ b/src/big/rectangle.c
@@ -362,7 +362,7 @@ big_rectangle_paint(ClutterActor *actor)
 
     if (radius != 0) {
         cogl_color_set_from_4ub(&tmp_color,
-                                0xff, 0xff, 0xff, actor_opacity);
+                                actor_opacity, actor_opacity, actor_opacity, actor_opacity);
         cogl_material_set_color(rectangle->corner_material, &tmp_color);
         cogl_set_source(rectangle->corner_material);
 
@@ -401,6 +401,7 @@ big_rectangle_paint(ClutterActor *actor)
                                 border_color->green,
                                 border_color->blue,
                                 actor_opacity * border_color->alpha / 255);
+        cogl_color_premultiply (&tmp_color);
         cogl_material_set_color(rectangle->border_material, &tmp_color);
         cogl_set_source(rectangle->border_material);
 
@@ -429,6 +430,7 @@ big_rectangle_paint(ClutterActor *actor)
                             color->green,
                             color->blue,
                             actor_opacity * color->alpha / 255);
+    cogl_color_premultiply (&tmp_color);
     cogl_material_set_color(rectangle->background_material, &tmp_color);
     cogl_set_source(rectangle->background_material);
 



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