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
01ca34cd
Commit
01ca34cd
authored
Nov 07, 2016
by
Andrew Wilson
Committed by
GitHub
Nov 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add profiling for building and painting. (#6652)
parent
57be9598
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
0 deletions
+37
-0
debug.dart
packages/flutter/lib/src/rendering/debug.dart
+7
-0
object.dart
packages/flutter/lib/src/rendering/object.dart
+12
-0
debug.dart
packages/flutter/lib/src/widgets/debug.dart
+6
-0
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+12
-0
No files found.
packages/flutter/lib/src/rendering/debug.dart
View file @
01ca34cd
...
...
@@ -76,6 +76,13 @@ bool debugPrintMarkNeedsLayoutStacks = false;
/// Check the intrinsic sizes of each [RenderBox] during layout.
bool
debugCheckIntrinsicSizes
=
false
;
/// Adds [Timeline] events for every RenderObject painted.
///
/// For details on how to use [Timeline] events in the Dart Observatory to
/// optimize your app, see https://fuchsia.googlesource.com/sysui/+/master/docs/performance.md
bool
debugProfilePaintsEnabled
=
false
;
/// Returns a list of strings representing the given transform in a format useful for [RenderObject.debugFillDescription].
List
<
String
>
debugDescribeTransform
(
Matrix4
transform
)
{
List
<
String
>
matrix
=
transform
.
toString
().
split
(
'
\n
'
).
map
((
String
s
)
=>
'
$s
'
).
toList
();
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
01ca34cd
...
...
@@ -95,12 +95,24 @@ class PaintingContext {
/// into the layer subtree associated with this painting context. Otherwise,
/// the child will be painted into the current PictureLayer for this context.
void
paintChild
(
RenderObject
child
,
Offset
offset
)
{
assert
(()
{
if
(
debugProfilePaintsEnabled
)
Timeline
.
startSync
(
'
${child.runtimeType}
'
);
return
true
;
});
if
(
child
.
isRepaintBoundary
)
{
_stopRecordingIfNeeded
();
_compositeChild
(
child
,
offset
);
}
else
{
child
.
_paintWithContext
(
this
,
offset
);
}
assert
(()
{
if
(
debugProfilePaintsEnabled
)
Timeline
.
finishSync
();
return
true
;
});
}
void
_compositeChild
(
RenderObject
child
,
Offset
offset
)
{
...
...
packages/flutter/lib/src/widgets/debug.dart
View file @
01ca34cd
...
...
@@ -48,6 +48,12 @@ bool debugPrintScheduleBuildForStacks = false;
/// This can help track down framework bugs relating to the [GlobalKey] logic.
bool
debugPrintGlobalKeyedWidgetLifecycle
=
false
;
/// Adds [Timeline] events for every Widget built.
///
/// For details on how to use [Timeline] events in the Dart Observatory to
/// optimize your app, see https://fuchsia.googlesource.com/sysui/+/master/docs/performance.md
bool
debugProfileBuildsEnabled
=
false
;
Key
_firstNonUniqueKey
(
Iterable
<
Widget
>
widgets
)
{
Set
<
Key
>
keySet
=
new
HashSet
<
Key
>();
for
(
Widget
widget
in
widgets
)
{
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
01ca34cd
...
...
@@ -2846,6 +2846,12 @@ abstract class ComponentElement extends BuildableElement {
/// [rebuild] when the element needs updating.
@override
void
performRebuild
()
{
assert
(()
{
if
(
debugProfileBuildsEnabled
)
Timeline
.
startSync
(
'
${widget.runtimeType}
'
);
return
true
;
});
assert
(
_debugSetAllowIgnoredCallsToMarkNeedsBuild
(
true
));
Widget
built
;
try
{
...
...
@@ -2868,6 +2874,12 @@ abstract class ComponentElement extends BuildableElement {
built
=
new
ErrorWidget
(
e
);
_child
=
updateChild
(
null
,
built
,
slot
);
}
assert
(()
{
if
(
debugProfileBuildsEnabled
)
Timeline
.
finishSync
();
return
true
;
});
}
@override
...
...
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