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
34d84209
Unverified
Commit
34d84209
authored
Apr 26, 2022
by
Dan Field
Committed by
GitHub
Apr 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid scheduling a forced frame when there is no child to the renderView (#102556)
parent
bc7d3bbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
binding.dart
packages/flutter/lib/src/rendering/binding.dart
+4
-1
binding_test.dart
packages/flutter/test/rendering/binding_test.dart
+22
-0
No files found.
packages/flutter/lib/src/rendering/binding.dart
View file @
34d84209
...
@@ -235,10 +235,13 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
...
@@ -235,10 +235,13 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
///
///
/// See [dart:ui.PlatformDispatcher.onMetricsChanged].
/// See [dart:ui.PlatformDispatcher.onMetricsChanged].
@protected
@protected
@visibleForTesting
void
handleMetricsChanged
()
{
void
handleMetricsChanged
()
{
assert
(
renderView
!=
null
);
assert
(
renderView
!=
null
);
renderView
.
configuration
=
createViewConfiguration
();
renderView
.
configuration
=
createViewConfiguration
();
scheduleForcedFrame
();
if
(
renderView
.
child
!=
null
)
{
scheduleForcedFrame
();
}
}
}
/// Called when the platform text scale factor changes.
/// Called when the platform text scale factor changes.
...
...
packages/flutter/test/rendering/binding_test.dart
0 → 100644
View file @
34d84209
// 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
'package:flutter/rendering.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
WidgetsFlutterBinding
.
ensureInitialized
();
test
(
'handleMetricsChanged does not scheduleForcedFrame unless there is a child to the renderView'
,
()
async
{
expect
(
SchedulerBinding
.
instance
.
hasScheduledFrame
,
false
);
RendererBinding
.
instance
.
handleMetricsChanged
();
expect
(
SchedulerBinding
.
instance
.
hasScheduledFrame
,
false
);
RendererBinding
.
instance
.
renderView
.
child
=
RenderLimitedBox
();
RendererBinding
.
instance
.
handleMetricsChanged
();
expect
(
SchedulerBinding
.
instance
.
hasScheduledFrame
,
true
);
});
}
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