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
9157c164
Commit
9157c164
authored
Mar 29, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The intrinsic size checks were very slow
Now we run them once per render object. Fixes #2487
parent
992fc76e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
37 deletions
+46
-37
box.dart
packages/flutter/lib/src/rendering/box.dart
+43
-37
debug.dart
packages/flutter/lib/src/rendering/debug.dart
+3
-0
No files found.
packages/flutter/lib/src/rendering/box.dart
View file @
9157c164
...
...
@@ -653,6 +653,9 @@ abstract class RenderBox extends RenderObject {
@override
BoxConstraints
get
constraints
=>
super
.
constraints
;
// We check the intrinsic sizes of each render box once by default.
bool
_debugNeedsIntrinsicSizeCheck
=
true
;
@override
void
debugAssertDoesMeetConstraints
()
{
assert
(
constraints
!=
null
);
...
...
@@ -716,6 +719,7 @@ abstract class RenderBox extends RenderObject {
'your fault. Contact support: https://github.com/flutter/flutter/issues/new'
);
}
if
(
_debugNeedsIntrinsicSizeCheck
||
debugCheckIntrinsicSizes
)
{
// verify that the intrinsics are also within the constraints
assert
(!
RenderObject
.
debugCheckingIntrinsics
);
RenderObject
.
debugCheckingIntrinsics
=
true
;
...
...
@@ -743,6 +747,7 @@ abstract class RenderBox extends RenderObject {
failureCount
+=
1
;
}
RenderObject
.
debugCheckingIntrinsics
=
false
;
_debugNeedsIntrinsicSizeCheck
=
false
;
if
(
failures
.
isNotEmpty
)
{
assert
(
failureCount
>
0
);
throw
new
FlutterError
(
...
...
@@ -754,6 +759,7 @@ abstract class RenderBox extends RenderObject {
'your fault. Contact support: https://github.com/flutter/flutter/issues/new'
);
}
}
return
true
;
});
}
...
...
packages/flutter/lib/src/rendering/debug.dart
View file @
9157c164
...
...
@@ -68,6 +68,9 @@ bool debugPrintMarkNeedsPaintStacks = false;
/// Log the call stacks that mark render objects as needing layout.
bool
debugPrintMarkNeedsLayoutStacks
=
false
;
/// Check the intrinsic sizes of each [RenderBox] during layout.
bool
debugCheckIntrinsicSizes
=
false
;
List
<
String
>
debugDescribeTransform
(
Matrix4
transform
)
{
List
<
String
>
matrix
=
transform
.
toString
().
split
(
'
\n
'
).
map
((
String
s
)
=>
'
$s
'
).
toList
();
matrix
.
removeLast
();
...
...
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