Commit 0334a833 authored by Ian Hickson's avatar Ian Hickson

Rename debugDescribeSettings to debugFillDescription.

...so that it's easier to copy/paste between the rendering and settings layers.
parent a724d6cc
......@@ -115,9 +115,9 @@ abstract class RenderBlockBase extends RenderBox
assert(!size.isInfinite);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('direction: $direction');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('direction: $direction');
}
}
......@@ -441,8 +441,8 @@ class RenderBlockViewport extends RenderBlockBase {
return defaultHitTestChildren(result, position: position + new Offset(-startOffset, 0.0));
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('startOffset: $startOffset');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('startOffset: $startOffset');
}
}
......@@ -596,9 +596,9 @@ abstract class RenderBox extends RenderObject {
node = node.parent;
information.writeln('The nearest ancestor providing an unbounded width constraint is:');
information.writeln(' $node');
List<String> settings = <String>[];
node.debugDescribeSettings(settings);
for (String line in settings)
List<String> description = <String>[];
node.debugFillDescription(description);
for (String line in description)
information.writeln(' $line');
}
if (!constraints.hasBoundedHeight) {
......@@ -607,9 +607,9 @@ abstract class RenderBox extends RenderObject {
node = node.parent;
information.writeln('The nearest ancestor providing an unbounded height constraint is:');
information.writeln(' $node');
List<String> settings = <String>[];
node.debugDescribeSettings(settings);
for (String line in settings)
List<String> description = <String>[];
node.debugFillDescription(description);
for (String line in description)
information.writeln(' $line');
}
throw new RenderingError(
......@@ -878,9 +878,9 @@ abstract class RenderBox extends RenderObject {
});
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('size: ${ hasSize ? size : "MISSING" }');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('size: ${ hasSize ? size : "MISSING" }');
}
}
......
......@@ -232,9 +232,9 @@ class RenderChildView extends RenderBox {
context.pushChildScene(offset, _layoutInfo);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('child: $child');
settings.add('scale: $scale');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('child: $child');
description.add('scale: $scale');
}
}
......@@ -590,12 +590,12 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
return header;
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('direction: $_direction');
settings.add('justifyContent: $_justifyContent');
settings.add('alignItems: $_alignItems');
settings.add('textBaseline: $_textBaseline');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('direction: $_direction');
description.add('justifyContent: $_justifyContent');
description.add('alignItems: $_alignItems');
description.add('textBaseline: $_textBaseline');
}
}
......@@ -249,24 +249,24 @@ class RenderImage extends RenderBox {
);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('image: $image');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('image: $image');
if (width != null)
settings.add('width: $width');
description.add('width: $width');
if (height != null)
settings.add('height: $height');
description.add('height: $height');
if (scale != 1.0)
settings.add('scale: $scale');
description.add('scale: $scale');
if (color != null)
settings.add('color: $color');
description.add('color: $color');
if (fit != null)
settings.add('fit: $fit');
description.add('fit: $fit');
if (alignment != null)
settings.add('alignment: $alignment');
description.add('alignment: $alignment');
if (repeat != ImageRepeat.noRepeat)
settings.add('repeat: $repeat');
description.add('repeat: $repeat');
if (centerSlice != null)
settings.add('centerSlice: $centerSlice');
description.add('centerSlice: $centerSlice');
}
}
......@@ -77,19 +77,19 @@ abstract class Layer {
String toStringDeep([String prefixLineOne = '', String prefixOtherLines = '']) {
String result = '$prefixLineOne$this\n';
final String childrenDescription = debugDescribeChildren(prefixOtherLines);
final String settingsPrefix = childrenDescription != '' ? '$prefixOtherLines \u2502 ' : '$prefixOtherLines ';
List<String> settings = <String>[];
debugDescribeSettings(settings);
result += settings.map((String setting) => "$settingsPrefix$setting\n").join();
final String descriptionPrefix = childrenDescription != '' ? '$prefixOtherLines \u2502 ' : '$prefixOtherLines ';
List<String> description = <String>[];
debugFillDescription(description);
result += description.map((String description) => "$descriptionPrefix$description\n").join();
if (childrenDescription == '')
result += '$prefixOtherLines\n';
result += childrenDescription;
return result;
}
void debugDescribeSettings(List<String> settings) {
void debugFillDescription(List<String> description) {
if (debugOwner != null)
settings.add('owner: $debugOwner');
description.add('owner: $debugOwner');
}
String debugDescribeChildren(String prefix) => '';
......@@ -122,12 +122,12 @@ class ChildSceneLayer extends Layer {
);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('offset: $offset');
settings.add('physicalWidth: ${layoutInfo.size.width}');
settings.add('physicalHeight: ${layoutInfo.size.height}');
settings.add('sceneToken.value: ${layoutInfo.sceneToken.value}');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('offset: $offset');
description.add('physicalWidth: ${layoutInfo.size.width}');
description.add('physicalHeight: ${layoutInfo.size.height}');
description.add('sceneToken.value: ${layoutInfo.sceneToken.value}');
}
}
......@@ -283,9 +283,9 @@ class OffsetLayer extends ContainerLayer {
addChildrenToScene(builder, offset + layerOffset);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('offset: $offset');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('offset: $offset');
}
}
......@@ -305,9 +305,9 @@ class ClipRectLayer extends ContainerLayer {
builder.pop();
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('clipRect: $clipRect');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('clipRect: $clipRect');
}
}
......@@ -326,9 +326,9 @@ class ClipRRectLayer extends ContainerLayer {
builder.pop();
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('clipRRect: $clipRRect');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('clipRRect: $clipRRect');
}
}
......@@ -347,9 +347,9 @@ class ClipPathLayer extends ContainerLayer {
builder.pop();
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('clipPath: $clipPath');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('clipPath: $clipPath');
}
}
......@@ -368,10 +368,10 @@ class TransformLayer extends OffsetLayer {
builder.pop();
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('transform:');
settings.addAll(debugDescribeTransform(transform));
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('transform:');
description.addAll(debugDescribeTransform(transform));
}
}
......@@ -391,9 +391,9 @@ class OpacityLayer extends ContainerLayer {
builder.pop();
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('alpha: $alpha');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('alpha: $alpha');
}
}
......@@ -416,10 +416,10 @@ class ShaderMaskLayer extends ContainerLayer {
builder.pop();
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('shader: $shader');
settings.add('maskRect: $maskRect');
settings.add('transferMode: $transferMode');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('shader: $shader');
description.add('maskRect: $maskRect');
description.add('transferMode: $transferMode');
}
}
......@@ -1701,10 +1701,10 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
_debugActiveLayout = null;
String result = '$prefixLineOne$this\n';
final String childrenDescription = debugDescribeChildren(prefixOtherLines);
final String settingsPrefix = childrenDescription != '' ? '$prefixOtherLines \u2502 ' : '$prefixOtherLines ';
List<String> settings = <String>[];
debugDescribeSettings(settings);
result += settings.map((String setting) => "$settingsPrefix$setting\n").join();
final String descriptionPrefix = childrenDescription != '' ? '$prefixOtherLines \u2502 ' : '$prefixOtherLines ';
List<String> description = <String>[];
debugFillDescription(description);
result += description.map((String description) => "$descriptionPrefix$description\n").join();
if (childrenDescription == '')
result += '$prefixOtherLines\n';
result += childrenDescription;
......@@ -1722,9 +1722,9 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
_debugActiveLayout = null;
StringBuffer result = new StringBuffer();
result.write('$this; ');
List<String> settings = <String>[];
debugDescribeSettings(settings);
result.write(settings.join('; '));
List<String> description = <String>[];
debugFillDescription(description);
result.write(description.join('; '));
_debugActiveLayout = debugPreviousActiveLayout;
return result.toString();
}
......@@ -1732,11 +1732,11 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// Returns a list of strings describing the current node's fields, one field
/// per string. Subclasses should override this to have their information
/// included in toStringDeep().
void debugDescribeSettings(List<String> settings) {
void debugFillDescription(List<String> description) {
if (debugOwner != null)
settings.add('owner: $debugOwner');
settings.add('parentData: $parentData');
settings.add('constraints: $constraints');
description.add('owner: $debugOwner');
description.add('parentData: $parentData');
description.add('constraints: $constraints');
}
/// Returns a string describing the current node's descendants. Each line of
......
......@@ -127,17 +127,17 @@ abstract class RenderProxyBoxWithHitTestBehavior extends RenderProxyBox {
bool hitTestSelf(Point position) => behavior == HitTestBehavior.opaque;
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
switch (behavior) {
case HitTestBehavior.translucent:
settings.add('behavior: translucent');
description.add('behavior: translucent');
break;
case HitTestBehavior.opaque:
settings.add('behavior: opaque');
description.add('behavior: opaque');
break;
case HitTestBehavior.deferToChild:
settings.add('behavior: defer-to-child');
description.add('behavior: defer-to-child');
break;
}
}
......@@ -224,9 +224,9 @@ class RenderConstrainedBox extends RenderProxyBox {
});
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('additionalConstraints: $additionalConstraints');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('additionalConstraints: $additionalConstraints');
}
}
......@@ -339,10 +339,10 @@ class RenderFractionallySizedBox extends RenderProxyBox {
}
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('widthFactor: ${_widthFactor ?? "pass-through"}');
settings.add('heightFactor: ${_heightFactor ?? "pass-through"}');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('widthFactor: ${_widthFactor ?? "pass-through"}');
description.add('heightFactor: ${_heightFactor ?? "pass-through"}');
}
}
......@@ -410,9 +410,9 @@ class RenderAspectRatio extends RenderProxyBox {
child.layout(new BoxConstraints.tight(size));
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('aspectRatio: $aspectRatio');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('aspectRatio: $aspectRatio');
}
}
......@@ -512,10 +512,10 @@ class RenderIntrinsicWidth extends RenderProxyBox {
}
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('stepWidth: $stepWidth');
settings.add('stepHeight: $stepHeight');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('stepWidth: $stepWidth');
description.add('stepHeight: $stepHeight');
}
}
......@@ -633,9 +633,9 @@ class RenderOpacity extends RenderProxyBox {
visitor(child);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('opacity: ${opacity.toStringAsFixed(1)}');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('opacity: ${opacity.toStringAsFixed(1)}');
}
}
......@@ -940,10 +940,10 @@ class RenderDecoratedBox extends RenderProxyBox {
_painter.paint(context.canvas, offset & size);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('decoration:');
settings.addAll(_decoration.toString(" ").split('\n'));
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('decoration:');
description.addAll(_decoration.toString(" ").split('\n'));
}
}
......@@ -1099,13 +1099,13 @@ class RenderTransform extends RenderProxyBox {
super.applyPaintTransform(child, transform);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('transform matrix:');
settings.addAll(debugDescribeTransform(_transform));
settings.add('origin: $origin');
settings.add('alignment: $alignment');
settings.add('transformHitTests: $transformHitTests');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('transform matrix:');
description.addAll(debugDescribeTransform(_transform));
description.add('origin: $origin');
description.add('alignment: $alignment');
description.add('transformHitTests: $transformHitTests');
}
}
......@@ -1160,10 +1160,10 @@ class RenderFractionalTranslation extends RenderProxyBox {
super.applyPaintTransform(child, transform);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('translation: $translation');
settings.add('transformHitTests: $transformHitTests');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('translation: $translation');
description.add('transformHitTests: $transformHitTests');
}
}
......@@ -1344,8 +1344,8 @@ class RenderPointerListener extends RenderProxyBoxWithHitTestBehavior {
return onPointerCancel(event);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
List<String> listeners = <String>[];
if (onPointerDown != null)
listeners.add('down');
......@@ -1357,7 +1357,7 @@ class RenderPointerListener extends RenderProxyBoxWithHitTestBehavior {
listeners.add('cancel');
if (listeners.isEmpty)
listeners.add('<none>');
settings.add('listeners: ${listeners.join(", ")}');
description.add('listeners: ${listeners.join(", ")}');
}
}
......@@ -1430,10 +1430,10 @@ class RenderIgnorePointer extends RenderProxyBox {
visitor(child);
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('ignoring: $ignoring');
settings.add('ignoringSemantics: ${ ignoringSemantics == null ? "implicitly " : "" }$_effectiveIgnoringSemantics');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('ignoring: $ignoring');
description.add('ignoringSemantics: ${ ignoringSemantics == null ? "implicitly " : "" }$_effectiveIgnoringSemantics');
}
}
......@@ -1448,9 +1448,9 @@ class RenderMetaData extends RenderProxyBoxWithHitTestBehavior {
/// Opaque meta data ignored by the render tree
dynamic metaData;
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('metaData: $metaData');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('metaData: $metaData');
}
}
......
......@@ -198,9 +198,9 @@ class RenderPadding extends RenderShiftedBox {
});
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('padding: $padding');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('padding: $padding');
}
}
......@@ -347,9 +347,9 @@ class RenderPositionedBox extends RenderShiftedBox {
});
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('alignment: $alignment');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('alignment: $alignment');
}
}
......@@ -495,13 +495,13 @@ class RenderOverflowBox extends RenderShiftedBox {
}
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('minWidth: ${minWidth ?? "use parent minWidth constraint"}');
settings.add('maxWidth: ${maxWidth ?? "use parent maxWidth constraint"}');
settings.add('minHeight: ${minHeight ?? "use parent minHeight constraint"}');
settings.add('maxHeight: ${maxHeight ?? "use parent maxHeight constraint"}');
settings.add('alignment: $alignment');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('minWidth: ${minWidth ?? "use parent minWidth constraint"}');
description.add('maxWidth: ${maxWidth ?? "use parent maxWidth constraint"}');
description.add('minHeight: ${minHeight ?? "use parent minHeight constraint"}');
description.add('maxHeight: ${maxHeight ?? "use parent maxHeight constraint"}');
description.add('alignment: $alignment');
}
}
......@@ -636,9 +636,9 @@ class RenderBaseline extends RenderShiftedBox {
}
}
void debugDescribeSettings(List<String> settings) {
super.debugDescribeSettings(settings);
settings.add('baseline: $baseline');
settings.add('baselineType: $baselineType');
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('baseline: $baseline');
description.add('baselineType: $baselineType');
}
}
......@@ -142,10 +142,10 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
Rect get paintBounds => Point.origin & size;
Rect get semanticBounds => Point.origin & size;
void debugDescribeSettings(List<String> settings) {
// call to ${super.debugDescribeSettings(prefix)} is omitted because the root superclasses don't include any interesting information for this class
settings.add('window size: ${ui.window.size} (in device pixels)');
settings.add('device pixel ratio: ${ui.window.devicePixelRatio} (device pixels per logical pixel)');
settings.add('configuration: $configuration (in logical pixels)');
void debugFillDescription(List<String> description) {
// call to ${super.debugFillDescription(prefix)} is omitted because the root superclasses don't include any interesting information for this class
description.add('window size: ${ui.window.size} (in device pixels)');
description.add('device pixel ratio: ${ui.window.devicePixelRatio} (device pixels per logical pixel)');
description.add('configuration: $configuration (in logical pixels)');
}
}
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