Skip to content

No default SkFontMgr on Fuchsia causes unexpected engine test behavior #82202

@lhkbob

Description

@lhkbob

When tests or engine code (e.g. PerformanceOverlayLayer::MakeStatisticsText in flow/layers/performance_overlay_layer.cc) use a default constructed SkFont or otherwise rely on the default installed SkFontMgr, Skia will fallback to an empty typeface when there is no valid default font manager.

Fuchsia does not configure a font manager in this way, so unit tests run on Fuchsia will encounter this issue. Drawn text blobs with an empty typeface can have empty bounds, which may lead to SkCanvas quick-rejecting them. This complicates or leads to incorrect test expectations when run on that platform vs. those that have a default installed font manager.

For now it seems reasonable to skip these tests on Fuchsia, but a longer term solution would be to update the engine to not rely on default SkFont in this way, or otherwise plumb SkFontMgr_New_Fuchsia to all necessary places. Another option would be to update MockCanvas to not utilize the quick-reject API and just record draw calls and update test expectations to reflect what's expected for Flutter to invoke on SkCanvas, and not what's expected of SkCanvas itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listdependency: fuchsiaFuchsia team may need to help usengineflutter/engine related. See also e: labels.platform-fuchsiaFuchsia code specificallyteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions