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

Unified Diff: sky/examples/raw/shadow.dart

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, 7 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 side-by-side diff with in-line comments
Download patch
« sky/engine/core/painting/MaskFilter.dart ('K') | « sky/examples/raw/painting.sky ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/raw/shadow.dart
diff --git a/sky/examples/raw/shadow.dart b/sky/examples/raw/shadow.dart
index 0b61437fffa862b20a8bb358107d712a0e046cb5..a127cfb2a2bd36c8008d40780051abf209c7a868 100644
--- a/sky/examples/raw/shadow.dart
+++ b/sky/examples/raw/shadow.dart
@@ -10,22 +10,25 @@ void beginFrame(double timeStamp) {
canvas.translate(size + 10.0, size + 10.0);
Paint paint = new Paint();
- paint.setARGB(255, 0, 255, 0);
+ paint.color = const Color.fromARGB(255, 0, 255, 0);
var builder = new LayerDrawLooperBuilder()
// Shadow layer.
..addLayerOnTop(
new DrawLooperLayerInfo()
+ ..setPaintBits(-1)
eseidel 2015/06/02 20:49:45 What does this do?
Matt Perry 2015/06/02 21:03:42 It tells the DrawLooper to use layerPaint's versio
..setOffset(const Point(5.0, 5.0))
..setColorMode(TransferMode.srcInMode),
(Paint layerPaint) {
- layerPaint.setARGB(128, 55, 55, 55);
- // TODO(mpcomplete): add blur filter
+ layerPaint.color = const Color.fromARGB(128, 55, 55, 55);
+ layerPaint.setMaskFilter(
+ new MaskFilter.Blur(BlurStyle.normal, 5.0, highQuality: true));
})
// Main layer.
..addLayerOnTop(new DrawLooperLayerInfo(), (Paint) {});
paint.setDrawLooper(builder.build());
- canvas.drawPaint(new Paint()..setARGB(255, 255, 255, 255));
+ canvas.drawPaint(
+ new Paint()..color = const Color.fromARGB(255, 255, 255, 255));
canvas.drawRect(new Rect.fromLTRB(-size, -size, size, size), paint);
view.picture = canvas.endRecording();
}
« sky/engine/core/painting/MaskFilter.dart ('K') | « sky/examples/raw/painting.sky ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698