summaryrefslogtreecommitdiff
path: root/test/shapes.script
diff options
context:
space:
mode:
Diffstat (limited to 'test/shapes.script')
-rw-r--r--test/shapes.script30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/shapes.script b/test/shapes.script
new file mode 100644
index 0000000..3111d5c
--- /dev/null
+++ b/test/shapes.script
@@ -0,0 +1,30 @@
+# Command.shape natively: each case at points well inside it (edges are
+# aliased here and antialiased on the web; tools/shapes_web.mjs compares
+# whole pictures). Translucent colours blend once per command.
+frames 2
+screenshot .zig-cache/shapes/native.png
+frames 1
+# Two translucent circles: once alone, twice where they overlap.
+expect-pixel .zig-cache/shapes/native.png 60 80 255 127 127 255 2
+expect-pixel .zig-cache/shapes/native.png 110 80 255 63 63 255 2
+# The concave polygon: one blend everywhere inside, nothing in its notch.
+expect-pixel .zig-cache/shapes/native.png 300 40 127 191 127 255 2
+expect-pixel .zig-cache/shapes/native.png 240 40 127 191 127 255 2
+expect-pixel .zig-cache/shapes/native.png 300 120 255 255 255 255 0
+# The acute zig-zag: one blend at its joins too (no overlap, no hole).
+expect-pixel .zig-cache/shapes/native.png 60 228 127 127 255 255 2
+expect-pixel .zig-cache/shapes/native.png 100 372 127 127 255 255 2
+expect-pixel .zig-cache/shapes/native.png 140 228 127 127 255 255 2
+expect-pixel .zig-cache/shapes/native.png 80 300 127 127 255 255 2
+# The ring and its hole.
+expect-pixel .zig-cache/shapes/native.png 300 212 175 95 175 255 2
+expect-pixel .zig-cache/shapes/native.png 300 240 255 255 255 255 0
+# A 1 px line on a pixel row: full intensity, one row.
+expect-pixel .zig-cache/shapes/native.png 300 300 0 0 0 255 0
+expect-pixel .zig-cache/shapes/native.png 300 299 255 255 255 255 0
+expect-pixel .zig-cache/shapes/native.png 300 301 255 255 255 255 0
+# Many circles, one command each and all in one.
+console circles 5000
+frames 2
+console batched 5000
+frames 2