Render knockout transparency groups#21242
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21242 +/- ##
==========================================
+ Coverage 56.05% 56.17% +0.11%
==========================================
Files 220 220
Lines 58971 59230 +259
==========================================
+ Hits 33057 33271 +214
- Misses 25914 25959 +45
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/botio browsertest |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/fb1406cdbfb7580/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/45e27f34470de69/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/45e27f34470de69/output.txt Total script time: 19.04 mins
Image differences available at: http://54.241.84.105:8877/45e27f34470de69/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/fb1406cdbfb7580/output.txt Total script time: 24.82 mins
Image differences available at: http://54.193.163.58:8877/fb1406cdbfb7580/reftest-analyzer.html#web=eq.log |
In a knockout (KO) group each painting operator ("element") composites against
the group's initial backdrop instead of accumulating onto prior elements
of the same group. The backend renders each element to a per-group pooled
temp canvas (keyed off `#groupStackMeta`), builds a binary alpha mask via
a new `feFuncA` filter (`addKnockoutFilter`), `destination-out`s the
group canvas through that mask, restores the initial backdrop into the
cleared footprint for non-isolated groups (cropped to the same mask so
sparse groups don't bleed the whole rectangle), and finally paints the
element on top with the parent's blend mode. Path / clip / transform ops
are mirrored back to the group canvas via `mirrorContextOperations` so
graphics state stays in sync between elements; only the raster pixels
land on the temp canvas.
The temp canvas is forced to source-over for the element raster (`multiply`
on a transparent backdrop would zero the color) and the original GCO is
restored before `copyCtxState` writes back, so the parent's blend mode
survives for the final composite.
Also handled:
- Nested KO groups (the level is incremented for KO, reset to 0 for
non-KO subgroups so an ancestor KO doesn't leak in).
- Non-isolated non-KO subgroups inside a KO parent (`hasInnerBackdrop`
path: blend the elements against the subgroup's running backdrop for
color, mask with the elements-only canvas).
- Soft masks installed inside a KO element (`applySMaskInPlace` in
`compose`, which runs the SMask destination-in directly on the temp
canvas; the existing blit-to-suspended step is gated by `if (!ctx)`).
- Type-3 text, shading fills, image-mask groups, inline images and the
solid-color mask path: each is wrapped in `#begin/#endKnockoutElement`.
- `endDrawing` cleanup so cancelled rendering doesn't leak pooled
canvases or stale knockout state.
|
/botio browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/0595d9ad17b56ee/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/f4cd921513af0e5/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/0595d9ad17b56ee/output.txt Total script time: 18.52 mins
Image differences available at: http://54.241.84.105:8877/0595d9ad17b56ee/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/f4cd921513af0e5/output.txt Total script time: 24.57 mins
Image differences available at: http://54.193.163.58:8877/f4cd921513af0e5/reftest-analyzer.html#web=eq.log |
|
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/5a3a3d452929aa1/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/e1b8d4ae2bfc5a8/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/5a3a3d452929aa1/output.txt Total script time: 18.46 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/e1b8d4ae2bfc5a8/output.txt Total script time: 24.33 mins
|
In a knockout (KO) group each painting operator ("element") composites against the group's initial backdrop instead of accumulating onto prior elements of the same group. The backend renders each element to a per-group pooled temp canvas (keyed off
#groupStackMeta), builds a binary alpha mask via a newfeFuncAfilter (addKnockoutFilter),destination-outs the group canvas through that mask, restores the initial backdrop into the cleared footprint for non-isolated groups (cropped to the same mask so sparse groups don't bleed the whole rectangle), and finally paints the element on top with the parent's blend mode. Path / clip / transform ops are mirrored back to the group canvas viamirrorContextOperationsso graphics state stays in sync between elements; only the raster pixels land on the temp canvas.The temp canvas is forced to source-over for the element raster (
multiplyon a transparent backdrop would zero the color) and the original GCO is restored beforecopyCtxStatewrites back, so the parent's blend mode survives for the final composite.Also handled:
hasInnerBackdroppath: blend the elements against the subgroup's running backdrop for color, mask with the elements-only canvas).applySMaskInPlaceincompose, which runs the SMask destination-in directly on the temp canvas; the existing blit-to-suspended step is gated byif (!ctx)).#begin/#endKnockoutElement.endDrawingcleanup so cancelled rendering doesn't leak pooled canvases or stale knockout state.