Merge pull request #21262 from calixteman/issue18032

Fix nested non-isolated groups in knockout rendering
This commit is contained in:
calixteman 2026-05-12 22:37:31 +02:00 committed by GitHub
commit 7f151c777b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 3 deletions

View File

@ -3341,13 +3341,15 @@ class CanvasGraphics {
// #compositeKnockoutSurface so it doesn't become part of the group // #compositeKnockoutSurface so it doesn't become part of the group
// source itself. // source itself.
const backdropCtx = group.knockout && !group.isolated ? currentCtx : null; const backdropCtx = group.knockout && !group.isolated ? currentCtx : null;
// Non-isolated non-KO subgroup inside a KO parent: at endGroup we'll // Non-isolated non-KO subgroup inside a KO parent, with inner compositing
// blend its elements against the outer KO running canvas (also frozen), // of its own: at endGroup we'll blend its elements against the outer KO
// so just record the flag here and read ctx.canvas at composite time. // running canvas (also frozen), so just record the flag here and read
// ctx.canvas at composite time.
const hasInnerBackdrop = const hasInnerBackdrop =
!group.isolated && !group.isolated &&
!group.knockout && !group.knockout &&
!group.smask && !group.smask &&
group.needsIsolation &&
this.#knockoutGroupLevel > 0; this.#knockoutGroupLevel > 0;
// Pool the per-element shape mask for the lifetime of this KO group. // Pool the per-element shape mask for the lifetime of this KO group.

View File

@ -920,3 +920,4 @@
!smask_luminosity_oob_transfer.pdf !smask_luminosity_oob_transfer.pdf
!operator_list_cycle.pdf !operator_list_cycle.pdf
!knockout_groups_test.pdf !knockout_groups_test.pdf
!issue18032.pdf

BIN
test/pdfs/issue18032.pdf Normal file

Binary file not shown.

View File

@ -14252,5 +14252,13 @@
"rounds": 1, "rounds": 1,
"type": "eq", "type": "eq",
"about": "Knockout groups composite-modes survey." "about": "Knockout groups composite-modes survey."
},
{
"id": "issue18032",
"file": "pdfs/issue18032.pdf",
"md5": "656234fde97953c4e3fc7698831590a9",
"rounds": 1,
"type": "eq",
"about": "Non-isolated knockout group with a nested non-isolated subgroup over existing text."
} }
] ]