From aec81b906c845eff3e1953dda9be3c0aefed1851 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Wed, 3 May 2023 13:32:04 -0700 Subject: [PATCH] [Impeller] Remove the DrawPaint->Clear optimization --- impeller/aiks/aiks_unittests.cc | 12 ------------ impeller/aiks/canvas.cc | 10 ---------- 2 files changed, 22 deletions(-) diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index aa29669476909..5858719b6c8cd 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -1818,18 +1818,6 @@ TEST_P(AiksTest, OpacityPeepHoleApplicationTest) { ASSERT_TRUE(delegate->CanCollapseIntoParentPass(entity_pass.get())); } -TEST_P(AiksTest, DrawPaintAbsorbsClears) { - Canvas canvas; - canvas.DrawPaint({.color = Color::Red(), .blend_mode = BlendMode::kSource}); - canvas.DrawPaint( - {.color = Color::CornflowerBlue(), .blend_mode = BlendMode::kSource}); - - Picture picture = canvas.EndRecordingAsPicture(); - - ASSERT_EQ(picture.pass->GetElementCount(), 0u); - ASSERT_EQ(picture.pass->GetClearColor(), Color::CornflowerBlue()); -} - TEST_P(AiksTest, ForegroundBlendSubpassCollapseOptimization) { Canvas canvas; diff --git a/impeller/aiks/canvas.cc b/impeller/aiks/canvas.cc index 9cbe4e82eaf9e..662ea009cd6ce 100644 --- a/impeller/aiks/canvas.cc +++ b/impeller/aiks/canvas.cc @@ -172,16 +172,6 @@ void Canvas::DrawPath(const Path& path, const Paint& paint) { } void Canvas::DrawPaint(const Paint& paint) { - if (xformation_stack_.size() == 1 && // If we're recording the root pass, - GetCurrentPass().GetElementCount() == 0 // and this is the first item, - ) { - // Then we can absorb this drawPaint as the clear color of the pass. - auto color = Color::BlendColor( - paint.color, GetCurrentPass().GetClearColor(), paint.blend_mode); - GetCurrentPass().SetClearColor(color); - return; - } - Entity entity; entity.SetTransformation(GetCurrentTransformation()); entity.SetStencilDepth(GetStencilDepth());