Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: sky/sdk/lib/rendering/object.dart

Issue 1233623007: Provide some debug-mode time hooks to visually debug painting and layout. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/rendering/box.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/rendering/object.dart
diff --git a/sky/sdk/lib/rendering/object.dart b/sky/sdk/lib/rendering/object.dart
index 955ad512693e449dfea4214646951206124e5542..b0a1b88b593a0836ab7e74b7307965729ea82d6a 100644
--- a/sky/sdk/lib/rendering/object.dart
+++ b/sky/sdk/lib/rendering/object.dart
@@ -370,7 +370,6 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
assert(!_needsLayout); // check that the paint() method didn't mark us dirty again
assert(!_needsPaint); // check that the paint() method didn't mark us dirty again
_paintingNode.setBackingDrawable(recorder.endRecordingAsDrawable());
-
if (canvas._descendentsWithPaintingCanvases != null) {
for (RenderObject node in canvas._descendentsWithPaintingCanvases) {
assert(node.attached == attached);
@@ -388,10 +387,17 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
_debugDoingThisPaint = true;
debugLastActivePaint = _debugActivePaint;
_debugActivePaint = this;
+ debugPaint(canvas, offset);
+ if (debugPaintBoundsEnabled) {
+ canvas.save();
+ canvas.clipRect(paintBounds.shift(offset));
+ }
return true;
});
paint(canvas, offset);
assert(() {
+ if (debugPaintBoundsEnabled)
+ canvas.restore();
_debugActivePaint = debugLastActivePaint;
_debugDoingThisPaint = false;
return true;
@@ -401,6 +407,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
bool get createNewDisplayList => false;
Rect get paintBounds;
+ void debugPaint(PaintingCanvas canvas, Offset offset) { }
void paint(PaintingCanvas canvas, Offset offset) { }
« no previous file with comments | « sky/sdk/lib/rendering/box.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698