diff --git a/engine/src/flutter/flow/layers/child_scene_layer.cc b/engine/src/flutter/flow/layers/child_scene_layer.cc index 2a51590ff78..9ba5eff3c50 100644 --- a/engine/src/flutter/flow/layers/child_scene_layer.cc +++ b/engine/src/flutter/flow/layers/child_scene_layer.cc @@ -20,26 +20,10 @@ void ChildSceneLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { context->child_scene_layer_exists_below = true; CheckForChildLayerBelow(context); - - // An alpha "hole punch" is required if the frame behind us is not opaque. - if (!context->is_opaque) { - set_paint_bounds( - SkRect::MakeXYWH(offset_.fX, offset_.fY, size_.fWidth, size_.fHeight)); - } } void ChildSceneLayer::Paint(PaintContext& context) const { - TRACE_EVENT0("flutter", "ChildSceneLayer::Paint"); - FML_DCHECK(needs_painting()); - FML_DCHECK(needs_system_composite()); - - // If we are being rendered into our own frame using the system compositor, - // then it is neccesary to "punch a hole" in the canvas/frame behind us so - // that group opacity looks correct. - SkPaint paint; - paint.setColor(SK_ColorTRANSPARENT); - paint.setBlendMode(SkBlendMode::kSrc); - context.leaf_nodes_canvas->drawRect(paint_bounds(), paint); + FML_NOTREACHED(); } void ChildSceneLayer::UpdateScene(SceneUpdateContext& context) { diff --git a/engine/src/flutter/flow/layers/layer.h b/engine/src/flutter/flow/layers/layer.h index 123e8db3c1b..eeffabacbb3 100644 --- a/engine/src/flutter/flow/layers/layer.h +++ b/engine/src/flutter/flow/layers/layer.h @@ -59,7 +59,6 @@ struct PrerollContext { // These allow us to track properties like elevation, opacity, and the // prescence of a platform view during Preroll. bool has_platform_view = false; - bool is_opaque = true; #if defined(LEGACY_FUCHSIA_EMBEDDER) // True if, during the traversal so far, we have seen a child_scene_layer. // Informs whether a layer needs to be system composited. diff --git a/engine/src/flutter/flow/layers/opacity_layer.cc b/engine/src/flutter/flow/layers/opacity_layer.cc index b488c1c9468..131b1d9f253 100644 --- a/engine/src/flutter/flow/layers/opacity_layer.cc +++ b/engine/src/flutter/flow/layers/opacity_layer.cc @@ -14,11 +14,8 @@ OpacityLayer::OpacityLayer(SkAlpha alpha, const SkPoint& offset) void OpacityLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { TRACE_EVENT0("flutter", "OpacityLayer::Preroll"); + FML_DCHECK(!GetChildContainer()->layers().empty()); // We can't be a leaf. - ContainerLayer* container = GetChildContainer(); - FML_DCHECK(!container->layers().empty()); // OpacityLayer can't be a leaf. - - const bool parent_is_opaque = context->is_opaque; SkMatrix child_matrix = matrix; child_matrix.postTranslate(offset_.fX, offset_.fY); @@ -26,7 +23,6 @@ void OpacityLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { // reverse transformation to the cull rect to properly cull child layers. context->cull_rect = context->cull_rect.makeOffset(-offset_.fX, -offset_.fY); - context->is_opaque = parent_is_opaque && (alpha_ == SK_AlphaOPAQUE); context->mutators_stack.PushTransform( SkMatrix::Translate(offset_.fX, offset_.fY)); context->mutators_stack.PushOpacity(alpha_); @@ -35,7 +31,6 @@ void OpacityLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { ContainerLayer::Preroll(context, child_matrix); context->mutators_stack.Pop(); context->mutators_stack.Pop(); - context->is_opaque = parent_is_opaque; { set_paint_bounds(paint_bounds().makeOffset(offset_.fX, offset_.fY)); diff --git a/engine/src/flutter/flow/layers/opacity_layer_unittests.cc b/engine/src/flutter/flow/layers/opacity_layer_unittests.cc index 183dcee52d2..1ca9ddb2c40 100644 --- a/engine/src/flutter/flow/layers/opacity_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/opacity_layer_unittests.cc @@ -20,8 +20,9 @@ TEST_F(OpacityLayerTest, LeafLayer) { auto layer = std::make_shared(SK_AlphaOPAQUE, SkPoint::Make(0.0f, 0.0f)); - EXPECT_DEATH_IF_SUPPORTED(layer->Preroll(preroll_context(), SkMatrix()), - "\\!container->layers\\(\\)\\.empty\\(\\)"); + EXPECT_DEATH_IF_SUPPORTED( + layer->Preroll(preroll_context(), SkMatrix()), + "\\!GetChildContainer\\(\\)->layers\\(\\)\\.empty\\(\\)"); } TEST_F(OpacityLayerTest, PaintingEmptyLayerDies) {