[gtk/transparent-optimizations: 3/3] ngl: Do nothing for transparent text nodes




commit c799452973ff17cfcc918c681895f80246e1086b
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jul 15 13:17:17 2021 -0400

    ngl: Do nothing for transparent text nodes
    
    Like the previous commit - a transparent text node
    will not produce any visible pixels, so bail out early.

 gsk/ngl/gsknglrenderjob.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index 8785766612..3f36d506ab 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -2850,7 +2850,12 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob     *job,
    * We tell the shader by setting the color to vec4(-1).
    */
   if (force_color || !gsk_text_node_has_color_glyphs (node))
-    rgba_to_half (color, c);
+    {
+      if (gdk_rgba_is_clear (color))
+        return;
+
+      rgba_to_half (color, c);
+    }
 
   lookup.font = (PangoFont *)font;
   lookup.scale = (guint) (text_scale * 1024);


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