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
7c0dfd53
Unverified
Commit
7c0dfd53
authored
Sep 05, 2019
by
liyuqian
Committed by
GitHub
Sep 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Replace deprecated onReportTimings w/ frameTimings (#38861)" (#39778)
This reverts commit
6ef80b44
.
parent
dd769425
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
19 deletions
+41
-19
binding.dart
packages/flutter/lib/src/scheduler/binding.dart
+8
-4
binding.dart
packages/flutter/lib/src/widgets/binding.dart
+15
-3
service_extensions_test.dart
...ages/flutter/test/foundation/service_extensions_test.dart
+6
-5
scheduler_test.dart
packages/flutter/test/scheduler/scheduler_test.dart
+3
-6
window.dart
packages/flutter_test/lib/src/window.dart
+9
-1
No files found.
packages/flutter/lib/src/scheduler/binding.dart
View file @
7c0dfd53
...
...
@@ -202,10 +202,14 @@ mixin SchedulerBinding on BindingBase, ServicesBinding {
if
(!
kReleaseMode
)
{
int
frameNumber
=
0
;
window
.
frameTimings
.
listen
((
FrameTiming
frameTiming
)
{
frameNumber
+=
1
;
_profileFramePostEvent
(
frameNumber
,
frameTiming
);
});
// use frameTimings. https://github.com/flutter/flutter/issues/38838
// ignore: deprecated_member_use
window
.
onReportTimings
=
(
List
<
FrameTiming
>
timings
)
{
for
(
FrameTiming
frameTiming
in
timings
)
{
frameNumber
+=
1
;
_profileFramePostEvent
(
frameNumber
,
frameTiming
);
}
};
}
}
...
...
packages/flutter/lib/src/widgets/binding.dart
View file @
7c0dfd53
...
...
@@ -4,7 +4,7 @@
import
'dart:async'
;
import
'dart:developer'
as
developer
;
import
'dart:ui'
show
AppLifecycleState
,
Locale
,
AccessibilityFeatures
,
FrameTiming
;
import
'dart:ui'
show
AppLifecycleState
,
Locale
,
AccessibilityFeatures
,
FrameTiming
,
TimingsCallback
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/gestures.dart'
;
...
...
@@ -747,13 +747,25 @@ mixin WidgetsBinding on BindingBase, SchedulerBinding, GestureBinding, RendererB
if
(
_needToReportFirstFrame
&&
_reportFirstFrame
)
{
assert
(!
_firstFrameCompleter
.
isCompleted
);
WidgetsBinding
.
instance
.
window
.
frameTimings
.
first
.
then
((
FrameTiming
_
)
{
// TODO(liyuqian): use a broadcast stream approach
// use frameTimings. https://github.com/flutter/flutter/issues/38838
// ignore: deprecated_member_use
final
TimingsCallback
oldCallback
=
WidgetsBinding
.
instance
.
window
.
onReportTimings
;
// use frameTimings. https://github.com/flutter/flutter/issues/38838
// ignore: deprecated_member_use
WidgetsBinding
.
instance
.
window
.
onReportTimings
=
(
List
<
FrameTiming
>
timings
)
{
if
(!
kReleaseMode
)
{
developer
.
Timeline
.
instantSync
(
'Rasterized first useful frame'
);
developer
.
postEvent
(
'Flutter.FirstFrame'
,
<
String
,
dynamic
>{});
}
if
(
oldCallback
!=
null
)
{
oldCallback
(
timings
);
}
// use frameTimings. https://github.com/flutter/flutter/issues/38838
// ignore: deprecated_member_use
WidgetsBinding
.
instance
.
window
.
onReportTimings
=
oldCallback
;
_firstFrameCompleter
.
complete
();
}
)
;
};
}
try
{
...
...
packages/flutter/test/foundation/service_extensions_test.dart
View file @
7c0dfd53
...
...
@@ -79,11 +79,12 @@ class TestServiceExtensionsBinding extends BindingBase
await
flushMicrotasks
();
if
(
ui
.
window
.
onDrawFrame
!=
null
)
ui
.
window
.
onDrawFrame
();
final
Future
<
ui
.
FrameTiming
>
firstFrameEventFired
=
window
.
frameTimings
.
first
;
ui
.
window
.
debugReportTimings
(<
ui
.
FrameTiming
>[
ui
.
FrameTiming
(
List
<
int
>.
filled
(
ui
.
FramePhase
.
values
.
length
,
0
)),
]);
await
firstFrameEventFired
;
// use frameTimings. https://github.com/flutter/flutter/issues/38838
// ignore: deprecated_member_use
if
(
ui
.
window
.
onReportTimings
!=
null
)
// use frameTimings. https://github.com/flutter/flutter/issues/38838
// ignore: deprecated_member_use
ui
.
window
.
onReportTimings
(<
ui
.
FrameTiming
>[]);
}
@override
...
...
packages/flutter/test/scheduler/scheduler_test.dart
View file @
7c0dfd53
...
...
@@ -132,18 +132,15 @@ void main() {
});
test
(
'Flutter.Frame event fired'
,
()
async
{
// We can't use Future in scheduler_test so we'll use dynamic instead.
final
dynamic
firstFrameEventFired
=
window
.
frameTimings
.
first
;
window
.
debugReportTimings
(<
FrameTiming
>[
FrameTiming
(<
int
>[
// use frameTimings. https://github.com/flutter/flutter/issues/38838
// ignore: deprecated_member_use
window
.
onReportTimings
(<
FrameTiming
>[
FrameTiming
(<
int
>[
// build start, build finish
10000
,
15000
,
// raster start, raster finish
16000
,
20000
,
])]);
await
firstFrameEventFired
;
final
List
<
Map
<
String
,
dynamic
>>
events
=
scheduler
.
getEventsDispatched
(
'Flutter.Frame'
);
expect
(
events
,
hasLength
(
1
));
...
...
packages/flutter_test/lib/src/window.dart
View file @
7c0dfd53
...
...
@@ -286,7 +286,15 @@ class TestWindow implements Window {
}
@override
Stream
<
FrameTiming
>
get
frameTimings
=>
_window
.
frameTimings
;
// use frameTimings. https://github.com/flutter/flutter/issues/38838
// ignore: deprecated_member_use
TimingsCallback
get
onReportTimings
=>
_window
.
onReportTimings
;
@override
set
onReportTimings
(
TimingsCallback
callback
)
{
// use frameTimings. https://github.com/flutter/flutter/issues/38838
// ignore: deprecated_member_use
_window
.
onReportTimings
=
callback
;
}
@override
PointerDataPacketCallback
get
onPointerDataPacket
=>
_window
.
onPointerDataPacket
;
...
...
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