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:sky' as sky; | 5 import 'dart:sky' as sky; |
6 import 'dart:sky' show Point, Size, Rect, Color, Paint, Path; | 6 import 'dart:sky' show Point, Size, Rect, Color, Paint, Path; |
7 import 'shadows.dart'; | 7 import 'shadows.dart'; |
8 | 8 |
9 class BorderSide { | 9 class BorderSide { |
10 const BorderSide({ | 10 const BorderSide({ |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 this.endPoints, | 78 this.endPoints, |
79 this.colors, | 79 this.colors, |
80 this.colorStops, | 80 this.colorStops, |
81 this.tileMode: sky.TileMode.clamp | 81 this.tileMode: sky.TileMode.clamp |
82 }); | 82 }); |
83 | 83 |
84 String toString() => | 84 String toString() => |
85 'LinearGradient($endPoints, $colors, $colorStops, $tileMode)'; | 85 'LinearGradient($endPoints, $colors, $colorStops, $tileMode)'; |
86 | 86 |
87 sky.Shader createShader() { | 87 sky.Shader createShader() { |
88 return new sky.Gradient.Linear(this.endPoints, this.colors, this.colorStops, | 88 return new sky.Gradient.linear(this.endPoints, this.colors, this.colorStops, |
89 this.tileMode); | 89 this.tileMode); |
90 } | 90 } |
91 | 91 |
92 final List<Point> endPoints; | 92 final List<Point> endPoints; |
93 final List<Color> colors; | 93 final List<Color> colors; |
94 final List<double> colorStops; | 94 final List<double> colorStops; |
95 final sky.TileMode tileMode; | 95 final sky.TileMode tileMode; |
96 } | 96 } |
97 | 97 |
98 class RadialGradient extends Gradient { | 98 class RadialGradient extends Gradient { |
99 RadialGradient({ | 99 RadialGradient({ |
100 this.center, | 100 this.center, |
101 this.radius, | 101 this.radius, |
102 this.colors, | 102 this.colors, |
103 this.colorStops, | 103 this.colorStops, |
104 this.tileMode: sky.TileMode.clamp | 104 this.tileMode: sky.TileMode.clamp |
105 }); | 105 }); |
106 | 106 |
107 String toString() => | 107 String toString() => |
108 'RadialGradient($center, $radius, $colors, $colorStops, $tileMode)'; | 108 'RadialGradient($center, $radius, $colors, $colorStops, $tileMode)'; |
109 | 109 |
110 sky.Shader createShader() { | 110 sky.Shader createShader() { |
111 return new sky.Gradient.Radial(this.center, this.radius, this.colors, | 111 return new sky.Gradient.radial(this.center, this.radius, this.colors, |
112 this.colorStops, this.tileMode); | 112 this.colorStops, this.tileMode); |
113 } | 113 } |
114 | 114 |
115 final Point center; | 115 final Point center; |
116 final double radius; | 116 final double radius; |
117 final List<Color> colors; | 117 final List<Color> colors; |
118 final List<double> colorStops; | 118 final List<double> colorStops; |
119 final sky.TileMode tileMode; | 119 final sky.TileMode tileMode; |
120 } | 120 } |
121 | 121 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 path = new Path(); | 243 path = new Path(); |
244 path.moveTo(rect.left, rect.bottom); | 244 path.moveTo(rect.left, rect.bottom); |
245 path.lineTo(rect.left + _decoration.border.left.width, rect.bottom - _deco
ration.border.bottom.width); | 245 path.lineTo(rect.left + _decoration.border.left.width, rect.bottom - _deco
ration.border.bottom.width); |
246 path.lineTo(rect.left + _decoration.border.left.width, rect.top + _decorat
ion.border.top.width); | 246 path.lineTo(rect.left + _decoration.border.left.width, rect.top + _decorat
ion.border.top.width); |
247 path.lineTo(rect.left, rect.top); | 247 path.lineTo(rect.left, rect.top); |
248 path.close(); | 248 path.close(); |
249 canvas.drawPath(path, paint); | 249 canvas.drawPath(path, paint); |
250 } | 250 } |
251 } | 251 } |
252 } | 252 } |
OLD | NEW |