-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Batch systemFontChange messages #17885
Conversation
There was a problem hiding this 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 _) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 _) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha.
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)
Fixes flutter/flutter#55399