summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2018-01-06 13:02:31 +0100
committerTimm Bäder <mail@baedert.org>2018-01-06 13:02:31 +0100
commitdc8716e0ce4f812ae2a1a51e145e740762a322be (patch)
tree9acfd93bcc894435ae126566019f280b9223ce08
parentf6712a91e24638bd395ea5f1ea9f1e7928d760e6 (diff)
downloadgtk+-wip/baedert/gl.tar.gz
gl renderer: Bring back hexbox drawingwip/baedert/gl
-rw-r--r--gsk/gl/gskglglyphcache.c17
-rw-r--r--gsk/gl/gskglrenderer.c3
2 files changed, 13 insertions, 7 deletions
diff --git a/gsk/gl/gskglglyphcache.c b/gsk/gl/gskglglyphcache.c
index 9e253e2587..39aa142ff9 100644
--- a/gsk/gl/gskglglyphcache.c
+++ b/gsk/gl/gskglglyphcache.c
@@ -240,7 +240,8 @@ render_glyph (const GskGLGlyphAtlas *atlas,
cairo_surface_t *surface;
cairo_t *cr;
cairo_scaled_font_t *scaled_font;
- cairo_glyph_t cg;
+ PangoGlyphString glyph_string;
+ PangoGlyphInfo glyph_info;
scaled_font = pango_cairo_font_get_scaled_font ((PangoCairoFont *)key->font);
if (G_UNLIKELY (!scaled_font || cairo_scaled_font_status (scaled_font) != CAIRO_STATUS_SUCCESS))
@@ -256,12 +257,18 @@ render_glyph (const GskGLGlyphAtlas *atlas,
cairo_set_scaled_font (cr, scaled_font);
cairo_set_source_rgba (cr, 1, 1, 1, 1);
- cg.index = key->glyph;
- cg.x = - value->draw_x;
- cg.y = - value->draw_y;
+ glyph_info.glyph = key->glyph;
+ glyph_info.geometry.width = value->draw_width * 1024;
+ if (key->glyph & PANGO_GLYPH_UNKNOWN_FLAG)
+ glyph_info.geometry.x_offset = 0;
+ else
+ glyph_info.geometry.x_offset = - value->draw_x * 1024;
+ glyph_info.geometry.y_offset = - value->draw_y * 1024;
- cairo_show_glyphs (cr, &cg, 1);
+ glyph_string.num_glyphs = 1;
+ glyph_string.glyphs = &glyph_info;
+ pango_cairo_show_glyph_string (cr, key->font, &glyph_string);
cairo_destroy (cr);
glyph->surface = surface;
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 7a69d59d42..e243478458 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -373,8 +373,7 @@ render_text_node (GskGLRenderer *self,
double cx;
double cy;
- if (gi->glyph == PANGO_GLYPH_EMPTY ||
- (gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG) > 0)
+ if (gi->glyph == PANGO_GLYPH_EMPTY)
continue;
glyph = gsk_gl_glyph_cache_lookup (&self->glyph_cache,