summaryrefslogtreecommitdiff
path: root/gsk/gskrendernodeparser.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2021-09-16 07:39:21 +0200
committerBenjamin Otte <otte@redhat.com>2021-09-16 23:59:37 +0200
commit56b31c3923bcb5412f0d75ab6be92fb1656590de (patch)
tree3b3752f8b58d56477a4172c55bc51dae00daf8c3 /gsk/gskrendernodeparser.c
parent93323be22a5727ceaea67938e88acf31066f7ee0 (diff)
downloadgtk+-56b31c3923bcb5412f0d75ab6be92fb1656590de.tar.gz
rendernodeparser: Handle is_color attribute for glyphs
Diffstat (limited to 'gsk/gskrendernodeparser.c')
-rw-r--r--gsk/gskrendernodeparser.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c
index 9aa091001f..c4c721e2e3 100644
--- a/gsk/gskrendernodeparser.c
+++ b/gsk/gskrendernodeparser.c
@@ -802,6 +802,11 @@ parse_glyphs (GtkCssParser *parser,
gi.attr.is_cluster_start = 0;
else
gi.attr.is_cluster_start = 1;
+
+ if (gtk_css_parser_try_ident (parser, "color"))
+ gi.attr.is_color = 1;
+ else
+ gi.attr.is_color = 0;
}
pango_glyph_string_set_size (glyph_string, glyph_string->num_glyphs + 1);
@@ -2336,7 +2341,8 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
glyphs[i].geometry.width == ascii->glyphs[j].geometry.width &&
glyphs[i].geometry.x_offset == 0 &&
glyphs[i].geometry.y_offset == 0 &&
- glyphs[i].attr.is_cluster_start)
+ glyphs[i].attr.is_cluster_start &&
+ !glyphs[i].attr.is_color)
{
switch (j + MIN_ASCII_GLYPH)
{
@@ -2366,6 +2372,7 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
g_string_append_printf (p, "%u ", glyphs[i].glyph);
string_append_double (p, (double) glyphs[i].geometry.width / PANGO_SCALE);
if (!glyphs[i].attr.is_cluster_start ||
+ glyphs[i].attr.is_color ||
glyphs[i].geometry.x_offset != 0 ||
glyphs[i].geometry.y_offset != 0)
{
@@ -2375,6 +2382,8 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
string_append_double (p, (double) glyphs[i].geometry.y_offset / PANGO_SCALE);
if (!glyphs[i].attr.is_cluster_start)
g_string_append (p, " same-cluster");
+ if (!glyphs[i].attr.is_color)
+ g_string_append (p, " color");
}
if (i + 1 < n_glyphs)