From 8f9781da15bae4b72cc36de973c1422474ba614f Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Wed, 15 Dec 2021 05:56:17 +0200 Subject: [PATCH] Update to Maui Preview 11 (#1890) --- VERSIONS.txt | 2 +- .../Basic/Maui/SkiaSharpSample/SkiaSharpSample.csproj | 11 ++++++++--- .../WinUI/Msix/SkiaSharpSample/SkiaSharpSample.csproj | 2 +- .../SkiaSharpSample.Package.wapproj | 2 +- .../WapProj/SkiaSharpSample/SkiaSharpSample.csproj | 2 +- samples/Directory.Build.targets | 7 ------- scripts/azure-pipelines.yml | 2 +- .../SKCanvasViewRendererBase.cs | 1 + .../SKCanvasView/SKCanvasViewHandler.Android.cs | 1 + .../SkiaSharp.Views.WinUI.csproj | 2 +- .../SkiaSharp.Views.Apple/SKCGSurfaceFactory.cs | 1 + .../SkiaSharp.Views.AppleiOS/iOSExtensions.cs | 5 +++-- .../SkiaSharp.Views.Mac/MacExtensions.cs | 8 +++++--- 13 files changed, 25 insertions(+), 21 deletions(-) diff --git a/VERSIONS.txt b/VERSIONS.txt index aea412ee21..cf5e28f9f4 100644 --- a/VERSIONS.txt +++ b/VERSIONS.txt @@ -22,7 +22,7 @@ System.IO.UnmanagedMemoryStream release 4.3.0 System.Drawing.Common release 4.5.1 SharpVk release 0.4.2 Uno.UI release 3.7.6 -Microsoft.WindowsAppSDK release 1.0.0-preview3 +Microsoft.WindowsAppSDK release 1.0.0 Microsoft.Maui.Graphics release 6.0.101-preview.9.512 Microsoft.Windows.SDK.NET.Ref release 10.0.18362.18 Microsoft.AspNetCore.Components.Web release 6.0.0 diff --git a/samples/Basic/Maui/SkiaSharpSample/SkiaSharpSample.csproj b/samples/Basic/Maui/SkiaSharpSample/SkiaSharpSample.csproj index 0f9be394c4..e5ca95ef6a 100644 --- a/samples/Basic/Maui/SkiaSharpSample/SkiaSharpSample.csproj +++ b/samples/Basic/Maui/SkiaSharpSample/SkiaSharpSample.csproj @@ -26,14 +26,19 @@ + - - + + @@ -45,7 +50,7 @@ WinExe - win-x64 + win10-x64 diff --git a/samples/Basic/WinUI/Msix/SkiaSharpSample/SkiaSharpSample.csproj b/samples/Basic/WinUI/Msix/SkiaSharpSample/SkiaSharpSample.csproj index ccf40de77b..2e3acb3e4a 100644 --- a/samples/Basic/WinUI/Msix/SkiaSharpSample/SkiaSharpSample.csproj +++ b/samples/Basic/WinUI/Msix/SkiaSharpSample/SkiaSharpSample.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/Basic/WinUI/WapProj/SkiaSharpSample.Package/SkiaSharpSample.Package.wapproj b/samples/Basic/WinUI/WapProj/SkiaSharpSample.Package/SkiaSharpSample.Package.wapproj index 386358a972..043a2a87b4 100644 --- a/samples/Basic/WinUI/WapProj/SkiaSharpSample.Package/SkiaSharpSample.Package.wapproj +++ b/samples/Basic/WinUI/WapProj/SkiaSharpSample.Package/SkiaSharpSample.Package.wapproj @@ -64,7 +64,7 @@ - + build diff --git a/samples/Basic/WinUI/WapProj/SkiaSharpSample/SkiaSharpSample.csproj b/samples/Basic/WinUI/WapProj/SkiaSharpSample/SkiaSharpSample.csproj index 961d76090c..164bfe84e1 100644 --- a/samples/Basic/WinUI/WapProj/SkiaSharpSample/SkiaSharpSample.csproj +++ b/samples/Basic/WinUI/WapProj/SkiaSharpSample/SkiaSharpSample.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/Directory.Build.targets b/samples/Directory.Build.targets index f6b90bd6c0..4de98b5c73 100644 --- a/samples/Directory.Build.targets +++ b/samples/Directory.Build.targets @@ -1,10 +1,3 @@ - - - - - - - \ No newline at end of file diff --git a/scripts/azure-pipelines.yml b/scripts/azure-pipelines.yml index e0890c8358..ef9fcf7f19 100644 --- a/scripts/azure-pipelines.yml +++ b/scripts/azure-pipelines.yml @@ -32,7 +32,7 @@ variables: DOTNET_VERSION_PREVIOUS: 3.1.413 DOTNET_VERSION: 5.0.401 DOTNET_VERSION_PREVIEW: 6.0.100 - DOTNET_WORKLOAD_SOURCE: 'https://aka.ms/dotnet/maui/6.0.101/preview.10.json' + DOTNET_WORKLOAD_SOURCE: 'https://aka.ms/dotnet/maui/6.0.101/preview.11.json' VS_VERSION_PREVIEW: 17/release CONFIGURATION: 'Release' VM_IMAGE_WINDOWS: windows-2022 diff --git a/source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Native.Shared/SKCanvasViewRendererBase.cs b/source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Native.Shared/SKCanvasViewRendererBase.cs index cd29c8eb7a..2fa8ec5a11 100644 --- a/source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Native.Shared/SKCanvasViewRendererBase.cs +++ b/source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Native.Shared/SKCanvasViewRendererBase.cs @@ -6,6 +6,7 @@ using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.Platform; +using Microsoft.Maui.Platform; using SkiaSharp.Views.Maui.Platform; using SKFormsView = SkiaSharp.Views.Maui.Controls.SKCanvasView; diff --git a/source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers/SKCanvasView/SKCanvasViewHandler.Android.cs b/source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers/SKCanvasView/SKCanvasViewHandler.Android.cs index f1433a9422..9e0b18ef31 100644 --- a/source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers/SKCanvasView/SKCanvasViewHandler.Android.cs +++ b/source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers/SKCanvasView/SKCanvasViewHandler.Android.cs @@ -1,5 +1,6 @@ using Microsoft.Maui; using Microsoft.Maui.Handlers; +using Microsoft.Maui.Platform; using SkiaSharp.Views.Android; using SkiaSharp.Views.Maui.Platform; diff --git a/source/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI.csproj b/source/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI.csproj index 4eb5cd4f50..f447b73e1e 100644 --- a/source/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI.csproj +++ b/source/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI.csproj @@ -7,7 +7,7 @@ SkiaSharp.Views.WinUI - + diff --git a/source/SkiaSharp.Views/SkiaSharp.Views.Apple/SKCGSurfaceFactory.cs b/source/SkiaSharp.Views/SkiaSharp.Views.Apple/SKCGSurfaceFactory.cs index ae3bcde693..774ff58fff 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views.Apple/SKCGSurfaceFactory.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views.Apple/SKCGSurfaceFactory.cs @@ -2,6 +2,7 @@ using System.Runtime.InteropServices; using CoreGraphics; using Foundation; +using ObjCRuntime; #if __TVOS__ namespace SkiaSharp.Views.tvOS diff --git a/source/SkiaSharp.Views/SkiaSharp.Views.AppleiOS/iOSExtensions.cs b/source/SkiaSharp.Views/SkiaSharp.Views.AppleiOS/iOSExtensions.cs index c0ceaa25ca..6699bfb5ae 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views.AppleiOS/iOSExtensions.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views.AppleiOS/iOSExtensions.cs @@ -1,5 +1,6 @@ using System; using UIKit; +using ObjCRuntime; #if __TVOS__ namespace SkiaSharp.Views.tvOS @@ -15,14 +16,14 @@ public static class iOSExtensions public static SKColor ToSKColor(this UIColor color) { - System.nfloat r, g, b, a; + nfloat r, g, b, a; color.GetRGBA(out r, out g, out b, out a); return new SKColor((byte)(r * 255), (byte)(g * 255), (byte)(b * 255), (byte)(a * 255)); } public static SKColorF ToSKColorF(this UIColor color) { - System.nfloat r, g, b, a; + nfloat r, g, b, a; color.GetRGBA(out r, out g, out b, out a); return new SKColorF((float)r, (float)g, (float)b, (float)a); } diff --git a/source/SkiaSharp.Views/SkiaSharp.Views.Mac/MacExtensions.cs b/source/SkiaSharp.Views/SkiaSharp.Views.Mac/MacExtensions.cs index 581dbe0075..5a93f1e2c6 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views.Mac/MacExtensions.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views.Mac/MacExtensions.cs @@ -1,5 +1,7 @@ -using AppKit; +using System; +using AppKit; using CoreGraphics; +using ObjCRuntime; namespace SkiaSharp.Views.Mac { @@ -9,14 +11,14 @@ public static class MacExtensions public static SKColor ToSKColor(this NSColor color) { - System.nfloat r, g, b, a; + nfloat r, g, b, a; color.GetRgba(out r, out g, out b, out a); return new SKColor((byte)(r * 255), (byte)(g * 255), (byte)(b * 255), (byte)(a * 255)); } public static SKColorF ToSKColorF(this NSColor color) { - System.nfloat r, g, b, a; + nfloat r, g, b, a; color.GetRgba(out r, out g, out b, out a); return new SKColorF((float)r, (float)g, (float)b, (float)a); }