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
eb53ec31
Commit
eb53ec31
authored
Jan 18, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1288 from Hixie/ViewConstraints-rename
Rename ViewConstraints to ViewConfiguration
parents
a566afcb
71457844
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
layout_bench.dart
packages/flutter/benchmark/stocks/layout_bench.dart
+3
-3
binding.dart
packages/flutter/lib/src/rendering/binding.dart
+1
-1
view.dart
packages/flutter/lib/src/rendering/view.dart
+12
-12
rendering_tester.dart
packages/flutter/test/rendering/rendering_tester.dart
+1
-1
No files found.
packages/flutter/benchmark/stocks/layout_bench.dart
View file @
eb53ec31
...
...
@@ -22,15 +22,15 @@ void main() {
tester
.
pump
(
const
Duration
(
seconds:
1
));
// Complete drawer animation
});
ViewCon
straints
big
=
const
ViewConstraints
(
size:
const
Size
(
360.0
,
640.0
));
ViewCon
straints
small
=
const
ViewConstraints
(
size:
const
Size
(
355.0
,
635.0
));
ViewCon
figuration
big
=
const
ViewConfiguration
(
size:
const
Size
(
360.0
,
640.0
));
ViewCon
figuration
small
=
const
ViewConfiguration
(
size:
const
Size
(
355.0
,
635.0
));
RenderView
renderView
=
WidgetFlutterBinding
.
instance
.
renderView
;
Stopwatch
watch
=
new
Stopwatch
()
..
start
();
for
(
int
i
=
0
;
i
<
_kNumberOfIterations
||
_kRunForever
;
++
i
)
{
renderView
.
rootConstraints
=
(
i
%
2
==
0
)
?
big
:
small
;
renderView
.
configuration
=
(
i
%
2
==
0
)
?
big
:
small
;
RenderObject
.
flushLayout
();
}
...
...
packages/flutter/lib/src/rendering/binding.dart
View file @
eb53ec31
...
...
@@ -58,7 +58,7 @@ abstract class Renderer extends Scheduler
void
handleMetricsChanged
()
{
assert
(
renderView
!=
null
);
renderView
.
rootConstraints
=
new
ViewConstraints
(
size:
ui
.
window
.
size
);
renderView
.
configuration
=
new
ViewConfiguration
(
size:
ui
.
window
.
size
);
}
void
_handlePersistentFrameCallback
(
Duration
timeStamp
)
{
...
...
packages/flutter/lib/src/rendering/view.dart
View file @
eb53ec31
...
...
@@ -15,8 +15,8 @@ import 'layer.dart';
import
'object.dart'
;
/// The layout constraints for the root render object.
class
ViewCon
straints
{
const
ViewCon
straints
({
class
ViewCon
figuration
{
const
ViewCon
figuration
({
this
.
size
:
Size
.
zero
,
this
.
orientation
});
...
...
@@ -55,12 +55,12 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
int
_orientation
;
// 0..3
/// The constraints used for the root layout.
ViewCon
straints
get
rootConstraints
=>
_rootConstraints
;
ViewCon
straints
_rootConstraints
;
void
set
rootConstraints
(
ViewConstraints
value
)
{
if
(
rootConstraints
==
value
)
ViewCon
figuration
get
configuration
=>
_configuration
;
ViewCon
figuration
_configuration
;
void
set
configuration
(
ViewConfiguration
value
)
{
if
(
configuration
==
value
)
return
;
_
rootConstraints
=
value
;
_
configuration
=
value
;
markNeedsLayout
();
}
...
...
@@ -85,12 +85,12 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
}
void
performLayout
()
{
if
(
rootConstraints
.
orientation
!=
_orientation
)
{
if
(
configuration
.
orientation
!=
_orientation
)
{
if
(
_orientation
!=
null
&&
child
!=
null
)
child
.
rotate
(
oldAngle:
_orientation
,
newAngle:
rootConstraints
.
orientation
,
time:
timeForRotation
);
_orientation
=
rootConstraints
.
orientation
;
child
.
rotate
(
oldAngle:
_orientation
,
newAngle:
configuration
.
orientation
,
time:
timeForRotation
);
_orientation
=
configuration
.
orientation
;
}
_size
=
rootConstraints
.
size
;
_size
=
configuration
.
size
;
assert
(!
_size
.
isInfinite
);
if
(
child
!=
null
)
...
...
@@ -146,6 +146,6 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
// call to ${super.debugDescribeSettings(prefix)} is omitted because the root superclasses don't include any interesting information for this class
settings
.
add
(
'window size:
${ui.window.size}
(in device pixels)'
);
settings
.
add
(
'device pixel ratio:
${ui.window.devicePixelRatio}
(device pixels per logical pixel)'
);
settings
.
add
(
'
root constraints:
$rootConstraints
(in logical pixels)'
);
settings
.
add
(
'
configuration:
$configuration
(in logical pixels)'
);
}
}
packages/flutter/test/rendering/rendering_tester.dart
View file @
eb53ec31
...
...
@@ -11,7 +11,7 @@ const Size _kTestViewSize = const Size(800.0, 600.0);
class
TestRenderView
extends
RenderView
{
TestRenderView
()
{
rootConstraints
=
new
ViewConstraints
(
size:
_kTestViewSize
);
configuration
=
new
ViewConfiguration
(
size:
_kTestViewSize
);
}
void
scheduleInitialFrame
()
{
scheduleInitialLayout
();
...
...
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