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

Side by Side Diff: sky/sdk/lib/rendering/box.dart

Issue 1229793002: Provide an API that allows a RenderObject's performLayout() function to call a callback that mutate… (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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/rendering/object.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 7
8 import 'package:vector_math/vector_math.dart'; 8 import 'package:vector_math/vector_math.dart';
9 9
10 import '../base/debug.dart'; 10 import '../base/debug.dart';
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // other than us, the only object that's allowed to read our size is our parent, if they're said they will 413 // other than us, the only object that's allowed to read our size is our parent, if they're said they will
414 // if you hit this assert trying to access a child's size, pass parentUs esSize: true in layout() 414 // if you hit this assert trying to access a child's size, pass parentUs esSize: true in layout()
415 assert(debugDoingThisResize || debugDoingThisLayout || 415 assert(debugDoingThisResize || debugDoingThisLayout ||
416 (RenderObject.debugActiveLayout == parent && _size._canBeUsedByPa rent)); 416 (RenderObject.debugActiveLayout == parent && _size._canBeUsedByPa rent));
417 } 417 }
418 assert(_size == this._size); // TODO(ianh): Remove this once the analyzer is cleverer 418 assert(_size == this._size); // TODO(ianh): Remove this once the analyzer is cleverer
419 } 419 }
420 return _size; 420 return _size;
421 } 421 }
422 void set size(Size value) { 422 void set size(Size value) {
423 assert(RenderObject.debugDoingLayout);
424 assert((sizedByParent && debugDoingThisResize) || 423 assert((sizedByParent && debugDoingThisResize) ||
425 (!sizedByParent && debugDoingThisLayout)); 424 (!sizedByParent && debugDoingThisLayout));
426 if (value is _DebugSize) { 425 if (value is _DebugSize) {
427 assert(value._canBeUsedByParent); 426 assert(value._canBeUsedByParent);
428 assert(value._owner.parent == this); 427 assert(value._owner.parent == this);
429 } 428 }
430 _size = inDebugBuild ? new _DebugSize(value, this, debugCanParentUseSize) : value; 429 _size = inDebugBuild ? new _DebugSize(value, this, debugCanParentUseSize) : value;
431 } 430 }
432 431
433 Rect get paintBounds => Point.origin & size; 432 Rect get paintBounds => Point.origin & size;
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 1438
1440 void defaultPaint(PaintingCanvas canvas, Offset offset) { 1439 void defaultPaint(PaintingCanvas canvas, Offset offset) {
1441 RenderBox child = firstChild; 1440 RenderBox child = firstChild;
1442 while (child != null) { 1441 while (child != null) {
1443 assert(child.parentData is ParentDataType); 1442 assert(child.parentData is ParentDataType);
1444 canvas.paintChild(child, child.parentData.position + offset); 1443 canvas.paintChild(child, child.parentData.position + offset);
1445 child = child.parentData.nextSibling; 1444 child = child.parentData.nextSibling;
1446 } 1445 }
1447 } 1446 }
1448 } 1447 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/rendering/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698