Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
9dbd1e98
Unverified
Commit
9dbd1e98
authored
Aug 08, 2023
by
Ian Hickson
Committed by
GitHub
Aug 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More documentation about warm-up frames (#132085)
parent
23041cb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
binding.dart
packages/flutter/lib/src/scheduler/binding.dart
+24
-0
No files found.
packages/flutter/lib/src/scheduler/binding.dart
View file @
9dbd1e98
...
@@ -933,6 +933,30 @@ mixin SchedulerBinding on BindingBase {
...
@@ -933,6 +933,30 @@ mixin SchedulerBinding on BindingBase {
/// [scheduleWarmUpFrame] was already called, this call will be ignored.
/// [scheduleWarmUpFrame] was already called, this call will be ignored.
///
///
/// Prefer [scheduleFrame] to update the display in normal operation.
/// Prefer [scheduleFrame] to update the display in normal operation.
///
/// ## Design discussion
///
/// The Flutter engine prompts the framework to generate frames when it
/// receives a request from the operating system (known for historical reasons
/// as a vsync). However, this may not happen for several milliseconds after
/// the app starts (or after a hot reload). To make use of the time between
/// when the widget tree is first configured and when the engine requests an
/// update, the framework schedules a _warm-up frame_.
///
/// A warm-up frame may never actually render (as the engine did not request
/// it and therefore does not have a valid context in which to paint), but it
/// will cause the framework to go through the steps of building, laying out,
/// and painting, which can together take several milliseconds. Thus, when the
/// engine requests a real frame, much of the work will already have been
/// completed, and the framework can generate the frame with minimal
/// additional effort.
///
/// Warm-up frames are scheduled by [runApp] on startup, and by
/// [RendererBinding.performReassemble] during a hot reload.
///
/// Warm-up frames are also scheduled when the framework is unblocked by a
/// call to [RendererBinding.allowFirstFrame] (corresponding to a call to
/// [RendererBinding.deferFirstFrame] that blocked the rendering).
void
scheduleWarmUpFrame
()
{
void
scheduleWarmUpFrame
()
{
if
(
_warmUpFrame
||
schedulerPhase
!=
SchedulerPhase
.
idle
)
{
if
(
_warmUpFrame
||
schedulerPhase
!=
SchedulerPhase
.
idle
)
{
return
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment