Commit c25beb84 authored by Adam Barth's avatar Adam Barth

Merge pull request #551 from abarth/rm_weak_paint

Remove weak handle from sky.Paint
parents 7d3a6c4a 375c2477
......@@ -55,34 +55,29 @@ void beginFrame(double timeStamp) {
..setOffset(const sky.Offset(150.0, 0.0))
..setColorMode(sky.TransferMode.src)
..setPaintBits(sky.PaintBits.all),
(sky.Paint layerPaint) {
layerPaint.color = const sky.Color.fromARGB(128, 255, 255, 0);
layerPaint.setColorFilter(new sky.ColorFilter.mode(
const sky.Color.fromARGB(128, 0, 0, 255), sky.TransferMode.srcIn));
layerPaint.setMaskFilter(new sky.MaskFilter.blur(
sky.BlurStyle.normal, 3.0, highQuality: true));
})
new sky.Paint()
..color = const sky.Color.fromARGB(128, 255, 255, 0)
..setColorFilter(new sky.ColorFilter.mode(
const sky.Color.fromARGB(128, 0, 0, 255), sky.TransferMode.srcIn))
..setMaskFilter(new sky.MaskFilter.blur(
sky.BlurStyle.normal, 3.0, highQuality: true)))
..addLayerOnTop(
new sky.DrawLooperLayerInfo()
..setOffset(const sky.Offset(75.0, 75.0))
..setColorMode(sky.TransferMode.src)
..setPaintBits(sky.PaintBits.shader),
(sky.Paint layerPaint) {
sky.Gradient redYellow = new sky.Gradient.radial(
new sky.Paint()
..setShader(new sky.Gradient.radial(
new sky.Point(0.0, 0.0), radius/3.0,
[const sky.Color(0xFFFFFF00), const sky.Color(0xFFFF0000)],
null, sky.TileMode.mirror);
layerPaint.setShader(redYellow);
null, sky.TileMode.mirror))
// Since we're don't set sky.PaintBits.maskFilter, this has no effect.
layerPaint.setMaskFilter(new sky.MaskFilter.blur(
sky.BlurStyle.normal, 50.0, highQuality: true));
})
..setMaskFilter(new sky.MaskFilter.blur(
sky.BlurStyle.normal, 50.0, highQuality: true)))
..addLayerOnTop(
new sky.DrawLooperLayerInfo()..setOffset(const sky.Offset(225.0, 75.0)),
(sky.Paint layerPaint) {
// Since this layer uses a DST color mode, this has no effect.
layerPaint.color = const sky.Color.fromARGB(128, 255, 0, 0);
});
new sky.Paint()..color = const sky.Color.fromARGB(128, 255, 0, 0));
paint.setDrawLooper(builder.build());
canvas.drawCircle(sky.Point.origin, radius, paint);
......
......@@ -27,7 +27,7 @@ void beginFrame(double timeStamp) {
new MaskFilter.blur(BlurStyle.normal, 5.0, highQuality: true));
})
// Main layer.
..addLayerOnTop(new DrawLooperLayerInfo(), (Paint) {});
..addLayerOnTop(new DrawLooperLayerInfo(), new Paint());
paint.setDrawLooper(builder.build());
canvas.drawPaint(
......
......@@ -15,15 +15,13 @@ class ShadowDrawLooperBuilder {
..setPaintBits(sky.PaintBits.all)
..setOffset(offset)
..setColorMode(sky.TransferMode.src),
(sky.Paint layerPaint) {
layerPaint.color = color;
layerPaint.setMaskFilter(
new sky.MaskFilter.blur(sky.BlurStyle.normal, blur));
});
new sky.Paint()
..color = color
..setMaskFilter(new sky.MaskFilter.blur(sky.BlurStyle.normal, blur)));
}
sky.DrawLooper build() {
builder_.addLayerOnTop(new sky.DrawLooperLayerInfo(), (_) {});
builder_.addLayerOnTop(new sky.DrawLooperLayerInfo(), new sky.Paint());
return builder_.build();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment