summaryrefslogtreecommitdiff
path: root/gsk/gskprivate.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-09-01 16:58:42 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-09-10 14:36:26 -0400
commitb0e8d8483d2b46dfc4d678e4a217d540837a2478 (patch)
tree6d85e2f8ac33c4ece118dec754ac1a8ad3c80404 /gsk/gskprivate.c
parentedc73e78b8e312f5e52f9d464baebe7a5d0fe581 (diff)
downloadgtk+-b0e8d8483d2b46dfc4d678e4a217d540837a2478.tar.gz
More work on text nodes
This commit takes several steps towards rendering text like we want to. The creation of the cairo surface and texture is moved to the backend (in GskVulkanRenderer). We add a mask shader that is used in the next text pipeline to use the texture as a mask, like cairo_mask_surface does. There is a separate color text pipeline that uses the already existing blend shaders to use the texture as a source, like cairo_paint does. The text node api is simplified to have just a single offset, which determines the left end of the text baseline, like all our other text drawing APIs.
Diffstat (limited to 'gsk/gskprivate.c')
-rw-r--r--gsk/gskprivate.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gsk/gskprivate.c b/gsk/gskprivate.c
index 8404b9dbc6..d9e1c3e30f 100644
--- a/gsk/gskprivate.c
+++ b/gsk/gskprivate.c
@@ -15,3 +15,23 @@ gsk_ensure_resources (void)
g_once (&register_resources_once, register_resources, NULL);
}
+
+int
+pango_glyph_string_num_glyphs (PangoGlyphString *glyphs)
+{
+ int i, count;
+
+ count = 0;
+ for (i = 0; i < glyphs->num_glyphs; i++)
+ {
+ PangoGlyphInfo *gi = &glyphs->glyphs[i];
+ if (gi->glyph != PANGO_GLYPH_EMPTY)
+ {
+ if (!(gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG))
+ count++;
+ }
+ }
+
+ return count;
+}
+