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:
@@ -15,9 +15,9 @@ class StarField extends NodeWithSize {
|
||||
Size _paddedSize = Size.zero;
|
||||
|
||||
Paint _paint = new Paint()
|
||||
..setFilterQuality(sky.FilterQuality.low)
|
||||
..filterQuality = sky.FilterQuality.low
|
||||
..isAntiAlias = false
|
||||
..setTransferMode(sky.TransferMode.plus);
|
||||
..transferMode = sky.TransferMode.plus;
|
||||
|
||||
StarField(this._spriteSheet, this._numStars, [this._autoScroll = false]) : super(Size.zero) {
|
||||
_image = _spriteSheet.image;
|
||||
|
||||
@@ -75,7 +75,9 @@ class TestDrawAtlas extends NodeWithSize {
|
||||
colors,
|
||||
TransferMode.src,
|
||||
null,
|
||||
new Paint()..setFilterQuality(FilterQuality.low)..isAntiAlias=false
|
||||
new Paint()
|
||||
..filterQuality = FilterQuality.low
|
||||
..isAntiAlias = false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ class TestPerformanceAtlas extends PerformanceTest {
|
||||
double rotation = 0.0;
|
||||
List<Rect> rects = [];
|
||||
Paint cachedPaint = new Paint()
|
||||
..setFilterQuality(sky.FilterQuality.low)
|
||||
..filterQuality = sky.FilterQuality.low
|
||||
..isAntiAlias = false;
|
||||
|
||||
TestPerformanceAtlas() {
|
||||
@@ -262,7 +262,7 @@ class TestPerformanceAtlas2 extends PerformanceTest {
|
||||
double rotation = 0.0;
|
||||
List<Rect> rects = [];
|
||||
Paint cachedPaint = new Paint()
|
||||
..setFilterQuality(sky.FilterQuality.low)
|
||||
..filterQuality = sky.FilterQuality.low
|
||||
..isAntiAlias = false;
|
||||
|
||||
TestPerformanceAtlas2() {
|
||||
|
||||
@@ -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