[gtk/wip/chergert/glproto: 471/526] share alpha check




commit cbd80b65d2df1a4ae981099bf7c6a4ac0b44ada0
Author: Christian Hergert <chergert redhat com>
Date:   Mon Feb 8 13:23:30 2021 -0800

    share alpha check

 gsk/next/gskglrenderjob.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index 81f1c3ad23..4c1f611814 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -70,7 +70,8 @@
 #define rounded_rect_corner2(r)   rounded_rect_bottom_right(r)
 #define rounded_rect_corner3(r)   rounded_rect_bottom_left(r)
 #define rounded_rect_corner(r, i) (rounded_rect_corner##i(r))
-#define RGBA_IS_CLEAR(rgba) ((rgba)->alpha < ((float) 0x00ff / (float) 0xffff))
+#define ALPHA_IS_CLEAR(alpha) ((alpha) < ((float) 0x00ff / (float) 0xffff))
+#define RGBA_IS_CLEAR(rgba) ALPHA_IS_CLEAR((rgba)->alpha)
 
 typedef struct _GskGLRenderClip
 {
@@ -2506,7 +2507,7 @@ gsk_gl_render_job_visit_opacity_node (GskGLRenderJob      *job,
   job->alpha = new_alpha;
   job->driver->last_shared_state++;
 
-  if (new_alpha >= ((float)0x00ff / (float)0xffff))
+  if (!ALPHA_IS_CLEAR (new_alpha))
     {
       if (gsk_render_node_get_node_type (child) == GSK_CONTAINER_NODE)
         {


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