[gtk+/wip/baedert/gl: 32/86] gl renderer: Only check for color glyphs once per text node



commit 2eb428e998375477597f9efd700e9ec69dd9040e
Author: Timm Bäder <mail baedert org>
Date:   Thu Nov 23 10:10:43 2017 +0100

    gl renderer: Only check for color glyphs once per text node
    
    It does not depend on the glyph, so no need to do it once for every
    glyph.

 gsk/gl/gskglrenderer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 5028273..5bc651d 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -868,6 +868,7 @@ gsk_gl_renderer_add_render_ops (GskGLRenderer   *self,
       {
         const PangoFont *font = gsk_text_node_peek_font (node);
         const PangoGlyphInfo *glyphs = gsk_text_node_peek_glyphs (node);
+        const gboolean has_color_glyphs = font_has_color_glyphs (font);
         guint num_glyphs = gsk_text_node_get_num_glyphs (node);
         int i;
         int x_position = 0;
@@ -905,7 +906,7 @@ gsk_gl_renderer_add_render_ops (GskGLRenderer   *self,
             cy = (double)(gi->geometry.y_offset) / PANGO_SCALE;
 
             /* If the font has color glyphs, we don't need to recolor anything */
-            if (font_has_color_glyphs (font))
+            if (has_color_glyphs)
               {
                 ops_set_program (builder, &self->blit_program);
               }


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