[gtk/wip/otte/reftests: 3/4] rendernode: Round pixel colors in color matrix drawing



commit 1a7465ccb3fbebe599abc1d1c9e36c35e35c2cef
Author: Benjamin Otte <otte redhat com>
Date:   Thu Mar 28 23:57:00 2019 +0100

    rendernode: Round pixel colors in color matrix drawing
    
    Fixes symbolic-icon-translucent-color.ui reftest

 gsk/gskrendernodeimpl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 5e7ade0a20..271723cd29 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -3060,10 +3060,10 @@ gsk_color_matrix_node_draw (GskRenderNode *node,
           if (alpha > 0.0)
             {
               alpha = MIN (alpha, 1.0);
-              pixel_data[x] = (((guint32) (alpha * 255)) << 24) |
-                              (((guint32) (CLAMP (graphene_vec4_get_x (&pixel), 0, 1) * alpha * 255)) << 16) 
|
-                              (((guint32) (CLAMP (graphene_vec4_get_y (&pixel), 0, 1) * alpha * 255)) <<  8) 
|
-                               ((guint32) (CLAMP (graphene_vec4_get_z (&pixel), 0, 1) * alpha * 255));
+              pixel_data[x] = (((guint32) roundf (alpha * 255)) << 24) |
+                              (((guint32) roundf (CLAMP (graphene_vec4_get_x (&pixel), 0, 1) * alpha * 255)) 
<< 16) |
+                              (((guint32) roundf (CLAMP (graphene_vec4_get_y (&pixel), 0, 1) * alpha * 255)) 
<<  8) |
+                               ((guint32) roundf (CLAMP (graphene_vec4_get_z (&pixel), 0, 1) * alpha * 255));
             }
           else
             {


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