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



commit a6a51001343e9e55c5cca2b8cac39b24b4dbbf64
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]