| OLD | NEW |
| 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 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
| 8 import 'object.dart'; | 8 import 'object.dart'; |
| 9 import 'package:vector_math/vector_math.dart'; | 9 import 'package:vector_math/vector_math.dart'; |
| 10 import 'package:sky/framework/net/image_cache.dart' as image_cache; | 10 import 'package:sky/framework/net/image_cache.dart' as image_cache; |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 } | 553 } |
| 554 | 554 |
| 555 void paint(RenderObjectDisplayList canvas) { | 555 void paint(RenderObjectDisplayList canvas) { |
| 556 canvas.save(); | 556 canvas.save(); |
| 557 canvas.concat(_transform.storage); | 557 canvas.concat(_transform.storage); |
| 558 super.paint(canvas); | 558 super.paint(canvas); |
| 559 canvas.restore(); | 559 canvas.restore(); |
| 560 } | 560 } |
| 561 } | 561 } |
| 562 | 562 |
| 563 typedef void SizeChangedCallback(sky.Size newSize); |
| 564 |
| 565 class RenderSizeObserver extends RenderProxyBox { |
| 566 RenderSizeObserver({ |
| 567 this.callback, |
| 568 RenderBox child |
| 569 }) : super(child) { |
| 570 assert(callback != null); |
| 571 } |
| 572 |
| 573 SizeChangedCallback callback; |
| 574 |
| 575 void performLayout() { |
| 576 sky.Size oldSize = size; |
| 577 |
| 578 super.performLayout(); |
| 579 |
| 580 if (oldSize != size) |
| 581 callback(size); |
| 582 } |
| 583 } |
| 584 |
| 563 | 585 |
| 564 // RENDER VIEW LAYOUT MANAGER | 586 // RENDER VIEW LAYOUT MANAGER |
| 565 | 587 |
| 566 class ViewConstraints { | 588 class ViewConstraints { |
| 567 | 589 |
| 568 const ViewConstraints({ | 590 const ViewConstraints({ |
| 569 this.width: 0.0, this.height: 0.0, this.orientation: null | 591 this.width: 0.0, this.height: 0.0, this.orientation: null |
| 570 }); | 592 }); |
| 571 | 593 |
| 572 final double width; | 594 final double width; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 | 683 |
| 662 void defaultPaint(RenderObjectDisplayList canvas) { | 684 void defaultPaint(RenderObjectDisplayList canvas) { |
| 663 RenderBox child = firstChild; | 685 RenderBox child = firstChild; |
| 664 while (child != null) { | 686 while (child != null) { |
| 665 assert(child.parentData is ParentDataType); | 687 assert(child.parentData is ParentDataType); |
| 666 canvas.paintChild(child, child.parentData.position); | 688 canvas.paintChild(child, child.parentData.position); |
| 667 child = child.parentData.nextSibling; | 689 child = child.parentData.nextSibling; |
| 668 } | 690 } |
| 669 } | 691 } |
| 670 } | 692 } |
| OLD | NEW |