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 '../painting/shadows.dart'; | 9 import '../painting/shadows.dart'; |
10 import 'package:vector_math/vector_math.dart'; | 10 import 'package:vector_math/vector_math.dart'; |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 } | 790 } |
791 | 791 |
792 return _cachedBackgroundPaint; | 792 return _cachedBackgroundPaint; |
793 } | 793 } |
794 | 794 |
795 void paint(RenderObjectDisplayList canvas) { | 795 void paint(RenderObjectDisplayList canvas) { |
796 assert(size.width != null); | 796 assert(size.width != null); |
797 assert(size.height != null); | 797 assert(size.height != null); |
798 | 798 |
799 if (_decoration.backgroundColor != null || _decoration.boxShadow != null || | 799 if (_decoration.backgroundColor != null || _decoration.boxShadow != null || |
800 _deocration.gradient != null) { | 800 _decoration.gradient != null) { |
801 Rect rect = new Rect.fromLTRB(0.0, 0.0, size.width, size.height); | 801 Rect rect = new Rect.fromLTRB(0.0, 0.0, size.width, size.height); |
802 if (_decoration.borderRadius == null) | 802 if (_decoration.borderRadius == null) |
803 canvas.drawRect(rect, _backgroundPaint); | 803 canvas.drawRect(rect, _backgroundPaint); |
804 else | 804 else |
805 canvas.drawRRect(new sky.RRect()..setRectXY(rect, _decoration.borderRadi
us, _decoration.borderRadius), _backgroundPaint); | 805 canvas.drawRRect(new sky.RRect()..setRectXY(rect, _decoration.borderRadi
us, _decoration.borderRadius), _backgroundPaint); |
806 } | 806 } |
807 | 807 |
808 if (_decoration.border != null) { | 808 if (_decoration.border != null) { |
809 assert(_decoration.borderRadius == null); // TODO(abarth): Implement borde
rs with border radius. | 809 assert(_decoration.borderRadius == null); // TODO(abarth): Implement borde
rs with border radius. |
810 | 810 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 | 1089 |
1090 void defaultPaint(RenderObjectDisplayList canvas) { | 1090 void defaultPaint(RenderObjectDisplayList canvas) { |
1091 RenderBox child = firstChild; | 1091 RenderBox child = firstChild; |
1092 while (child != null) { | 1092 while (child != null) { |
1093 assert(child.parentData is ParentDataType); | 1093 assert(child.parentData is ParentDataType); |
1094 canvas.paintChild(child, child.parentData.position); | 1094 canvas.paintChild(child, child.parentData.position); |
1095 child = child.parentData.nextSibling; | 1095 child = child.parentData.nextSibling; |
1096 } | 1096 } |
1097 } | 1097 } |
1098 } | 1098 } |
OLD | NEW |