diff --git a/binding/SkiaSharp/GRBackendRenderTarget.cs b/binding/SkiaSharp/GRBackendRenderTarget.cs index 326575ecca..c4609a4467 100644 --- a/binding/SkiaSharp/GRBackendRenderTarget.cs +++ b/binding/SkiaSharp/GRBackendRenderTarget.cs @@ -30,7 +30,7 @@ public GRBackendRenderTarget (int width, int height, GRVkImageInfo vkImageInfo) CreateVulkan (width, height, vkImageInfo); } -#if __IOS__ || __MACOS__ +#if __IOS__ || __MACOS__ || __TVOS__ [Obsolete ("Use GRBackendRenderTarget(int width, int height, GRMtlTextureInfo mtlInfo) instead.")] public GRBackendRenderTarget (int width, int height, int sampleCount, GRMtlTextureInfo mtlInfo) diff --git a/binding/SkiaSharp/GRDefinitions.cs b/binding/SkiaSharp/GRDefinitions.cs index ed6c3facb0..4a5ebbd5d2 100644 --- a/binding/SkiaSharp/GRDefinitions.cs +++ b/binding/SkiaSharp/GRDefinitions.cs @@ -87,13 +87,13 @@ public IntPtr TextureHandle { readonly get => _textureHandle; set { _textureHandle = value; -#if __IOS__ || __MACOS__ +#if __IOS__ || __MACOS__ || __TVOS__ _texture = null; #endif } } -#if __IOS__ || __MACOS__ +#if __IOS__ || __MACOS__ || __TVOS__ private Metal.IMTLTexture _texture; public GRMtlTextureInfo (Metal.IMTLTexture texture) { diff --git a/binding/SkiaSharp/GRMtlBackendContext.cs b/binding/SkiaSharp/GRMtlBackendContext.cs index 9c2aa28112..3669a29c18 100644 --- a/binding/SkiaSharp/GRMtlBackendContext.cs +++ b/binding/SkiaSharp/GRMtlBackendContext.cs @@ -1,7 +1,7 @@ #nullable disable using System; -#if __IOS__ || __MACOS__ +#if __IOS__ || __MACOS__ || __TVOS__ using Metal; #endif @@ -25,13 +25,13 @@ public IntPtr QueueHandle { get => _queueHandle; set { _queueHandle = value; -#if __IOS__ || __MACOS__ +#if __IOS__ || __MACOS__ || __TVOS__ _queue = null; #endif } } -#if __IOS__ || __MACOS__ +#if __IOS__ || __MACOS__ || __TVOS__ private IMTLDevice _device; private IMTLCommandQueue _queue; diff --git a/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Apple/SKMetalView.cs b/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Apple/SKMetalView.cs index fe0dabc5b9..0a8d5f7b86 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Apple/SKMetalView.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Apple/SKMetalView.cs @@ -1,4 +1,4 @@ -#if __IOS__ || __MACOS__ +#if __IOS__ || __MACOS__ || __TVOS__ using System; using System.ComponentModel; using System.Diagnostics; @@ -11,6 +11,8 @@ namespace SkiaSharp.Views.iOS #elif __MACOS__ namespace SkiaSharp.Views.Mac +#elif __TVOS__ +namespace SkiaSharp.Views.tvOS #endif { [Register(nameof(SKMetalView))] @@ -104,7 +106,7 @@ void IMTKViewDelegate.DrawableSizeWillChange(MTKView view, CGSize size) CanvasSize = size.ToSKSize(); if (Paused && EnableSetNeedsDisplay) -#if __IOS__ +#if __IOS__ || __TVOS__ SetNeedsDisplay(); #elif __MACOS__ NeedsDisplay = true; diff --git a/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Apple/SKPaintMetalSurfaceEventArgs.cs b/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Apple/SKPaintMetalSurfaceEventArgs.cs index fa840facd4..8dc85f6357 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Apple/SKPaintMetalSurfaceEventArgs.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Apple/SKPaintMetalSurfaceEventArgs.cs @@ -1,10 +1,12 @@ -#if __IOS__ || __MACOS__ +#if __IOS__ || __MACOS__ || __TVOS__ using System; #if __IOS__ namespace SkiaSharp.Views.iOS #elif __MACOS__ namespace SkiaSharp.Views.Mac +#elif __TVOS__ +namespace SkiaSharp.Views.tvOS #endif { public class SKPaintMetalSurfaceEventArgs : EventArgs