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

Unified Diff: sky/engine/core/painting/Gradient.dart

Issue 1166223004: Sky: Allow clients to specify tile mode for gradients (repeating or mirror). (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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/painting/Gradient.dart
diff --git a/sky/engine/core/painting/Gradient.dart b/sky/engine/core/painting/Gradient.dart
index 58381812fd72f42ef6709daa89458fcfab11d5eb..6eb199b8b340ef126b6fcde7eb710a8612cd23d3 100644
--- a/sky/engine/core/painting/Gradient.dart
+++ b/sky/engine/core/painting/Gradient.dart
@@ -4,26 +4,34 @@
part of dart.sky;
+enum TileMode {
+ clamp,
+ repeated,
+ mirror
+}
+
// Extends the generated _Gradient interface via the PrivateDart attribute.
class Gradient extends _Gradient {
// TODO(mpcomplete): Maybe pass a list of (color, colorStop) pairs instead?
Gradient.Linear(List<Point> endPoints,
List<Color> colors,
- List<double> colorStops)
+ List<double> colorStops,
+ [TileMode tileMode = TileMode.clamp])
: super() {
if (endPoints == null || endPoints.length != 2)
throw new ArgumentError("Expected exactly 2 [endPoints].");
validateColorStops(colors, colorStops);
- this._initLinear(endPoints, colors, colorStops);
+ this._initLinear(endPoints, colors, colorStops, tileMode.index);
}
Gradient.Radial(Point center,
double radius,
List<Color> colors,
- List<double> colorStops)
+ List<double> colorStops,
+ [TileMode tileMode = TileMode.clamp])
: super() {
validateColorStops(colors, colorStops);
- this._initRadial(center, radius, colors, colorStops);
+ this._initRadial(center, radius, colors, colorStops, tileMode.index);
}
void validateColorStops(List<Color> colors, List<double> colorStops) {

Powered by Google App Engine
This is Rietveld 408576698