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

Side by Side Diff: sky/examples/raw/painting.sky

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 unified diff | Download patch
OLDNEW
1 <sky> 1 <sky>
2 <style> 2 <style>
3 div { 3 div {
4 height: 200px; 4 height: 200px;
5 background-color: lightblue; 5 background-color: lightblue;
6 } 6 }
7 </style> 7 </style>
8 <div id="canvas" /> 8 <div id="canvas" />
9 <script> 9 <script>
10 import 'dart:math' as math; 10 import 'dart:math' as math;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 layerPaint.setMaskFilter( 61 layerPaint.setMaskFilter(
62 new MaskFilter.Blur(BlurStyle.normal, 3.0, highQuality: true)); 62 new MaskFilter.Blur(BlurStyle.normal, 3.0, highQuality: true));
63 }) 63 })
64 ..addLayerOnTop( 64 ..addLayerOnTop(
65 new DrawLooperLayerInfo() 65 new DrawLooperLayerInfo()
66 ..setOffset(const Point(75.0, 75.0)) 66 ..setOffset(const Point(75.0, 75.0))
67 ..setColorMode(TransferMode.srcMode) 67 ..setColorMode(TransferMode.srcMode)
68 ..setPaintBits(-1), 68 ..setPaintBits(-1),
69 (Paint layerPaint) { 69 (Paint layerPaint) {
70 Gradient redYellow = new Gradient.Radial( 70 Gradient redYellow = new Gradient.Radial(
71 new Point(0.0, 0.0), radius, 71 new Point(0.0, 0.0), radius/3.0,
72 [const Color(0xFFFFFF00), const Color(0xFFFF0000)], 72 [const Color(0xFFFFFF00), const Color(0xFFFF0000)],
73 null); 73 null, TileMode.mirror);
74 layerPaint.setShader(redYellow); 74 layerPaint.setShader(redYellow);
75 }) 75 })
76 ..addLayerOnTop( 76 ..addLayerOnTop(
77 new DrawLooperLayerInfo()..setOffset(const Point(225.0, 75.0)), 77 new DrawLooperLayerInfo()..setOffset(const Point(225.0, 75.0)),
78 (Paint layerPaint) { 78 (Paint layerPaint) {
79 // Since this layer uses a DST color mode, this has no effect. 79 // Since this layer uses a DST color mode, this has no effect.
80 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); 80 layerPaint.color = const Color.fromARGB(128, 255, 0, 0);
81 }); 81 });
82 paint.setDrawLooper(builder.build()); 82 paint.setDrawLooper(builder.build());
83 context.drawCircle(0.0, 0.0, radius, paint); 83 context.drawCircle(0.0, 0.0, radius, paint);
84 84
85 context.commit(); 85 context.commit();
86 }); 86 });
87 } 87 }
88 </script> 88 </script>
89 </sky> 89 </sky>
OLDNEW
« sky/engine/core/painting/CanvasGradient.h ('K') | « sky/engine/core/painting/Gradient.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698