| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 void paint(RenderObjectDisplayList canvas) { | 184 void paint(RenderObjectDisplayList canvas) { |
| 185 if (child != null) | 185 if (child != null) |
| 186 child.paint(canvas); | 186 child.paint(canvas); |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 class RenderSizedBox extends RenderProxyBox { | 190 class RenderSizedBox extends RenderProxyBox { |
| 191 | 191 |
| 192 RenderSizedBox({ | 192 RenderSizedBox({ |
| 193 RenderBox child, | 193 RenderBox child, |
| 194 sky.Size desiredSize: const sky.Size.infinite() | 194 sky.Size desiredSize: sky.Size.infinite |
| 195 }) : super(child) { | 195 }) : super(child) { |
| 196 assert(desiredSize != null); | 196 assert(desiredSize != null); |
| 197 this.desiredSize = desiredSize; | 197 this.desiredSize = desiredSize; |
| 198 } | 198 } |
| 199 | 199 |
| 200 sky.Size _desiredSize; | 200 sky.Size _desiredSize; |
| 201 sky.Size get desiredSize => _desiredSize; | 201 sky.Size get desiredSize => _desiredSize; |
| 202 void set desiredSize (sky.Size value) { | 202 void set desiredSize (sky.Size value) { |
| 203 assert(value != null); | 203 assert(value != null); |
| 204 if (_desiredSize == value) | 204 if (_desiredSize == value) |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 | 371 |
| 372 class BorderSide { | 372 class BorderSide { |
| 373 const BorderSide({ | 373 const BorderSide({ |
| 374 this.color: const sky.Color(0xFF000000), | 374 this.color: const sky.Color(0xFF000000), |
| 375 this.width: 1.0 | 375 this.width: 1.0 |
| 376 }); | 376 }); |
| 377 final sky.Color color; | 377 final sky.Color color; |
| 378 final double width; | 378 final double width; |
| 379 | 379 |
| 380 static const None = const BorderSide(width: 0.0); | 380 static const none = const BorderSide(width: 0.0); |
| 381 | 381 |
| 382 int get hashCode { | 382 int get hashCode { |
| 383 int value = 373; | 383 int value = 373; |
| 384 value = 37 * value * color.hashCode; | 384 value = 37 * value * color.hashCode; |
| 385 value = 37 * value * width.hashCode; | 385 value = 37 * value * width.hashCode; |
| 386 return value; | 386 return value; |
| 387 } | 387 } |
| 388 String toString() => 'BorderSide($color, $width)'; | 388 String toString() => 'BorderSide($color, $width)'; |
| 389 } | 389 } |
| 390 | 390 |
| 391 class Border { | 391 class Border { |
| 392 const Border({ | 392 const Border({ |
| 393 this.top: BorderSide.None, | 393 this.top: BorderSide.none, |
| 394 this.right: BorderSide.None, | 394 this.right: BorderSide.none, |
| 395 this.bottom: BorderSide.None, | 395 this.bottom: BorderSide.none, |
| 396 this.left: BorderSide.None | 396 this.left: BorderSide.none |
| 397 }); | 397 }); |
| 398 const Border.all(BorderSide side) : | 398 const Border.all(BorderSide side) : |
| 399 top = side, | 399 top = side, |
| 400 right = side, | 400 right = side, |
| 401 bottom = side, | 401 bottom = side, |
| 402 left = side; | 402 left = side; |
| 403 final BorderSide top; | 403 final BorderSide top; |
| 404 final BorderSide right; | 404 final BorderSide right; |
| 405 final BorderSide bottom; | 405 final BorderSide bottom; |
| 406 final BorderSide left; | 406 final BorderSide left; |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 | 766 |
| 767 void defaultPaint(RenderObjectDisplayList canvas) { | 767 void defaultPaint(RenderObjectDisplayList canvas) { |
| 768 RenderBox child = firstChild; | 768 RenderBox child = firstChild; |
| 769 while (child != null) { | 769 while (child != null) { |
| 770 assert(child.parentData is ParentDataType); | 770 assert(child.parentData is ParentDataType); |
| 771 canvas.paintChild(child, child.parentData.position); | 771 canvas.paintChild(child, child.parentData.position); |
| 772 child = child.parentData.nextSibling; | 772 child = child.parentData.nextSibling; |
| 773 } | 773 } |
| 774 } | 774 } |
| 775 } | 775 } |
| OLD | NEW |