OLD | NEW |
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 Loading... |
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> |
OLD | NEW |