Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

ferhatb
Copy link
Contributor

@ferhatb ferhatb commented Apr 22, 2020

@ferhatb ferhatb requested a review from yjbanov April 22, 2020 21:30
Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

This change needs a test.

if (!_fontChangeScheduled) {
_fontChangeScheduled = true;
// Batch updates into next animationframe.
html.window.requestAnimationFrame((num _) {
Copy link
Contributor

@yjbanov yjbanov Apr 22, 2020

Choose a reason for hiding this comment

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

This will debounce the notification at 16ms granularity, which seems too low for something that's loading over the network. Maybe use a Timer that debounces on the order of 100s of ms? We also have the AlarmClock with "snooze" feature for this sort of thing.

Copy link
Contributor Author

@ferhatb ferhatb Apr 23, 2020

Choose a reason for hiding this comment

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

Gallery loads 6 fonts, they are coming in within 1ms of each other. 1 font sometimes misses 16ms window and markrelayout is called second time. 100ms would delay app first build for many frames, there is no easy signal to cancel the wait and complete future.

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha.

if (!_fontChangeScheduled) {
_fontChangeScheduled = true;
// Batch updates into next animationframe.
html.window.requestAnimationFrame((num _) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha.

@ferhatb ferhatb merged commit cade0e9 into flutter:master Apr 24, 2020
gaaclarke added a commit to flutter/flutter that referenced this pull request Apr 27, 2020
flutter/engine@2b94311...4f888d6

git log 2b94311..4f888d6 --first-parent --oneline
2020-04-25 nurhan@google.com Change the repo fetch script used in integration tests (flutter/engine#17943)
2020-04-24 skia-flutter-autoroll@skia.org Roll src/third_party/skia 1e21d14f2b8b..c12aad9485a9 (20 commits) (flutter/engine#17942)
2020-04-24 skia-flutter-autoroll@skia.org Roll src/third_party/dart a69cb6d700f5..216e3df4526c (16 commits) (flutter/engine#17945)
2020-04-24 xster@google.com Fix accessibility focus loss when first focusing on text field (flutter/engine#17803)
2020-04-24 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from _dAFU... to G4HpJ... (flutter/engine#17938)
2020-04-24 mouad.debbar@gmail.com [web] Fix exception when getting boxes for rich text range (flutter/engine#17933)
2020-04-24 ferhat@gmail.com [web] Batch systemFontChange messages (flutter/engine#17885)
2020-04-24 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from kpECk... to _dAFU... (flutter/engine#17929)
2020-04-24 skia-flutter-autoroll@skia.org Roll src/third_party/skia b965ff597315..1e21d14f2b8b (25 commits) (flutter/engine#17928)
2020-04-24 skia-flutter-autoroll@skia.org Roll src/third_party/dart 94178e920ee8..a69cb6d700f5 (22 commits) (flutter/engine#17926)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] Loading multiple fonts causes multiple systemFonts change notifications during app startup

3 participants