Commit 0b392665 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

More debug help. (#11308)

parent 05ccad7d
......@@ -95,9 +95,6 @@ HSVColor debugCurrentRepaintColor = _kDebugCurrentRepaintColor;
/// The amount to increment the hue of the current repaint color.
double debugRepaintRainbowHueIncrement = _kDebugRepaintRainbowHueIncrement;
/// Log the call stacks that mark render objects as needing paint.
bool debugPrintMarkNeedsPaintStacks = false;
/// Log the call stacks that mark render objects as needing layout.
///
/// For sanity, this only logs the stack traces of cases where an object is
......@@ -106,6 +103,29 @@ bool debugPrintMarkNeedsPaintStacks = false;
/// up the tree.
bool debugPrintMarkNeedsLayoutStacks = false;
/// Log the call stacks that mark render objects as needing paint.
bool debugPrintMarkNeedsPaintStacks = false;
/// Log the dirty render objects that are laid out each frame.
///
/// Combined with [debugPrintBeginFrameBanner], this allows you to distinguish
/// layouts triggered by the initial mounting of a render tree (e.g. in a call
/// to [runApp]) from the regular layouts triggered by the pipeline.
///
/// Combined with [debugPrintMarkNeedsLayoutStacks], this lets you watch a
/// render object's dirty/clean lifecycle.
///
/// See also:
///
/// * [debugProfilePaintsEnabled], which does something similar for
/// painting but using the timeline view.
///
/// * [debugPrintRebuildDirtyWidgets], which does something similar for widgets
/// being rebuilt.
///
/// * The discussion at [RendererBinding.drawFrame].
bool debugPrintLayouts = false;
/// Check the intrinsic sizes of each [RenderBox] during layout.
///
/// By default this is turned off since these checks are expensive, but it is
......@@ -121,6 +141,16 @@ bool debugCheckIntrinsicSizes = false;
/// For details on how to use [dart:developer.Timeline] events in the Dart
/// Observatory to optimize your app, see:
/// <https://fuchsia.googlesource.com/sysui/+/master/docs/performance.md>
///
/// See also:
///
/// * [debugPrintLayouts], which does something similar for layout but using
/// console output.
///
/// * [debugPrintRebuildDirtyWidgets], which does something similar for widgets
/// being rebuilt.
///
/// * The discussion at [RendererBinding.drawFrame].
bool debugProfilePaintsEnabled = false;
......@@ -184,8 +214,9 @@ bool debugAssertAllRenderVarsUnset(String reason, { bool debugCheckIntrinsicSize
debugPaintPointersEnabled ||
debugRepaintRainbowEnabled ||
debugRepaintTextRainbowEnabled ||
debugPrintMarkNeedsPaintStacks ||
debugPrintMarkNeedsLayoutStacks ||
debugPrintMarkNeedsPaintStacks ||
debugPrintLayouts ||
debugCheckIntrinsicSizes != debugCheckIntrinsicSizesOverride ||
debugProfilePaintsEnabled ||
debugPaintSizeColor != _kDebugPaintSizeColor ||
......
......@@ -754,6 +754,8 @@ class PhysicalModelLayer extends ContainerLayer {
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('clipRRect: $clipRRect');
description.add('elevation: $elevation');
description.add('color: $color');
}
}
......
......@@ -1743,6 +1743,8 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
_debugDoingThisLayout = true;
debugPreviousActiveLayout = _debugActiveLayout;
_debugActiveLayout = this;
if (debugPrintLayouts)
debugPrint('Laying out (without resize) $this');
return true;
});
try {
......@@ -1849,6 +1851,8 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
assert(!_doingThisLayoutWithCallback);
assert(() {
_debugMutationsLocked = true;
if (debugPrintLayouts)
debugPrint('Laying out (${sizedByParent ? "with separate resize" : "with resize allowed"}) $this');
return true;
});
if (sizedByParent) {
......
......@@ -21,7 +21,16 @@ import 'package:flutter/foundation.dart';
/// intra-frame output from inter-frame output, set [debugPrintEndFrameBanner]
/// to true as well.
///
/// See [SchedulerBinding.handleBeginFrame].
/// See also:
///
/// * [debugProfilePaintsEnabled], which does something similar for
/// painting but using the timeline view.
///
/// * [debugPrintLayouts], which does something similar for layout but using
/// console output.
///
/// * The discussions at [WidgetsBinding.drawFrame] and at
/// [SchedulerBinding.handleBeginFrame].
bool debugPrintBeginFrameBanner = false;
/// Print a banner at the end of each frame.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment