| 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 26 matching lines...) Expand all Loading... |
| 37 context.concat(scaleMatrix); | 37 context.concat(scaleMatrix); |
| 38 paint.color = const Color.fromARGB(128, 0, 255, 0); | 38 paint.color = const Color.fromARGB(128, 0, 255, 0); |
| 39 context.drawCircle(0.0, 0.0, radius, paint); | 39 context.drawCircle(0.0, 0.0, radius, paint); |
| 40 | 40 |
| 41 context.restore(); | 41 context.restore(); |
| 42 | 42 |
| 43 context.translate(0.0, 50.0); | 43 context.translate(0.0, 50.0); |
| 44 var builder = new LayerDrawLooperBuilder() | 44 var builder = new LayerDrawLooperBuilder() |
| 45 ..addLayerOnTop( | 45 ..addLayerOnTop( |
| 46 new DrawLooperLayerInfo() | 46 new DrawLooperLayerInfo() |
| 47 ..setOffset(150.0, 0.0)..setPaintBits(-1)..setColorMode(1), | 47 ..setOffset(const Point(150.0, 0.0)) |
| 48 ..setColorMode(TransferMode.srcMode) |
| 49 ..setPaintBits(-1), |
| 48 (Paint layerPaint) { | 50 (Paint layerPaint) { |
| 49 layerPaint.color = const Color.fromARGB(128, 255, 255, 0); | 51 layerPaint.color = const Color.fromARGB(128, 255, 255, 0); |
| 50 layerPaint.setColorFilter(new ColorFilter(0x770000ff, 5)); | 52 layerPaint.setColorFilter( |
| 53 new ColorFilter(const Color.fromARGB(128, 0, 0, 255), |
| 54 TransferMode.srcInMode)); |
| 51 }) | 55 }) |
| 52 ..addLayerOnTop( | 56 ..addLayerOnTop( |
| 53 new DrawLooperLayerInfo()..setOffset(75.0, 75.0)..setColorMode(1), | 57 new DrawLooperLayerInfo() |
| 58 ..setOffset(const Point(75.0, 75.0)) |
| 59 ..setColorMode(TransferMode.srcMode), |
| 54 (Paint layerPaint) { | 60 (Paint layerPaint) { |
| 55 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); | 61 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); |
| 56 }) | 62 }) |
| 57 ..addLayerOnTop( | 63 ..addLayerOnTop( |
| 58 new DrawLooperLayerInfo()..setOffset(225.0, 75.0), | 64 new DrawLooperLayerInfo()..setOffset(const Point(225.0, 75.0)), |
| 59 (Paint layerPaint) { | 65 (Paint layerPaint) { |
| 60 // Since this layer uses a DST color mode, this has no effect. | 66 // Since this layer uses a DST color mode, this has no effect. |
| 61 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); | 67 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); |
| 62 }); | 68 }); |
| 63 paint.setDrawLooper(builder.build()); | 69 paint.setDrawLooper(builder.build()); |
| 64 context.drawCircle(0.0, 0.0, radius, paint); | 70 context.drawCircle(0.0, 0.0, radius, paint); |
| 65 | 71 |
| 66 context.commit(); | 72 context.commit(); |
| 67 }); | 73 }); |
| 68 } | 74 } |
| 69 </script> | 75 </script> |
| 70 </sky> | 76 </sky> |
| OLD | NEW |