mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
20 lines
477 B
Dart
20 lines
477 B
Dart
part of sprites;
|
|
|
|
class Layer extends Node with SpritePaint {
|
|
Paint _cachedPaint = new Paint()
|
|
..setFilterQuality(FilterQuality.low)
|
|
..isAntiAlias = false;
|
|
|
|
void _prePaint(PaintingCanvas canvas, Matrix4 matrix) {
|
|
super._prePaint(canvas, matrix);
|
|
|
|
_updatePaint(_cachedPaint);
|
|
canvas.saveLayer(null, _cachedPaint);
|
|
}
|
|
|
|
void _postPaint(PaintingCanvas canvas, Matrix4 totalMatrix) {
|
|
canvas.restore();
|
|
super._postPaint(canvas, totalMatrix);
|
|
}
|
|
}
|