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
d6f6fc4d
Unverified
Commit
d6f6fc4d
authored
May 05, 2020
by
Jia Hao
Committed by
GitHub
May 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix WidgetsBinding.firstFrameRasterized not completing (#56022)
parent
96233db9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
binding.dart
packages/flutter/lib/src/widgets/binding.dart
+3
-0
binding_first_frame_rasterized_test.dart
...ter/test/widgets/binding_first_frame_rasterized_test.dart
+33
-0
No files found.
packages/flutter/lib/src/widgets/binding.dart
View file @
d6f6fc4d
...
...
@@ -877,6 +877,9 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB
}
_needToReportFirstFrame
=
false
;
if
(
firstFrameCallback
!=
null
&&
!
sendFramesToEngine
)
{
// This frame is deferred and not the first frame sent to the engine that
// should be reported.
_needToReportFirstFrame
=
true
;
SchedulerBinding
.
instance
.
removeTimingsCallback
(
firstFrameCallback
);
}
}
...
...
packages/flutter/test/widgets/binding_first_frame_rasterized_test.dart
0 → 100644
View file @
d6f6fc4d
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:quiver/testing/async.dart'
;
void
main
(
)
{
test
(
'Deferred frames will trigger the first frame callback'
,
()
{
FakeAsync
().
run
((
FakeAsync
fakeAsync
)
{
final
WidgetsBinding
binding
=
WidgetsFlutterBinding
.
ensureInitialized
();
binding
.
deferFirstFrame
();
runApp
(
const
Placeholder
());
fakeAsync
.
flushTimers
();
// Simulates the engine completing a frame render to trigger the
// appropriate callback setting [WidgetBinding.firstFrameRasterized].
binding
.
window
.
onReportTimings
(<
FrameTiming
>[]);
expect
(
binding
.
firstFrameRasterized
,
isFalse
);
binding
.
allowFirstFrame
();
fakeAsync
.
flushTimers
();
// Simulates the engine again.
binding
.
window
.
onReportTimings
(<
FrameTiming
>[]);
expect
(
binding
.
firstFrameRasterized
,
isTrue
);
});
});
}
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