Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 730e88f

Browse files
authored
[Impeller] Check the correct stencil coverage when deciding whether to elide a restore (#39023)
1 parent acca56c commit 730e88f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

impeller/aiks/aiks_unittests.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,11 @@ TEST_P(AiksTest, CanRenderWithContiguousClipRestores) {
278278

279279
canvas.Save();
280280

281-
// Append two clips. First with empty coverage.
281+
// Append two clips, the second resulting in empty coverage.
282282
canvas.ClipPath(
283283
PathBuilder{}.AddRect(Rect::MakeXYWH(100, 100, 100, 100)).TakePath());
284284
canvas.ClipPath(
285-
PathBuilder{}.AddRect(Rect::MakeXYWH(100, 100, 100, 100)).TakePath());
285+
PathBuilder{}.AddRect(Rect::MakeXYWH(300, 300, 100, 100)).TakePath());
286286

287287
// Restore to no clips.
288288
canvas.Restore();

impeller/entity/entity_pass.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,9 @@ bool EntityPass::OnRender(
460460
element_entity.GetStencilDepth() - stencil_depth_floor;
461461
FML_DCHECK(restoration_depth < stencil_stack.size());
462462

463-
auto restored_coverage = stencil_stack.back().coverage;
464463
stencil_stack.resize(restoration_depth + 1);
465464

466-
if (!restored_coverage.has_value()) {
465+
if (!stencil_stack.back().coverage.has_value()) {
467466
// Running this restore op won't make anything renderable, so skip it.
468467
return true;
469468
}

0 commit comments

Comments
 (0)