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

Side by Side Diff: sky/sdk/lib/framework/painting/box_painter.dart

Issue 1180873003: Sky: Small fixes to Gradient interface. Added comments and renamed constructors. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « sky/examples/raw/painting.sky ('k') | no next file » | 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: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
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
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 }
OLDNEW
« no previous file with comments | « sky/examples/raw/painting.sky ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698