コード例 #1
0
        public static void Initialize()
        {
            var renderInterface = new PlatformRenderInterface();

            AvaloniaLocator.CurrentMutable
            .Bind <IPlatformRenderInterface>().ToConstant(renderInterface);
        }
コード例 #2
0
        public static void Initialize(SkiaOptions options)
        {
            var customGpu       = options.CustomGpuFactory?.Invoke();
            var renderInterface = new PlatformRenderInterface(customGpu);

            AvaloniaLocator.CurrentMutable
            .Bind <IPlatformRenderInterface>().ToConstant(renderInterface);
        }
コード例 #3
0
        public static void Initialize(SkiaOptions options)
        {
            var customGpu       = options.CustomGpuFactory?.Invoke();
            var renderInterface = new PlatformRenderInterface(customGpu, options.MaxGpuResourceSizeBytes);

            AvaloniaLocator.CurrentMutable
            .Bind <IPlatformRenderInterface>().ToConstant(renderInterface)
            .Bind <IFontManagerImpl>().ToConstant(new FontManagerImpl())
            .Bind <ITextShaperImpl>().ToConstant(new TextShaperImpl());
        }