mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
Optimize drawing performance of packed sprites
- Restored some code from an earlier version (e501940f03
), since it works faster for packed sprites with a small number of triangles
This commit is contained in:
parent
11b9ca37da
commit
b0bf5e0cfd
@ -149,6 +149,13 @@ namespace AssetStudio
|
|||||||
AlphaCompositionMode = PixelAlphaCompositionMode.DestOut
|
AlphaCompositionMode = PixelAlphaCompositionMode.DestOut
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (triangles.Length < 1024)
|
||||||
|
{
|
||||||
|
var rectP = new RectangularPolygon(0, 0, rect.Width, rect.Height);
|
||||||
|
spriteImage.Mutate(x => x.Fill(options, SixLabors.ImageSharp.Color.Red, rectP.Clip(path)));
|
||||||
|
spriteImage.Mutate(x => x.Flip(FlipMode.Vertical));
|
||||||
|
return spriteImage;
|
||||||
|
}
|
||||||
using (var mask = new Image<Bgra32>(rect.Width, rect.Height, SixLabors.ImageSharp.Color.Black))
|
using (var mask = new Image<Bgra32>(rect.Width, rect.Height, SixLabors.ImageSharp.Color.Black))
|
||||||
{
|
{
|
||||||
mask.Mutate(x => x.Fill(options, SixLabors.ImageSharp.Color.Red, path));
|
mask.Mutate(x => x.Fill(options, SixLabors.ImageSharp.Color.Red, path));
|
||||||
|
Loading…
Reference in New Issue
Block a user