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

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

Issue 1162843003: Add a MaskFilter interface to dart:sky to handle blur. (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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ..addLayerOnTop( 45 ..addLayerOnTop(
46 new DrawLooperLayerInfo() 46 new DrawLooperLayerInfo()
47 ..setOffset(const Point(150.0, 0.0)) 47 ..setOffset(const Point(150.0, 0.0))
48 ..setColorMode(TransferMode.srcMode) 48 ..setColorMode(TransferMode.srcMode)
49 ..setPaintBits(-1), 49 ..setPaintBits(-1),
50 (Paint layerPaint) { 50 (Paint layerPaint) {
51 layerPaint.color = const Color.fromARGB(128, 255, 255, 0); 51 layerPaint.color = const Color.fromARGB(128, 255, 255, 0);
52 layerPaint.setColorFilter( 52 layerPaint.setColorFilter(
53 new ColorFilter(const Color.fromARGB(128, 0, 0, 255), 53 new ColorFilter(const Color.fromARGB(128, 0, 0, 255),
54 TransferMode.srcInMode)); 54 TransferMode.srcInMode));
55 layerPaint.setMaskFilter(
56 new MaskFilter.Blur(BlurStyle.normal, 3.0, highQuality: true));
55 }) 57 })
56 ..addLayerOnTop( 58 ..addLayerOnTop(
57 new DrawLooperLayerInfo() 59 new DrawLooperLayerInfo()
58 ..setOffset(const Point(75.0, 75.0)) 60 ..setOffset(const Point(75.0, 75.0))
59 ..setColorMode(TransferMode.srcMode), 61 ..setColorMode(TransferMode.srcMode),
60 (Paint layerPaint) { 62 (Paint layerPaint) {
61 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); 63 layerPaint.color = const Color.fromARGB(128, 255, 0, 0);
62 }) 64 })
63 ..addLayerOnTop( 65 ..addLayerOnTop(
64 new DrawLooperLayerInfo()..setOffset(const Point(225.0, 75.0)), 66 new DrawLooperLayerInfo()..setOffset(const Point(225.0, 75.0)),
65 (Paint layerPaint) { 67 (Paint layerPaint) {
66 // Since this layer uses a DST color mode, this has no effect. 68 // Since this layer uses a DST color mode, this has no effect.
67 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); 69 layerPaint.color = const Color.fromARGB(128, 255, 0, 0);
68 }); 70 });
69 paint.setDrawLooper(builder.build()); 71 paint.setDrawLooper(builder.build());
70 context.drawCircle(0.0, 0.0, radius, paint); 72 context.drawCircle(0.0, 0.0, radius, paint);
71 73
72 context.commit(); 74 context.commit();
73 }); 75 });
74 } 76 }
75 </script> 77 </script>
76 </sky> 78 </sky>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698