[gtk] gl: Simplify glyph cache rendering



commit 7a3eaad1935d9a985ae8ece1973ca517c3b839b8
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jul 28 09:53:10 2019 -0400

    gl: Simplify glyph cache rendering
    
    We are currently using a weird mix of pango and cairo,
    but there is no need for us to go through a pango
    renderer here; we can just use cairo directly.

 gsk/gl/gskglglyphcache.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/gsk/gl/gskglglyphcache.c b/gsk/gl/gskglglyphcache.c
index 9098c64120..9dfe045edf 100644
--- a/gsk/gl/gskglglyphcache.c
+++ b/gsk/gl/gskglglyphcache.c
@@ -117,8 +117,7 @@ render_glyph (GlyphCacheKey    *key,
   cairo_surface_t *surface;
   cairo_t *cr;
   cairo_scaled_font_t *scaled_font;
-  PangoGlyphString glyph_string;
-  PangoGlyphInfo glyph_info;
+  cairo_glyph_t cairo_glyph;
   int surface_width, surface_height;
   int stride;
   unsigned char *data;
@@ -145,18 +144,14 @@ render_glyph (GlyphCacheKey    *key,
   cairo_set_scaled_font (cr, scaled_font);
   cairo_set_source_rgba (cr, 1, 1, 1, 1);
 
-  glyph_info.glyph = key->glyph;
-  glyph_info.geometry.width = value->draw_width * 1024;
+  cairo_glyph.index = key->glyph;
   if (key->glyph & PANGO_GLYPH_UNKNOWN_FLAG)
-    glyph_info.geometry.x_offset = 0;
+    cairo_glyph.x = 0;
   else
-    glyph_info.geometry.x_offset = - value->draw_x * 1024;
-  glyph_info.geometry.y_offset = - value->draw_y * 1024;
+    cairo_glyph.x = - value->draw_x;
+  cairo_glyph.y = - value->draw_y;
 
-  glyph_string.num_glyphs = 1;
-  glyph_string.glyphs = &glyph_info;
-
-  pango_cairo_show_glyph_string (cr, key->font, &glyph_string);
+  cairo_show_glyphs (cr, &cairo_glyph, 1);
   cairo_destroy (cr);
 
   cairo_surface_flush (surface);


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