Reuse paint objects.
This commit is contained in:
parent
d983d65d8a
commit
2569793ff0
|
@ -22,18 +22,15 @@ namespace Jellyfin.Drawing.Skia
|
|||
{
|
||||
var x = imageSize.Width - OffsetFromTopRightCorner;
|
||||
|
||||
using (var paint = new SKPaint())
|
||||
using var paint = new SKPaint
|
||||
{
|
||||
paint.Color = SKColor.Parse("#CC00A4DC");
|
||||
paint.Style = SKPaintStyle.Fill;
|
||||
Color = SKColor.Parse("#CC00A4DC"),
|
||||
Style = SKPaintStyle.Fill
|
||||
};
|
||||
|
||||
canvas.DrawCircle(x, OffsetFromTopRightCorner, 20, paint);
|
||||
}
|
||||
|
||||
using (var paint = new SKPaint())
|
||||
{
|
||||
paint.Color = new SKColor(255, 255, 255, 255);
|
||||
paint.Style = SKPaintStyle.Fill;
|
||||
|
||||
paint.TextSize = 30;
|
||||
paint.IsAntialias = true;
|
||||
|
||||
|
@ -49,4 +46,3 @@ namespace Jellyfin.Drawing.Skia
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,18 +28,15 @@ namespace Jellyfin.Drawing.Skia
|
|||
var x = imageSize.Width - OffsetFromTopRightCorner;
|
||||
var text = count.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
using (var paint = new SKPaint())
|
||||
using var paint = new SKPaint
|
||||
{
|
||||
paint.Color = SKColor.Parse("#CC00A4DC");
|
||||
paint.Style = SKPaintStyle.Fill;
|
||||
Color = SKColor.Parse("#CC00A4DC"),
|
||||
Style = SKPaintStyle.Fill
|
||||
};
|
||||
|
||||
canvas.DrawCircle(x, OffsetFromTopRightCorner, 20, paint);
|
||||
}
|
||||
|
||||
using (var paint = new SKPaint())
|
||||
{
|
||||
paint.Color = new SKColor(255, 255, 255, 255);
|
||||
paint.Style = SKPaintStyle.Fill;
|
||||
|
||||
paint.TextSize = 24;
|
||||
paint.IsAntialias = true;
|
||||
|
||||
|
@ -65,4 +62,3 @@ namespace Jellyfin.Drawing.Skia
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user