Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
/enginePublic archive

Defer setup of the default font manager if the embedding prefetched the font manager#28987

Merged
fluttergithubbot merged 1 commit intoflutter:masterfrom
jason-simmons:bug_91045_b
Oct 4, 2021
Merged

Defer setup of the default font manager if the embedding prefetched the font manager#28987
fluttergithubbot merged 1 commit intoflutter:masterfrom
jason-simmons:bug_91045_b

Conversation

@jason-simmons
Copy link
Member

SkFontMgr_Android can take a long time to initialize. On Android,
the embedding will call FlutterJNI.nativePrefetchDefaultFontManager
early during application startup, which will construct the global
default SkFontMgr on a background thread.

SetupDefaultFontManager will need to wait until the prefetch has
completed in order to obtain the default SkFontMgr. If the embedding
has done a prefetch, then this PR moves SetupDefaultFontManager to a
later phase of engine setup to make waiting less likely.

Seeflutter/flutter#91045

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel inChat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read theTree Hygiene page and make sure this patch meets those guidelines before LGTMing.

engine->SetupDefaultFontManager();
}
});
if (!settings_.prefetched_default_font_manager) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

nit: consider updating the comment above to explain the guard, and where we do a last minute check to make sure it's set up.

Also consider documenting that we do it this way because it's guarded bySkOnce, so we can be confident a second call will be very quick as long as the first call has finished.

Copy link
Contributor

@dnfielddnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Change looks good, needs a test.

Perhaps something like aShellTest that passes in the new setting and verifies that the SkFontMgr has not been set up after creating the shell, but that it is created after running the engine?

It'd be interesting to see whether this helps our existing time to first frame benchmark in the framework too. I'm not sure if it will because the moto g4 has more cores than the internal device I'm testing on.

…he font managerSkFontMgr_Android can take a long time to initialize.  On Android,the embedding will call FlutterJNI.nativePrefetchDefaultFontManagerearly during application startup, which will construct the globaldefault SkFontMgr on a background thread.SetupDefaultFontManager will need to wait until the prefetch hascompleted in order to obtain the default SkFontMgr.  If the embeddinghas done a prefetch, then this PR moves SetupDefaultFontManager to alater phase of engine setup to make waiting less likely.Seeflutter/flutter#91045
@jason-simmons
Copy link
MemberAuthor

Added a test - PTAL

@jason-simmonsjason-simmons added the waiting for tree to go greenThis PR is approved and tested, but waiting for the tree to be green to land. labelOct 4, 2021
@fluttergithubbotfluttergithubbot merged commitb71a2fd intoflutter:masterOct 4, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull requestOct 4, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull requestOct 4, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull requestOct 4, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull requestOct 5, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull requestOct 5, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull requestOct 5, 2021
dnfield pushed a commit to dnfield/engine that referenced this pull requestOct 6, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@dnfielddnfielddnfield approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

cla: yesneeds testsplatform-androidwaiting for tree to go greenThis PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@jason-simmons@dnfield@fluttergithubbot

Comments


[8]ページ先頭

©2009-2026 Movatter.jp