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

Commit 5ed581f

Browse files
authored
fix typo in LayerInfo::has_compatible_op (#40209)
fix typo in LayerInfo::has_compatible_op
1 parent eaaa055 commit 5ed581f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

display_list/display_list_builder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ class DisplayListBuilder final : public virtual DlCanvas,
446446

447447
bool has_layer() const { return has_layer_; }
448448
bool cannot_inherit_opacity() const { return cannot_inherit_opacity_; }
449-
bool has_compatible_op() const { return cannot_inherit_opacity_; }
449+
bool has_compatible_op() const { return has_compatible_op_; }
450450

451451
bool is_group_opacity_compatible() const {
452452
return !cannot_inherit_opacity_;

display_list/display_list_unittests.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,5 +2403,17 @@ TEST(DisplayList, RTreeRenderCulling) {
24032403
}
24042404
}
24052405

2406+
TEST(DisplayListTest, DrawSaveDrawCannotInheritOpacity) {
2407+
DisplayListBuilder builder;
2408+
builder.DrawCircle({10, 10}, 5, DlPaint());
2409+
builder.Save();
2410+
builder.ClipRect({0, 0, 20, 20}, DlCanvas::ClipOp::kIntersect, false);
2411+
builder.DrawRect({5, 5, 15, 15}, DlPaint());
2412+
builder.Restore();
2413+
auto display_list = builder.Build();
2414+
2415+
ASSERT_FALSE(display_list->can_apply_group_opacity());
2416+
}
2417+
24062418
} // namespace testing
24072419
} // namespace flutter

0 commit comments

Comments
 (0)