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

Commit 47c4122

Browse files
authored
Remove opacity layer dcheck. (#46160)
In flutter/flutter#132849 it was found that rendering happens fine when this dcheck is removed. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent d85c839 commit 47c4122

2 files changed

Lines changed: 0 additions & 10 deletions

File tree

flow/layers/opacity_layer.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ void OpacityLayer::Diff(DiffContext* context, const Layer* old_layer) {
3636
}
3737

3838
void OpacityLayer::Preroll(PrerollContext* context) {
39-
FML_DCHECK(!layers().empty()); // We can't be a leaf.
40-
4139
auto mutator = context->state_stack.save();
4240
mutator.translate(offset_);
4341
mutator.applyOpacity(SkRect(), DlColor::toOpacity(alpha_));

flow/layers/opacity_layer_unittests.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ namespace testing {
2727
using OpacityLayerTest = LayerTest;
2828

2929
#ifndef NDEBUG
30-
TEST_F(OpacityLayerTest, LeafLayer) {
31-
auto layer =
32-
std::make_shared<OpacityLayer>(SK_AlphaOPAQUE, SkPoint::Make(0.0f, 0.0f));
33-
34-
EXPECT_DEATH_IF_SUPPORTED(layer->Preroll(preroll_context()),
35-
"\\!layers\\(\\)\\.empty\\(\\)");
36-
}
37-
3830
TEST_F(OpacityLayerTest, PaintingEmptyLayerDies) {
3931
auto mock_layer = std::make_shared<MockLayer>(SkPath());
4032
auto layer =

0 commit comments

Comments
 (0)