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

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

Issue 1144193006: Sky: Add a DrawLooper interface to the painting API to be used for shadows. (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 21 matching lines...) Expand all
32 0.5, 0.0, 0.0, 32 0.5, 0.0, 0.0,
33 0.0, 0.5, 0.0, 33 0.0, 0.5, 0.0,
34 0.0, 0.0, 1.0 34 0.0, 0.0, 1.0
35 ]; 35 ];
36 context.concat(scaleMatrix); 36 context.concat(scaleMatrix);
37 paint.setARGB(128, 0, 255, 0); 37 paint.setARGB(128, 0, 255, 0);
38 context.drawCircle(0.0, 0.0, radius, paint); 38 context.drawCircle(0.0, 0.0, radius, paint);
39 39
40 context.restore(); 40 context.restore();
41 41
42 var builder = new LayerDrawLooperBuilder()
43 ..addLayerOnTop(
44 new DrawLooperLayerInfo()..setOffset(150.0, 0.0)..setPaintBits(-1),
45 (Paint layerPaint) {
46 // TODO(mpcomplete): This won't do anything until we add support for
47 // setting the color filter.
48 layerPaint.setARGB(128, 0, 0, 255);
49 })
50 ..addLayerOnTop(
51 new DrawLooperLayerInfo()..setOffset(75.0, 75.0)..setPaintBits(0),
52 (Paint layerPaint) {
53 layerPaint.setARGB(128, 255, 0, 0);
54 });
55 paint.setDrawLooper(builder.build());
42 context.drawCircle(0.0, 0.0, radius, paint); 56 context.drawCircle(0.0, 0.0, radius, paint);
43 57
44 context.commit(); 58 context.commit();
45 }); 59 });
46 } 60 }
47 </script> 61 </script>
48 </sky> 62 </sky>
OLDNEW
« sky/engine/core/painting/Paint.h ('K') | « sky/engine/core/painting/Paint.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698