[flutter] Make texture atlas page filter quality configurable, see #2362

This commit is contained in:
Mario Zechner 2023-12-11 14:19:35 +01:00
parent e023a8ae96
commit 49f3e6c542
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,6 @@
# 4.1.12
# FilterQuality for texture atlas pages is now set to medium. It is configurable via `Atlas.filterQuality`. See https://github.com/EsotericSoftware/spine-runtimes/issues/2362
# 4.1.11 # 4.1.11
# Fixed clipping bug, see https://github.com/EsotericSoftware/spine-runtimes/issues/2431 # Fixed clipping bug, see https://github.com/EsotericSoftware/spine-runtimes/issues/2431

View File

@ -101,6 +101,7 @@ class Vec2 {
/// Use the static methods [fromAsset], [fromFile], and [fromHttp] to load an atlas. Call [dispose] /// Use the static methods [fromAsset], [fromFile], and [fromHttp] to load an atlas. Call [dispose]
/// when the atlas is no longer in use to release its resources. /// when the atlas is no longer in use to release its resources.
class Atlas { class Atlas {
static FilterQuality filterQuality = FilterQuality.medium;
final spine_atlas _atlas; final spine_atlas _atlas;
final List<Image> atlasPages; final List<Image> atlasPages;
final List<Map<BlendMode, Paint>> atlasPagePaints; final List<Map<BlendMode, Paint>> atlasPagePaints;
@ -138,7 +139,7 @@ class Atlas {
paints[blendMode] = Paint() paints[blendMode] = Paint()
..shader = ImageShader(image, TileMode.clamp, TileMode.clamp, Matrix4 ..shader = ImageShader(image, TileMode.clamp, TileMode.clamp, Matrix4
.identity() .identity()
.storage, filterQuality: FilterQuality.high) .storage, filterQuality: Atlas.filterQuality)
..isAntiAlias = true ..isAntiAlias = true
..blendMode = blendMode.canvasBlendMode; ..blendMode = blendMode.canvasBlendMode;
} }