-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Fixed TypographerTest.MaybeHasOverlapping #42429
Conversation
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM
Why do we get away with this on iOS? relying on some internal state somewhere?
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM
Why do we get away with this on iOS? relying on some internal state somewhere?
@jonahwilliams Well, at first I thought it was because the default font was different per operating system. But I just looked and this still passes on macos with arial 12, where on linux I needed arial 0.5 to get them to overlap. Here are the first 2 glyph rects: I don't know why they overlap. I could guess the ttf files are different or there is some ifdef code or skia is using different libraries for typesetting? If you have an optimization that requires that the glyphs aren't overlapping, I don't think it's getting hit as much as you had hoped. |
|
Yeah I think its making some assumptions based on what the font will do. Perhaps instead we should hardcode the font? Its entirely reasonable that they would overlap, and this test might just be poorly written to assume they wont |
|
but at any rate, this fix is still fine if using a different font stabilizes it |
|
@jonahwilliams I tried switching the test to use a specific font: TEST_P(TypographerTest, MaybeHasOverlapping) {
static constexpr const char* kTestFontFixture = "Roboto-Regular.ttf";
auto mapping = OpenFixtureAsSkData(kTestFontFixture);
FML_CHECK(mapping);
SkFont sk_font(SkTypeface::MakeFromData(mapping), 12.0);
auto frame = TextFrameFromTextBlob(SkTextBlob::MakeFromString("1", sk_font));
// Single character has no overlapping
ASSERT_FALSE(frame.MaybeHasOverlapping());
auto frame_2 =
TextFrameFromTextBlob(SkTextBlob::MakeFromString("123456789", sk_font));
// Characters probably have overlap due to low fidelity text metrics, but this
// could be fixed.
ASSERT_TRUE(frame_2.MaybeHasOverlapping());
}This still passes on macos but fails on linux. |
|
auto label is removed for flutter/engine, pr: 42429, due to - The status or check suite Linux linux_clang_tidy has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…127898) flutter/engine@1ba8091...dff1847 2023-05-30 [email protected] [Impeller] Fixed TypographerTest.MaybeHasOverlapping (flutter/engine#42429) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
fixes flutter/flutter#127714
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.