[Impeller] Register the PNG codec for playground tests#189572
Draft
sero583 wants to merge 1 commit into
Draft
Conversation
Playground tests rasterize text with the host's font stack. On Windows,
Skia's DirectWrite backend decodes PNG format color emoji glyphs through
the SkCodecs registry and aborts with a fatal assert when no PNG decoder
is registered:
SkScalerContext_win_dw.cpp: fatal error:
"assertf(SkCodecs::HasDecoder("png")): No PNG decoder registered."
The engine runtime registers the codecs in ImageGeneratorRegistry, but
test binaries must register them for themselves, and impeller_unittests
never did. Five tests crashed this way on Windows hosts:
- Play/AiksTest.CanRenderEmojiTextFrame/Vulkan
- Play/AiksTest.CanRenderEmojiTextFrameWithBlur/Vulkan
- Play/AiksTest.CanRenderEmojiTextFrameWithAlpha/Vulkan
- Play/TypographerTest.LazyAtlasTracksColor/Vulkan
- Play/TypographerTest.GlyphColorIsPartOfCacheKey/Vulkan
Linux CI takes the FreeType scaler path and never triggers the decode,
which is why this only surfaces on Windows hosts.
Register the PNG decoder once in PlaygroundTest::SetUp(), matching the
local registration pattern used by image_decoder_no_gl_unittests.cc.
All five tests pass on a Windows host with this change.
10 tasks
This was referenced Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five playground tests crash with SIGABRT when
impeller_unittestsruns on a Windows host:Play/AiksTest.CanRenderEmojiTextFrame/VulkanPlay/AiksTest.CanRenderEmojiTextFrameWithBlur/VulkanPlay/AiksTest.CanRenderEmojiTextFrameWithAlpha/VulkanPlay/TypographerTest.LazyAtlasTracksColor/VulkanPlay/TypographerTest.GlyphColorIsPartOfCacheKey/VulkanThe crash is a Skia hard assert:
These tests rasterize color emoji with the host's font stack. On Windows that is Skia's DirectWrite backend, which decodes PNG-format color glyphs (for example from Segoe UI Emoji) through the
SkCodecsregistry. The engine runtime registers the codecs inImageGeneratorRegistry, but test binaries must register them for themselves;impeller_unittestsnever does, so the first color glyph aborts the process. Linux CI takes the FreeType scaler path and never triggers the decode, which is why this only surfaces on Windows hosts.The fix registers the PNG decoder once in
PlaygroundTest::SetUp(), matching the local-registration pattern already used bylib/ui/painting/image_decoder_no_gl_unittests.cc. All five tests pass on a Windows host with this change; behavior on other hosts is unchanged (the registration is additive and idempotent for the running binary).Fixes #189565
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.