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
f45cdd57
Unverified
Commit
f45cdd57
authored
Aug 17, 2020
by
chenjianguang
Committed by
GitHub
Aug 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add debug flag `debugProfileLayoutsEnabled`. (#63652)
parent
c89402c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
7 deletions
+35
-7
debug.dart
packages/flutter/lib/src/rendering/debug.dart
+21
-4
object.dart
packages/flutter/lib/src/rendering/object.dart
+9
-0
debug.dart
packages/flutter/lib/src/widgets/debug.dart
+5
-3
No files found.
packages/flutter/lib/src/rendering/debug.dart
View file @
f45cdd57
...
@@ -121,8 +121,10 @@ bool debugPrintMarkNeedsPaintStacks = false;
...
@@ -121,8 +121,10 @@ bool debugPrintMarkNeedsPaintStacks = false;
///
///
/// See also:
/// See also:
///
///
/// * [debugProfilePaintsEnabled], which does something similar for
/// * [debugProfileLayoutsEnabled], which does something similar for layout
/// painting but using the timeline view.
/// but using the timeline view.
/// * [debugProfilePaintsEnabled], which does something similar for painting
/// but using the timeline view.
/// * [debugPrintRebuildDirtyWidgets], which does something similar for widgets
/// * [debugPrintRebuildDirtyWidgets], which does something similar for widgets
/// being rebuilt.
/// being rebuilt.
/// * The discussion at [RendererBinding.drawFrame].
/// * The discussion at [RendererBinding.drawFrame].
...
@@ -134,6 +136,21 @@ bool debugPrintLayouts = false;
...
@@ -134,6 +136,21 @@ bool debugPrintLayouts = false;
/// enabled by the test framework.
/// enabled by the test framework.
bool
debugCheckIntrinsicSizes
=
false
;
bool
debugCheckIntrinsicSizes
=
false
;
/// Adds [dart:developer.Timeline] events for every [RenderObject] layout.
///
/// For details on how to use [dart:developer.Timeline] events in the Dart
/// Observatory to optimize your app, see:
/// <https://fuchsia.googlesource.com/topaz/+/master/shell/docs/performance.md>
///
/// See also:
///
/// * [debugPrintLayouts], which does something similar for layout but using
/// console output.
/// * [debugProfileBuildsEnabled], which does something similar for widgets
/// being rebuilt.
/// * [debugProfilePaintsEnabled], which does something similar for painting.
bool
debugProfileLayoutsEnabled
=
false
;
/// Adds [dart:developer.Timeline] events for every [RenderObject] painted.
/// Adds [dart:developer.Timeline] events for every [RenderObject] painted.
///
///
/// This is only enabled in debug builds. The timing information this exposes is
/// This is only enabled in debug builds. The timing information this exposes is
...
@@ -146,11 +163,11 @@ bool debugCheckIntrinsicSizes = false;
...
@@ -146,11 +163,11 @@ bool debugCheckIntrinsicSizes = false;
///
///
/// See also:
/// See also:
///
///
/// * [debugPrintLayouts], which does something similar for layout but using
/// console output.
/// * [debugProfileBuildsEnabled], which does something similar for widgets
/// * [debugProfileBuildsEnabled], which does something similar for widgets
/// being rebuilt, and [debugPrintRebuildDirtyWidgets], its console
/// being rebuilt, and [debugPrintRebuildDirtyWidgets], its console
/// equivalent.
/// equivalent.
/// * [debugProfileLayoutsEnabled], which does something similar for layout,
/// and [debugPrintLayouts], its console equivalent.
/// * The discussion at [RendererBinding.drawFrame].
/// * The discussion at [RendererBinding.drawFrame].
/// * [RepaintBoundary], which can be used to contain repaints when unchanged
/// * [RepaintBoundary], which can be used to contain repaints when unchanged
/// areas are being excessively repainted.
/// areas are being excessively repainted.
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
f45cdd57
...
@@ -1674,6 +1674,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
...
@@ -1674,6 +1674,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
/// implemented here) to return early if the child does not need to do any
/// implemented here) to return early if the child does not need to do any
/// work to update its layout information.
/// work to update its layout information.
void
layout
(
Constraints
constraints
,
{
bool
parentUsesSize
=
false
})
{
void
layout
(
Constraints
constraints
,
{
bool
parentUsesSize
=
false
})
{
if
(!
kReleaseMode
&&
debugProfileLayoutsEnabled
)
Timeline
.
startSync
(
'
$runtimeType
'
,
arguments:
timelineArgumentsIndicatingLandmarkEvent
);
assert
(
constraints
!=
null
);
assert
(
constraints
!=
null
);
assert
(
constraints
.
debugAssertIsValid
(
assert
(
constraints
.
debugAssertIsValid
(
isAppliedConstraint:
true
,
isAppliedConstraint:
true
,
...
@@ -1727,6 +1730,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
...
@@ -1727,6 +1730,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
_debugDoingThisResize
=
false
;
_debugDoingThisResize
=
false
;
return
true
;
return
true
;
}());
}());
if
(!
kReleaseMode
&&
debugProfileLayoutsEnabled
)
Timeline
.
finishSync
();
return
;
return
;
}
}
_constraints
=
constraints
;
_constraints
=
constraints
;
...
@@ -1789,6 +1795,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
...
@@ -1789,6 +1795,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
}());
}());
_needsLayout
=
false
;
_needsLayout
=
false
;
markNeedsPaint
();
markNeedsPaint
();
if
(!
kReleaseMode
&&
debugProfileLayoutsEnabled
)
Timeline
.
finishSync
();
}
}
/// If a subclass has a "size" (the state controlled by `parentUsesSize`,
/// If a subclass has a "size" (the state controlled by `parentUsesSize`,
...
...
packages/flutter/lib/src/widgets/debug.dart
View file @
f45cdd57
...
@@ -100,9 +100,11 @@ bool debugPrintGlobalKeyedWidgetLifecycle = false;
...
@@ -100,9 +100,11 @@ bool debugPrintGlobalKeyedWidgetLifecycle = false;
///
///
/// See also:
/// See also:
///
///
/// * [debugProfilePaintsEnabled], which does something similar but for
/// * [debugPrintRebuildDirtyWidgets], which does something similar but
/// painting, and [debugPrintRebuildDirtyWidgets], which does something similar
/// reporting the builds to the console.
/// but reporting the builds to the console.
/// * [debugProfileLayoutsEnabled], which does something similar for layout,
/// and [debugPrintLayouts], its console equivalent.
/// * [debugProfilePaintsEnabled], which does something similar for painting.
bool
debugProfileBuildsEnabled
=
false
;
bool
debugProfileBuildsEnabled
=
false
;
/// Show banners for deprecated widgets.
/// Show banners for deprecated widgets.
...
...
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