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

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

Issue 1175403002: Expose and use constants for DrawLooperLayerInfo.setPaintBits to dart. (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
« no previous file with comments | « sky/engine/core/painting/DrawLooperLayerInfo.idl ('k') | sky/examples/raw/shadow.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 context.drawCircle(0.0, 0.0, radius, paint); 44 context.drawCircle(0.0, 0.0, radius, paint);
45 45
46 context.restore(); 46 context.restore();
47 47
48 context.translate(0.0, 50.0); 48 context.translate(0.0, 50.0);
49 var builder = new LayerDrawLooperBuilder() 49 var builder = new LayerDrawLooperBuilder()
50 ..addLayerOnTop( 50 ..addLayerOnTop(
51 new DrawLooperLayerInfo() 51 new DrawLooperLayerInfo()
52 ..setOffset(const Point(150.0, 0.0)) 52 ..setOffset(const Point(150.0, 0.0))
53 ..setColorMode(TransferMode.srcMode) 53 ..setColorMode(TransferMode.srcMode)
54 ..setPaintBits(-1), 54 ..setPaintBits(PaintBits.all),
55 (Paint layerPaint) { 55 (Paint layerPaint) {
56 layerPaint.color = const Color.fromARGB(128, 255, 255, 0); 56 layerPaint.color = const Color.fromARGB(128, 255, 255, 0);
57 layerPaint.setColorFilter( 57 layerPaint.setColorFilter(
58 new ColorFilter.mode(const Color.fromARGB(128, 0, 0, 255), 58 new ColorFilter.mode(const Color.fromARGB(128, 0, 0, 255),
59 TransferMode.srcInMode)); 59 TransferMode.srcInMode));
60 layerPaint.setMaskFilter( 60 layerPaint.setMaskFilter(
61 new MaskFilter.blur(BlurStyle.normal, 3.0, highQuality: true)); 61 new MaskFilter.blur(BlurStyle.normal, 3.0, highQuality: true));
62 }) 62 })
63 ..addLayerOnTop( 63 ..addLayerOnTop(
64 new DrawLooperLayerInfo() 64 new DrawLooperLayerInfo()
65 ..setOffset(const Point(75.0, 75.0)) 65 ..setOffset(const Point(75.0, 75.0))
66 ..setColorMode(TransferMode.srcMode) 66 ..setColorMode(TransferMode.srcMode)
67 ..setPaintBits(-1), 67 ..setPaintBits(PaintBits.shader),
68 (Paint layerPaint) { 68 (Paint layerPaint) {
69 Gradient redYellow = new Gradient.radial( 69 Gradient redYellow = new Gradient.radial(
70 new Point(0.0, 0.0), radius/3.0, 70 new Point(0.0, 0.0), radius/3.0,
71 [const Color(0xFFFFFF00), const Color(0xFFFF0000)], 71 [const Color(0xFFFFFF00), const Color(0xFFFF0000)],
72 null, TileMode.mirror); 72 null, TileMode.mirror);
73 layerPaint.setShader(redYellow); 73 layerPaint.setShader(redYellow);
74 // Since we're don't set PaintBits.maskFilter, this has no effect.
75 layerPaint.setMaskFilter(
76 new MaskFilter.blur(BlurStyle.normal, 50.0, highQuality: true));
74 }) 77 })
75 ..addLayerOnTop( 78 ..addLayerOnTop(
76 new DrawLooperLayerInfo()..setOffset(const Point(225.0, 75.0)), 79 new DrawLooperLayerInfo()..setOffset(const Point(225.0, 75.0)),
77 (Paint layerPaint) { 80 (Paint layerPaint) {
78 // Since this layer uses a DST color mode, this has no effect. 81 // Since this layer uses a DST color mode, this has no effect.
79 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); 82 layerPaint.color = const Color.fromARGB(128, 255, 0, 0);
80 }); 83 });
81 paint.setDrawLooper(builder.build()); 84 paint.setDrawLooper(builder.build());
82 context.drawCircle(0.0, 0.0, radius, paint); 85 context.drawCircle(0.0, 0.0, radius, paint);
83 86
84 context.commit(); 87 context.commit();
85 }); 88 });
86 } 89 }
87 </script> 90 </script>
88 </sky> 91 </sky>
OLDNEW
« no previous file with comments | « sky/engine/core/painting/DrawLooperLayerInfo.idl ('k') | sky/examples/raw/shadow.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698