testsuite: Add unaligned-offscreen test
authorSebastian Keller <skeller@gnome.org>
Mon, 4 Apr 2022 20:55:16 +0000 (22:55 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 21 Apr 2022 23:23:13 +0000 (19:23 -0400)
Tests whether text rendered to an offscreen node unaligned with the
pixel grid introduces blurriness.

testsuite/gsk/compare/unaligned-offscreen.node [new file with mode: 0644]
testsuite/gsk/compare/unaligned-offscreen.png [new file with mode: 0644]
testsuite/gsk/meson.build

diff --git a/testsuite/gsk/compare/unaligned-offscreen.node b/testsuite/gsk/compare/unaligned-offscreen.node
new file mode 100644 (file)
index 0000000..c116928
--- /dev/null
@@ -0,0 +1,23 @@
+blend {
+  mode: normal;
+  top: transform {
+    child: blend {
+      top: text {
+        color: rgb(0, 0, 0);
+        font: "Cantarell Bold 11";
+        glyphs: "|||||||||||||||||||||||";
+      }
+      bottom: text {
+        color: rgb(0, 0, 0);
+        font: "Cantarell Bold 11";
+        glyphs: "===========";
+    offset: 0 13;
+      }
+    }
+    transform: translate(1.5, 15.5);
+  }
+  bottom: color {
+    color: red;
+    bounds: 0 0 100 30;
+  }
+}
diff --git a/testsuite/gsk/compare/unaligned-offscreen.png b/testsuite/gsk/compare/unaligned-offscreen.png
new file mode 100644 (file)
index 0000000..bb624f1
Binary files /dev/null and b/testsuite/gsk/compare/unaligned-offscreen.png differ
index 106661a70889c094d273ab481227892b18e82478..2fb02087d30ae5e839e20e4919417e8f8c9c2a86 100644 (file)
@@ -83,6 +83,7 @@ compare_render_tests = [
   'repeat-texture',
   'transform-in-transform',
   'transform-in-transform-in-transform',
+  'unaligned-offscreen',
   'rounded-clip-in-clip-3d', # not really 3d, but cairo fails it
 ]