Remove use of some deprecated functions on sky.Paint
We now expose idiomatic setters for these properties. Eventually we'll remove the setter functions.
This commit is contained in:
@@ -53,28 +53,28 @@ sky.Picture paint(sky.Rect paintBounds) {
|
||||
..setPaintBits(sky.PaintBits.all),
|
||||
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)))
|
||||
..colorFilter = new sky.ColorFilter.mode(
|
||||
const sky.Color.fromARGB(128, 0, 0, 255), sky.TransferMode.srcIn)
|
||||
..maskFilter = 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),
|
||||
new sky.Paint()
|
||||
..setShader(new sky.Gradient.radial(
|
||||
..shader = 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))
|
||||
null, sky.TileMode.mirror)
|
||||
// Since we're don't set sky.PaintBits.maskFilter, this has no effect.
|
||||
..setMaskFilter(new sky.MaskFilter.blur(
|
||||
sky.BlurStyle.normal, 50.0, highQuality: true)))
|
||||
..maskFilter = new sky.MaskFilter.blur(
|
||||
sky.BlurStyle.normal, 50.0, highQuality: true))
|
||||
..addLayerOnTop(
|
||||
new sky.DrawLooperLayerInfo()..setOffset(const sky.Offset(225.0, 75.0)),
|
||||
// Since this layer uses a DST color mode, this has no effect.
|
||||
new sky.Paint()..color = const sky.Color.fromARGB(128, 255, 0, 0));
|
||||
paint.setDrawLooper(builder.build());
|
||||
paint.drawLooper = builder.build();
|
||||
canvas.drawCircle(sky.Point.origin, radius, paint);
|
||||
|
||||
return recorder.endRecording();
|
||||
|
||||
@@ -23,12 +23,11 @@ sky.Picture paint(sky.Rect paintBounds) {
|
||||
..setColorMode(sky.TransferMode.src),
|
||||
new sky.Paint()
|
||||
..color = const sky.Color.fromARGB(128, 55, 55, 55)
|
||||
..setMaskFilter(
|
||||
new sky.MaskFilter.blur(sky.BlurStyle.normal, 5.0))
|
||||
..maskFilter = new sky.MaskFilter.blur(sky.BlurStyle.normal, 5.0)
|
||||
)
|
||||
// Main layer.
|
||||
..addLayerOnTop(new sky.DrawLooperLayerInfo(), new sky.Paint());
|
||||
paint.setDrawLooper(builder.build());
|
||||
paint.drawLooper = builder.build();
|
||||
|
||||
canvas.drawPaint(
|
||||
new sky.Paint()..color = const sky.Color.fromARGB(255, 255, 255, 255));
|
||||
|
||||
Reference in New Issue
Block a user