From 65fd5963c0be45b7308b756e624d8caf2b892308 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 27 Mar 2023 10:16:56 -0700 Subject: [PATCH 1/3] [Impeller] initialize text alpha to 1.0 --- impeller/entity/contents/text_contents.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/entity/contents/text_contents.h b/impeller/entity/contents/text_contents.h index b36cc83604931..8349842cf8fd6 100644 --- a/impeller/entity/contents/text_contents.h +++ b/impeller/entity/contents/text_contents.h @@ -56,7 +56,7 @@ class TextContents final : public Contents { private: TextFrame frame_; Color color_; - Scalar inherited_opacity_; + Scalar inherited_opacity_ = 1.0; mutable std::shared_ptr lazy_atlas_; Matrix inverse_matrix_; From e1ae201773130dfc32155807ece96e969fbf56cc Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 27 Mar 2023 12:50:54 -0700 Subject: [PATCH 2/3] [Impeller] dont unconditionally clear the screen --- flow/compositor_context.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flow/compositor_context.cc b/flow/compositor_context.cc index 12e3ed9751ea8..5e0fdd8ca3bd4 100644 --- a/flow/compositor_context.cc +++ b/flow/compositor_context.cc @@ -6,6 +6,7 @@ #include #include + #include "flutter/flow/layers/layer_tree.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -162,7 +163,10 @@ RasterStatus CompositorContext::ScopedFrame::Raster( paint.setBlendMode(DlBlendMode::kSrc); canvas()->SaveLayer(&bounds, &paint); } - canvas()->Clear(DlColor::kTransparent()); + // Impeller does not require a full screen clear. + if (gr_context_) { + canvas()->Clear(DlColor::kTransparent()); + } } layer_tree.Paint(*this, ignore_raster_cache); // The canvas()->Restore() is taken care of by the DlAutoCanvasRestore From 98081f1c047e85c12ad52e2a26a49ca936b9e4bf Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 27 Mar 2023 12:53:58 -0700 Subject: [PATCH 3/3] Update text_contents.h --- impeller/entity/contents/text_contents.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/entity/contents/text_contents.h b/impeller/entity/contents/text_contents.h index 8349842cf8fd6..b36cc83604931 100644 --- a/impeller/entity/contents/text_contents.h +++ b/impeller/entity/contents/text_contents.h @@ -56,7 +56,7 @@ class TextContents final : public Contents { private: TextFrame frame_; Color color_; - Scalar inherited_opacity_ = 1.0; + Scalar inherited_opacity_; mutable std::shared_ptr lazy_atlas_; Matrix inverse_matrix_;