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
69080e07
Unverified
Commit
69080e07
authored
Feb 25, 2020
by
Ferhat
Committed by
GitHub
Feb 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Perf/codesize] Reduce constraint member reads during layout (#51418)
parent
9228b87e
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
41 additions
and
1 deletion
+41
-1
action_sheet.dart
packages/flutter/lib/src/cupertino/action_sheet.dart
+1
-0
dialog.dart
packages/flutter/lib/src/cupertino/dialog.dart
+1
-0
refresh.dart
packages/flutter/lib/src/cupertino/refresh.dart
+1
-0
segmented_control.dart
packages/flutter/lib/src/cupertino/segmented_control.dart
+1
-0
sliding_segmented_control.dart
.../flutter/lib/src/cupertino/sliding_segmented_control.dart
+1
-0
text_selection.dart
packages/flutter/lib/src/cupertino/text_selection.dart
+1
-0
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+1
-0
button.dart
packages/flutter/lib/src/material/button.dart
+1
-0
floating_action_button.dart
...ages/flutter/lib/src/material/floating_action_button.dart
+1
-0
input_decorator.dart
packages/flutter/lib/src/material/input_decorator.dart
+1
-0
list_tile.dart
packages/flutter/lib/src/material/list_tile.dart
+1
-0
animated_size.dart
packages/flutter/lib/src/rendering/animated_size.dart
+1
-1
editable.dart
packages/flutter/lib/src/rendering/editable.dart
+1
-0
flex.dart
packages/flutter/lib/src/rendering/flex.dart
+2
-0
flow.dart
packages/flutter/lib/src/rendering/flow.dart
+1
-0
list_body.dart
packages/flutter/lib/src/rendering/list_body.dart
+1
-0
paragraph.dart
packages/flutter/lib/src/rendering/paragraph.dart
+1
-0
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+2
-0
shifted_box.dart
packages/flutter/lib/src/rendering/shifted_box.dart
+4
-0
sliver.dart
packages/flutter/lib/src/rendering/sliver.dart
+1
-0
sliver_fill.dart
packages/flutter/lib/src/rendering/sliver_fill.dart
+3
-0
sliver_fixed_extent_list.dart
...s/flutter/lib/src/rendering/sliver_fixed_extent_list.dart
+1
-0
sliver_grid.dart
packages/flutter/lib/src/rendering/sliver_grid.dart
+1
-0
sliver_list.dart
packages/flutter/lib/src/rendering/sliver_list.dart
+1
-0
sliver_padding.dart
packages/flutter/lib/src/rendering/sliver_padding.dart
+1
-0
sliver_persistent_header.dart
...s/flutter/lib/src/rendering/sliver_persistent_header.dart
+3
-0
stack.dart
packages/flutter/lib/src/rendering/stack.dart
+1
-0
table.dart
packages/flutter/lib/src/rendering/table.dart
+1
-0
viewport.dart
packages/flutter/lib/src/rendering/viewport.dart
+1
-0
wrap.dart
packages/flutter/lib/src/rendering/wrap.dart
+1
-0
layout_builder.dart
packages/flutter/lib/src/widgets/layout_builder.dart
+1
-0
single_child_scroll_view.dart
...ges/flutter/lib/src/widgets/single_child_scroll_view.dart
+1
-0
No files found.
packages/flutter/lib/src/cupertino/action_sheet.dart
View file @
69080e07
...
...
@@ -668,6 +668,7 @@ class _RenderCupertinoAlert extends RenderBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
final
bool
hasDivider
=
contentSection
.
getMaxIntrinsicHeight
(
constraints
.
maxWidth
)
>
0.0
&&
actionsSection
.
getMaxIntrinsicHeight
(
constraints
.
maxWidth
)
>
0.0
;
final
double
dividerThickness
=
hasDivider
?
_dividerThickness
:
0.0
;
...
...
packages/flutter/lib/src/cupertino/dialog.dart
View file @
69080e07
...
...
@@ -1540,6 +1540,7 @@ class _RenderCupertinoDialogActions extends RenderBox
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
if
(
_isSingleButtonRow
(
dialogWidth
))
{
if
(
childCount
==
1
)
{
// We have 1 button. Our size is the width of the dialog and the height
...
...
packages/flutter/lib/src/cupertino/refresh.dart
View file @
69080e07
...
...
@@ -104,6 +104,7 @@ class _RenderCupertinoSliverRefresh extends RenderSliver
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
// Only pulling to refresh from the top is currently supported.
assert
(
constraints
.
axisDirection
==
AxisDirection
.
down
);
assert
(
constraints
.
growthDirection
==
GrowthDirection
.
forward
);
...
...
packages/flutter/lib/src/cupertino/segmented_control.dart
View file @
69080e07
...
...
@@ -628,6 +628,7 @@ class _RenderSegmentedControl<T> extends RenderBox
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
double
maxHeight
=
_kMinSegmentedControlHeight
;
double
childWidth
=
constraints
.
minWidth
/
childCount
;
...
...
packages/flutter/lib/src/cupertino/sliding_segmented_control.dart
View file @
69080e07
...
...
@@ -828,6 +828,7 @@ class _RenderSegmentedControl<T> extends RenderBox
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
double
childWidth
=
(
constraints
.
minWidth
-
totalSeparatorWidth
)
/
childCount
;
double
maxHeight
=
_kMinSegmentedControlHeight
;
...
...
packages/flutter/lib/src/cupertino/text_selection.dart
View file @
69080e07
...
...
@@ -159,6 +159,7 @@ class _ToolbarRenderBox extends RenderShiftedBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
size
=
constraints
.
biggest
;
if
(
child
==
null
)
{
...
...
packages/flutter/lib/src/material/app_bar.dart
View file @
69080e07
...
...
@@ -1346,6 +1346,7 @@ class _RenderAppBarTitleBox extends RenderAligningShiftedBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
final
BoxConstraints
innerConstraints
=
constraints
.
copyWith
(
maxHeight:
double
.
infinity
);
child
.
layout
(
innerConstraints
,
parentUsesSize:
true
);
size
=
constraints
.
constrain
(
child
.
size
);
...
...
packages/flutter/lib/src/material/button.dart
View file @
69080e07
...
...
@@ -509,6 +509,7 @@ class _RenderInputPadding extends RenderShiftedBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
if
(
child
!=
null
)
{
child
.
layout
(
constraints
,
parentUsesSize:
true
);
final
double
height
=
math
.
max
(
child
.
size
.
width
,
minSize
.
width
);
...
...
packages/flutter/lib/src/material/floating_action_button.dart
View file @
69080e07
...
...
@@ -582,6 +582,7 @@ class _RenderChildOverflowBox extends RenderAligningShiftedBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
if
(
child
!=
null
)
{
child
.
layout
(
const
BoxConstraints
(),
parentUsesSize:
true
);
size
=
Size
(
...
...
packages/flutter/lib/src/material/input_decorator.dart
View file @
69080e07
...
...
@@ -1247,6 +1247,7 @@ class _RenderDecoration extends RenderBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
_labelTransform
=
null
;
final
_RenderDecorationLayout
layout
=
_layout
(
constraints
);
...
...
packages/flutter/lib/src/material/list_tile.dart
View file @
69080e07
...
...
@@ -1328,6 +1328,7 @@ class _RenderListTile extends RenderBox {
// https://material.io/design/components/lists.html#specs
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
final
bool
hasLeading
=
leading
!=
null
;
final
bool
hasSubtitle
=
subtitle
!=
null
;
final
bool
hasTrailing
=
trailing
!=
null
;
...
...
packages/flutter/lib/src/rendering/animated_size.dart
View file @
69080e07
...
...
@@ -170,7 +170,7 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
void
performLayout
()
{
_lastValue
=
_controller
.
value
;
_hasVisualOverflow
=
false
;
final
BoxConstraints
constraints
=
this
.
constraints
;
if
(
child
==
null
||
constraints
.
isTight
)
{
_controller
.
stop
();
size
=
_sizeTween
.
begin
=
_sizeTween
.
end
=
constraints
.
smallest
;
...
...
packages/flutter/lib/src/rendering/editable.dart
View file @
69080e07
...
...
@@ -1743,6 +1743,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
}
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
_layoutText
(
minWidth:
constraints
.
minWidth
,
maxWidth:
constraints
.
maxWidth
);
_caretPrototype
=
_getCaretPrototype
;
_selectionRects
=
null
;
...
...
packages/flutter/lib/src/rendering/flex.dart
View file @
69080e07
...
...
@@ -636,6 +636,8 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
@override
void
performLayout
()
{
assert
(
_debugHasNecessaryDirections
);
final
BoxConstraints
constraints
=
this
.
constraints
;
// Determine used flex factor, size inflexible items, calculate free space.
int
totalFlex
=
0
;
int
totalChildren
=
0
;
...
...
packages/flutter/lib/src/rendering/flow.dart
View file @
69080e07
...
...
@@ -279,6 +279,7 @@ class RenderFlow extends RenderBox
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
size
=
_getSize
(
constraints
);
int
i
=
0
;
_randomAccessChildren
.
clear
();
...
...
packages/flutter/lib/src/rendering/list_body.dart
View file @
69080e07
...
...
@@ -63,6 +63,7 @@ class RenderListBody extends RenderBox
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
assert
(()
{
switch
(
mainAxis
)
{
case
Axis
.
horizontal
:
...
...
packages/flutter/lib/src/rendering/paragraph.dart
View file @
69080e07
...
...
@@ -575,6 +575,7 @@ class RenderParagraph extends RenderBox
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
_layoutChildren
(
constraints
);
_layoutTextWithConstraints
(
constraints
);
_setParentData
();
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
69080e07
...
...
@@ -260,6 +260,7 @@ class RenderConstrainedBox extends RenderProxyBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
if
(
child
!=
null
)
{
child
.
layout
(
_additionalConstraints
.
enforce
(
constraints
),
parentUsesSize:
true
);
size
=
child
.
size
;
...
...
@@ -351,6 +352,7 @@ class RenderLimitedBox extends RenderProxyBox {
@override
void
performLayout
()
{
if
(
child
!=
null
)
{
final
BoxConstraints
constraints
=
this
.
constraints
;
child
.
layout
(
_limitConstraints
(
constraints
),
parentUsesSize:
true
);
size
=
constraints
.
constrain
(
child
.
size
);
}
else
{
...
...
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
69080e07
...
...
@@ -193,6 +193,7 @@ class RenderPadding extends RenderShiftedBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
_resolve
();
assert
(
_resolvedPadding
!=
null
);
if
(
child
==
null
)
{
...
...
@@ -385,6 +386,7 @@ class RenderPositionedBox extends RenderAligningShiftedBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
final
bool
shrinkWrapWidth
=
_widthFactor
!=
null
||
constraints
.
maxWidth
==
double
.
infinity
;
final
bool
shrinkWrapHeight
=
_heightFactor
!=
null
||
constraints
.
maxHeight
==
double
.
infinity
;
...
...
@@ -649,6 +651,7 @@ class RenderUnconstrainedBox extends RenderAligningShiftedBox with DebugOverflow
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
if
(
child
!=
null
)
{
// Let the child lay itself out at it's "natural" size, but if
// constrainedAxis is non-null, keep any constraints on that axis.
...
...
@@ -1183,6 +1186,7 @@ class RenderBaseline extends RenderShiftedBox {
@override
void
performLayout
()
{
if
(
child
!=
null
)
{
final
BoxConstraints
constraints
=
this
.
constraints
;
child
.
layout
(
constraints
.
loosen
(),
parentUsesSize:
true
);
final
double
childBaseline
=
child
.
getDistanceToBaseline
(
baselineType
);
final
double
actualBaseline
=
baseline
;
...
...
packages/flutter/lib/src/rendering/sliver.dart
View file @
69080e07
...
...
@@ -1813,6 +1813,7 @@ class RenderSliverToBoxAdapter extends RenderSliverSingleBoxAdapter {
geometry
=
SliverGeometry
.
zero
;
return
;
}
final
SliverConstraints
constraints
=
this
.
constraints
;
child
.
layout
(
constraints
.
asBoxConstraints
(),
parentUsesSize:
true
);
double
childExtent
;
switch
(
constraints
.
axis
)
{
...
...
packages/flutter/lib/src/rendering/sliver_fill.dart
View file @
69080e07
...
...
@@ -87,6 +87,7 @@ class RenderSliverFillRemainingWithScrollable extends RenderSliverSingleBoxAdapt
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
// TODO(Piinks): This may fill too much space for NestedScrollView, https://github.com/flutter/flutter/issues/46028
final
double
extent
=
constraints
.
remainingPaintExtent
-
math
.
min
(
constraints
.
overlap
,
0.0
);
...
...
@@ -137,6 +138,7 @@ class RenderSliverFillRemaining extends RenderSliverSingleBoxAdapter {
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
// The remaining space in the viewportMainAxisExtent. Can be <= 0 if we have
// scrolled beyond the extent of the screen.
double
extent
=
constraints
.
viewportMainAxisExtent
-
constraints
.
precedingScrollExtent
;
...
...
@@ -209,6 +211,7 @@ class RenderSliverFillRemainingAndOverscroll extends RenderSliverSingleBoxAdapte
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
// The remaining space in the viewportMainAxisExtent. Can be <= 0 if we have
// scrolled beyond the extent of the screen.
double
extent
=
constraints
.
viewportMainAxisExtent
-
constraints
.
precedingScrollExtent
;
...
...
packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart
View file @
69080e07
...
...
@@ -164,6 +164,7 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
childManager
.
didStartLayout
();
childManager
.
setDidUnderflow
(
false
);
...
...
packages/flutter/lib/src/rendering/sliver_grid.dart
View file @
69080e07
...
...
@@ -511,6 +511,7 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
childManager
.
didStartLayout
();
childManager
.
setDidUnderflow
(
false
);
...
...
packages/flutter/lib/src/rendering/sliver_list.dart
View file @
69080e07
...
...
@@ -44,6 +44,7 @@ class RenderSliverList extends RenderSliverMultiBoxAdaptor {
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
childManager
.
didStartLayout
();
childManager
.
setDidUnderflow
(
false
);
...
...
packages/flutter/lib/src/rendering/sliver_padding.dart
View file @
69080e07
...
...
@@ -118,6 +118,7 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
assert
(
resolvedPadding
!=
null
);
final
double
beforePadding
=
this
.
beforePadding
;
final
double
afterPadding
=
this
.
afterPadding
;
...
...
packages/flutter/lib/src/rendering/sliver_persistent_header.dart
View file @
69080e07
...
...
@@ -331,6 +331,7 @@ abstract class RenderSliverScrollingPersistentHeader extends RenderSliverPersist
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
final
double
maxExtent
=
this
.
maxExtent
;
layoutChild
(
constraints
.
scrollOffset
,
maxExtent
);
final
double
paintExtent
=
maxExtent
-
constraints
.
scrollOffset
;
...
...
@@ -369,6 +370,7 @@ abstract class RenderSliverPinnedPersistentHeader extends RenderSliverPersistent
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
final
double
maxExtent
=
this
.
maxExtent
;
final
bool
overlapsContent
=
constraints
.
overlap
>
0.0
;
excludeFromSemanticsScrolling
=
overlapsContent
||
(
constraints
.
scrollOffset
>
maxExtent
-
minExtent
);
...
...
@@ -552,6 +554,7 @@ abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersiste
@override
void
performLayout
()
{
final
SliverConstraints
constraints
=
this
.
constraints
;
final
double
maxExtent
=
this
.
maxExtent
;
if
(
_lastActualScrollOffset
!=
null
&&
// We've laid out at least once to get an initial position, and either
((
constraints
.
scrollOffset
<
_lastActualScrollOffset
)
||
// we are scrolling back, so should reveal, or
...
...
packages/flutter/lib/src/rendering/stack.dart
View file @
69080e07
...
...
@@ -517,6 +517,7 @@ class RenderStack extends RenderBox
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
_resolve
();
assert
(
_resolvedAlignment
!=
null
);
_hasVisualOverflow
=
false
;
...
...
packages/flutter/lib/src/rendering/table.dart
View file @
69080e07
...
...
@@ -992,6 +992,7 @@ class RenderTable extends RenderBox {
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
final
int
rows
=
this
.
rows
;
final
int
columns
=
this
.
columns
;
assert
(
_children
.
length
==
rows
*
columns
);
...
...
packages/flutter/lib/src/rendering/viewport.dart
View file @
69080e07
...
...
@@ -1699,6 +1699,7 @@ class RenderShrinkWrappingViewport extends RenderViewportBase<SliverLogicalConta
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
if
(
firstChild
==
null
)
{
switch
(
axis
)
{
case
Axis
.
vertical
:
...
...
packages/flutter/lib/src/rendering/wrap.dart
View file @
69080e07
...
...
@@ -565,6 +565,7 @@ class RenderWrap extends RenderBox with ContainerRenderObjectMixin<RenderBox, Wr
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
assert
(
_debugHasNecessaryDirections
);
_hasVisualOverflow
=
false
;
RenderBox
child
=
firstChild
;
...
...
packages/flutter/lib/src/widgets/layout_builder.dart
View file @
69080e07
...
...
@@ -238,6 +238,7 @@ class _RenderLayoutBuilder extends RenderBox with RenderObjectWithChildMixin<Ren
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
layoutAndBuildChild
();
if
(
child
!=
null
)
{
child
.
layout
(
constraints
,
parentUsesSize:
true
);
...
...
packages/flutter/lib/src/widgets/single_child_scroll_view.dart
View file @
69080e07
...
...
@@ -505,6 +505,7 @@ class _RenderSingleChildViewport extends RenderBox with RenderObjectWithChildMix
@override
void
performLayout
()
{
final
BoxConstraints
constraints
=
this
.
constraints
;
if
(
child
==
null
)
{
size
=
constraints
.
smallest
;
}
else
{
...
...
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