-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathSkiaPlatform.cs
33 lines (29 loc) · 950 Bytes
/
SkiaPlatform.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using Avalonia.Platform;
namespace Avalonia.Skia
{
/// <summary>
/// Skia platform initializer.
/// </summary>
public static class SkiaPlatform
{
/// <summary>
/// Initialize Skia platform.
/// </summary>
public static void Initialize()
{
Initialize(new SkiaOptions());
}
public static void Initialize(SkiaOptions options)
{
var renderInterface = new PlatformRenderInterface(options.MaxGpuResourceSizeBytes);
AvaloniaLocator.CurrentMutable
.Bind<IPlatformRenderInterface>().ToConstant(renderInterface)
.Bind<IFontManagerImpl>().ToConstant(new FontManagerImpl())
.Bind<ITextShaperImpl>().ToConstant(new TextShaperImpl());
}
/// <summary>
/// Default DPI.
/// </summary>
public static Vector DefaultDpi => new Vector(96.0f, 96.0f);
}
}