diff --git a/impeller/typographer/typographer_unittests.cc b/impeller/typographer/typographer_unittests.cc index ad18242615a55..24564dac3f276 100644 --- a/impeller/typographer/typographer_unittests.cc +++ b/impeller/typographer/typographer_unittests.cc @@ -165,18 +165,20 @@ TEST_P(TypographerTest, GlyphAtlasWithLotsOfdUniqueGlyphSize) { ASSERT_TRUE(context && context->IsValid()); SkFont sk_font; - auto blob = SkTextBlob::MakeFromString( + const char* test_string = "QWERTYUIOPASDFGHJKLZXCVBNMqewrtyuiopasdfghjklzxcvbnm,.<>[]{};':" "2134567890-=!@#$%^&*()_+" "œ∑´®†¥¨ˆøπ““‘‘åß∂ƒ©˙∆˚¬…æ≈ç√∫˜µ≤≥≥≥≥÷¡™£¢∞§¶•ªº–≠⁄€‹›fifl‡°·‚—±Œ„´‰Á¨Ø∏”’/" - "* Í˝ */¸˛Ç◊ı˜Â¯˘¿", - sk_font); + "* Í˝ */¸˛Ç◊ı˜Â¯˘¿"; + + auto blob = SkTextBlob::MakeFromString(test_string, sk_font); ASSERT_TRUE(blob); TextFrame frame; size_t count = 0; + const int size_count = 8; TextRenderContext::FrameIterator iterator = [&]() -> const TextFrame* { - if (count < 8) { + if (count < size_count) { count++; frame = TextFrameFromTextBlob(blob, 0.6 * count); return &frame; @@ -188,8 +190,20 @@ TEST_P(TypographerTest, GlyphAtlasWithLotsOfdUniqueGlyphSize) { ASSERT_NE(atlas, nullptr); ASSERT_NE(atlas->GetTexture(), nullptr); - ASSERT_EQ(atlas->GetTexture()->GetSize().width * 2, - atlas->GetTexture()->GetSize().height); + std::set unique_glyphs; + std::vector total_glyphs; + atlas->IterateGlyphs([&](const FontGlyphPair& pair, const Rect& rect) { + unique_glyphs.insert(pair.glyph.index); + total_glyphs.push_back(pair.glyph.index); + return true; + }); + + EXPECT_EQ(unique_glyphs.size() * size_count, atlas->GetGlyphCount()); + EXPECT_EQ(total_glyphs.size(), atlas->GetGlyphCount()); + + EXPECT_TRUE(atlas->GetGlyphCount() > 0); + EXPECT_TRUE(atlas->GetTexture()->GetSize().width > 0); + EXPECT_TRUE(atlas->GetTexture()->GetSize().height > 0); } TEST_P(TypographerTest, GlyphAtlasTextureIsRecycledIfUnchanged) { diff --git a/testing/run_tests.py b/testing/run_tests.py index 30a93a0ef20c2..739f7ae62a9fa 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -1201,12 +1201,10 @@ def main(): 'impeller_unittests', engine_filter, # TODO(https://github.com/flutter/flutter/issues/127714): Remove test exemption. - # TODO(https://github.com/flutter/flutter/issues/127715): Remove test exemption. shuffle_flags + [ '--gtest_filter=-' '*/OpenGLES:' 'Play/TypographerTest.MaybeHasOverlapping/Vulkan:' - 'Play/TypographerTest.GlyphAtlasWithLotsOfdUniqueGlyphSize/Vulkan', ], coverage=args.coverage )