rendernode: Fix handling of color glyphs
authorMatthias Clasen <mclasen@redhat.com>
Wed, 13 Sep 2023 17:33:07 +0000 (13:33 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 19 Sep 2023 20:32:27 +0000 (16:32 -0400)
The rendernode parser was mixing up its flags.

Test included.

Related: #6075

gsk/gskrendernodeparser.c
testsuite/gsk/meson.build
testsuite/gsk/nodeparser/text-color.node [new file with mode: 0644]
testsuite/gsk/nodeparser/text-color.ref.node [new file with mode: 0644]

index 7a1b7a9bb147d4e0cd49e4414f571fd64174a65f..7f00437068bdb4c533ad1173335031264d0eca16 100644 (file)
@@ -3019,7 +3019,7 @@ 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)
+          if (glyphs[i].attr.is_color)
             g_string_append (p, " color");
         }
 
index c0facb5a12faca35c3ad511cae8b13b15eb639a1..eb76c4a8890e0aa454ef151cfe7f30626d2bd8d2 100644 (file)
@@ -323,6 +323,8 @@ node_parser_tests = [
   'string-error.node',
   'string-error.ref.node',
   'testswitch.node',
+  'text-color.node',
+  'text-color.ref.node',
   'text-fail.node',
   'text-fail.ref.node',
   'text-fail.errors',
diff --git a/testsuite/gsk/nodeparser/text-color.node b/testsuite/gsk/nodeparser/text-color.node
new file mode 100644 (file)
index 0000000..8c0786b
--- /dev/null
@@ -0,0 +1,5 @@
+text {
+  color: rgba(255,0,0,0.533333);
+  font: "Noto Sans 300";
+  glyphs: 50 312, 2712 0 -156 -28.7891 color;
+}
diff --git a/testsuite/gsk/nodeparser/text-color.ref.node b/testsuite/gsk/nodeparser/text-color.ref.node
new file mode 100644 (file)
index 0000000..8c0786b
--- /dev/null
@@ -0,0 +1,5 @@
+text {
+  color: rgba(255,0,0,0.533333);
+  font: "Noto Sans 300";
+  glyphs: 50 312, 2712 0 -156 -28.7891 color;
+}