Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion display_list/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ if (enable_unittests) {
":display_list",
":display_list_fixtures",
"//flutter/display_list/testing:display_list_testing",
"//flutter/impeller/typographer/backends/skia:typographer_skia_backend",
"//flutter/testing",
"//flutter/testing:skia",
]
Expand Down
26 changes: 0 additions & 26 deletions display_list/display_list_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "flutter/testing/display_list_testing.h"
#include "flutter/testing/testing.h"

#include "impeller/typographer/backends/skia/text_frame_skia.h"
#include "third_party/skia/include/core/SkBBHFactory.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
Expand Down Expand Up @@ -4332,30 +4331,5 @@ TEST_F(DisplayListTest, DrawDisplayListForwardsBackdropFlag) {
EXPECT_TRUE(parent_dl->root_has_backdrop_filter());
}

TEST_F(DisplayListTest, TextFrameOpacityPeephole) {
// Single character can have opacity peephole applied.
{
std::string message = "A";
sk_sp<SkTextBlob> blob = CreateTextBlob(message);
auto frame = impeller::MakeTextFrameFromTextBlobSkia(blob);
DisplayListBuilder builder;
builder.DrawTextFrame(frame, 0, 0, {});
auto dl = builder.Build();
EXPECT_TRUE(dl->can_apply_group_opacity());
}

// Multiple characters cannot have opacity peephole applied.
{
std::string message = "ABC";
sk_sp<SkTextBlob> blob = CreateTextBlob(message);

auto frame = impeller::MakeTextFrameFromTextBlobSkia(blob);
DisplayListBuilder builder;
builder.DrawTextFrame(frame, 0, 0, {});
auto dl = builder.Build();
EXPECT_FALSE(dl->can_apply_group_opacity());
}
}

} // namespace testing
} // namespace flutter
6 changes: 1 addition & 5 deletions display_list/dl_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1698,11 +1698,7 @@ void DisplayListBuilder::drawTextFrame(
// they will protect overlapping glyphs from the effects of overdraw
// so we must make the conservative assessment that this DL layer is
// not compatible with group opacity inheritance.
// A single glyph can still have the opacity peephole applied (this is
// likely a glyph used as an Icon)
const bool is_single_glyph = text_frame->GetRunCount() == 1u &&
text_frame->GetRuns()[0].GetGlyphCount() == 1u;
UpdateLayerOpacityCompatibility(is_single_glyph);
UpdateLayerOpacityCompatibility(false);
UpdateLayerResult(result);
}
}
Expand Down
7 changes: 0 additions & 7 deletions display_list/testing/dl_test_snippets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -980,12 +980,5 @@ sk_sp<SkTextBlob> GetTestTextBlob(int index) {
return blob;
}

sk_sp<SkTextBlob> CreateTextBlob(std::string& message) {
sk_sp<SkTextBlob> blob =
SkTextBlob::MakeFromText(message.c_str(), message.size(),
CreateTestFontOfSize(20), SkTextEncoding::kUTF8);
return blob;
}

} // namespace testing
} // namespace flutter
2 changes: 0 additions & 2 deletions display_list/testing/dl_test_snippets.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ SkFont CreateTestFontOfSize(SkScalar scalar);

sk_sp<SkTextBlob> GetTestTextBlob(int index);

sk_sp<SkTextBlob> CreateTextBlob(std::string& message);

struct DisplayListInvocation {
// ----------------------------------
// Required fields for initialization
Expand Down