From 73e9665bd44dfa03a2ec4c1f9c18f25c4a502222 Mon Sep 17 00:00:00 2001 From: Kunal22shah Date: Thu, 23 Jan 2025 14:33:07 -0500 Subject: [PATCH 01/15] chore: bump skiaSharp ver --- samples/Directory.Packages.props | 8 +- .../Controls/Shadows/ShadowContainer.Paint.cs | 3 +- .../SkiaCompact.skia.cs | 314 ++++++++++++++++++ 3 files changed, 320 insertions(+), 5 deletions(-) create mode 100644 src/Uno.Toolkit.Skia.WinUI/SkiaCompact.skia.cs diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index 51305bf58..59dcd6550 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -17,10 +17,10 @@ - - - - + + + + diff --git a/src/Uno.Toolkit.Skia.WinUI/Controls/Shadows/ShadowContainer.Paint.cs b/src/Uno.Toolkit.Skia.WinUI/Controls/Shadows/ShadowContainer.Paint.cs index 9d9d5e99b..5185b7bf7 100644 --- a/src/Uno.Toolkit.Skia.WinUI/Controls/Shadows/ShadowContainer.Paint.cs +++ b/src/Uno.Toolkit.Skia.WinUI/Controls/Shadows/ShadowContainer.Paint.cs @@ -11,6 +11,7 @@ using Uno.Extensions; using Uno.Logging; using Windows.UI; +using Uno.Toolkit.Skia.WinUI; namespace Uno.Toolkit.UI; @@ -207,7 +208,7 @@ public override void DrawDropShadow(ShadowPaintState state, SKCanvas canvas, SKP paint.Style = SKPaintStyle.Fill; paint.Color = shadow.GetSKColor(); - paint.ImageFilter = SKImageFilter.CreateBlur(blurSigma, blurSigma); + paint.ImageFilter = SkiaCompat.SKImageFilter_CreateBlur(blurSigma, blurSigma); paint.MaskFilter = null; paint.StrokeWidth = 0; diff --git a/src/Uno.Toolkit.Skia.WinUI/SkiaCompact.skia.cs b/src/Uno.Toolkit.Skia.WinUI/SkiaCompact.skia.cs new file mode 100644 index 000000000..edf40d3d7 --- /dev/null +++ b/src/Uno.Toolkit.Skia.WinUI/SkiaCompact.skia.cs @@ -0,0 +1,314 @@ +#nullable enable + +using System; +using System.Runtime.CompilerServices; +using SkiaSharp; +using static SkiaSharp.SKImageFilter; + +namespace Uno.Toolkit.Skia.WinUI; + +internal static class SkiaCompat +{ + private static readonly bool _isSkiaSharp3OrLater = typeof(SKPaint).Assembly.GetName().Version?.Major >= 3; + + internal static SKImageFilter SKImageFilter_CreateBlur(float sigmaX, float sigmaY) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateBlur(sigmaX, sigmaY); + return Legacy(); + } + + return SKImageFilter_CreateBlur(null, sigmaX, sigmaY); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateBlur")] + private static extern SKImageFilter SKImageFilter_CreateBlur(SKImageFilter? _, float sigmaX, float sigmaY); + + + internal static SKImageFilter SKImageFilter_CreateColorFilter(SKColorFilter cf, SKImageFilter? input, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateColorFilter(cf, input, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreateColorFilter(null, cf, input, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateColorFilter")] + private static extern SKImageFilter SKImageFilter_CreateColorFilter(SKImageFilter? _, SKColorFilter cf, SKImageFilter? input, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreateColorFilter(SKColorFilter cf, SKImageFilter? input) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateColorFilter(cf, input); + return Legacy(); + } + + return SKImageFilter_CreateColorFilter(null, cf, input); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateColorFilter")] + private static extern SKImageFilter SKImageFilter_CreateColorFilter(SKImageFilter? _, SKColorFilter cf, SKImageFilter? input); + + internal static SKImageFilter SKImageFilter_CreateOffset(float dx, float dy, SKImageFilter? input, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateOffset(dx, dy, input, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreateOffset(null, dx, dy, input, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateOffset")] + private static extern SKImageFilter SKImageFilter_CreateOffset(SKImageFilter? _, float radiusX, float radiusY, SKImageFilter? input, SKRect cropRect); + + internal static SKRuntimeEffect SKRuntimeEffect_CreateShader(string sksl, out string errors) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKRuntimeEffect Legacy(out string errors) => SKRuntimeEffect.Create(sksl, out errors); + return Legacy(out errors); + } + + return SKRuntimeEffect_CreateShader(null, sksl, out errors); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateShader")] + private static extern SKRuntimeEffect SKRuntimeEffect_CreateShader(SKRuntimeEffect? _, string sksl, out string errors); + + internal static void SKRuntimeEffectChildren_Add_WithNull(SKRuntimeEffectChildren @this, string name) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + void Legacy() => @this.Add(name, null); + Legacy(); + return; + } + + // TODO(Youssef,SkiaSharp3): Find a way to support this... Reflection? + throw new NotSupportedException("CompositionEffectBrush is not supported for SkiaSharp 3."); + } + + internal static SKImageFilter SKImageFilter_CreateBlendMode(SKBlendMode mode, SKImageFilter? background, SKImageFilter? foreground, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateBlendMode(mode, background, foreground, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreateBlendMode(null, mode, background, foreground, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateBlendMode")] + private static extern SKImageFilter SKImageFilter_CreateBlendMode(SKImageFilter? _, SKBlendMode mode, SKImageFilter? background, SKImageFilter? foreground, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreatePaint(SKPaint paint, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreatePaint(paint, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreatePaint(null, paint, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreatePaint")] + private static extern SKImageFilter SKImageFilter_CreatePaint(SKImageFilter? _, SKPaint paint, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreateDropShadow(float dx, float dy, float sigmaX, float sigmaY, SKColor color) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateDropShadow(dx, dy, sigmaX, sigmaY, color); + return Legacy(); + } + + return SKImageFilter_CreateDropShadow(null, dx, dy, sigmaX, sigmaY, color); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateDropShadow")] + private static extern SKImageFilter SKImageFilter_CreateDropShadow(SKImageFilter? _, float dx, float dy, float sigmaX, float sigmaY, SKColor color); + + internal static SKImageFilter SKImageFilter_CreateArithmetic(float k1, float k2, float k3, float k4, bool enforcePMColor, SKImageFilter? background, SKImageFilter? foreground, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateArithmetic(k1, k2, k3, k4, enforcePMColor, background, foreground, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreateArithmetic(null, k1, k2, k3, k4, enforcePMColor, background, foreground, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateArithmetic")] + private static extern SKImageFilter SKImageFilter_CreateArithmetic(SKImageFilter? _, float k1, float k2, float k3, float k4, bool enforcePMColor, SKImageFilter? background, SKImageFilter? foreground, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreateMerge(ReadOnlySpan filters, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy(ReadOnlySpan filters) => SKImageFilter.CreateMerge(filters.ToArray(), new SKImageFilter.CropRect(cropRect)); + return Legacy(filters); + } + + return SKImageFilter_CreateMerge(null, filters, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateMerge")] + private static extern SKImageFilter SKImageFilter_CreateMerge(SKImageFilter? _, ReadOnlySpan filters, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreateMatrixConvolution(SKSizeI kernelSize, ReadOnlySpan kernel, float gain, float bias, SKPointI kernelOffset, SKShaderTileMode tileMode, bool convolveAlpha, SKImageFilter? input, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy(ReadOnlySpan kernel) => SKImageFilter.CreateMatrixConvolution(kernelSize, kernel.ToArray(), gain, bias, kernelOffset, tileMode, convolveAlpha, input, new SKImageFilter.CropRect(cropRect)); + return Legacy(kernel); + } + + return SKImageFilter_CreateMatrixConvolution(null, kernelSize, kernel, gain, bias, kernelOffset, tileMode, convolveAlpha, input, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateMatrixConvolution")] + private static extern SKImageFilter SKImageFilter_CreateMatrixConvolution(SKImageFilter? _, SKSizeI kernelSize, ReadOnlySpan kernel, float gain, float bias, SKPointI kernelOffset, SKShaderTileMode tileMode, bool convolveAlpha, SKImageFilter? input, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreateDistantLitDiffuse(SKPoint3 direction, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateDistantLitDiffuse(direction, lightColor, surfaceScale, kd, input, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreateDistantLitDiffuse(null, direction, lightColor, surfaceScale, kd, input, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateDistantLitDiffuse")] + private static extern SKImageFilter SKImageFilter_CreateDistantLitDiffuse(SKImageFilter? _, SKPoint3 direction, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreateDistantLitSpecular(SKPoint3 direction, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateDistantLitSpecular(direction, lightColor, surfaceScale, ks, shininess, input, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreateDistantLitSpecular(null, direction, lightColor, surfaceScale, ks, shininess, input, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateDistantLitSpecular")] + private static extern SKImageFilter SKImageFilter_CreateDistantLitSpecular(SKImageFilter? _, SKPoint3 direction, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreateSpotLitDiffuse(SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateSpotLitDiffuse(location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, kd, input, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreateSpotLitDiffuse(null, location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, kd, input, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateSpotLitDiffuse")] + private static extern SKImageFilter SKImageFilter_CreateSpotLitDiffuse(SKImageFilter? _, SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreateSpotLitSpecular(SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreateSpotLitSpecular(location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, ks, shininess, input, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreateSpotLitSpecular(null, location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, ks, shininess, input, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateSpotLitSpecular")] + private static extern SKImageFilter SKImageFilter_CreateSpotLitSpecular(SKImageFilter? _, SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreatePointLitDiffuse(SKPoint3 location, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreatePointLitDiffuse(location, lightColor, surfaceScale, kd, input, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreatePointLitDiffuse(null, location, lightColor, surfaceScale, kd, input, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreatePointLitDiffuse")] + private static extern SKImageFilter SKImageFilter_CreatePointLitDiffuse(SKImageFilter? _, SKPoint3 location, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect); + + internal static SKImageFilter SKImageFilter_CreatePointLitSpecular(SKPoint3 location, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKImageFilter Legacy() => SKImageFilter.CreatePointLitSpecular(location, lightColor, surfaceScale, ks, shininess, input, new SKImageFilter.CropRect(cropRect)); + return Legacy(); + } + + return SKImageFilter_CreatePointLitSpecular(null, location, lightColor, surfaceScale, ks, shininess, input, cropRect); + } + + [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreatePointLitSpecular")] + private static extern SKImageFilter SKImageFilter_CreatePointLitSpecular(SKImageFilter? _, SKPoint3 location, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect); + + internal static SKShader SKRuntimeEffect_ToShader(SKRuntimeEffect @this, bool isOpaque, SKRuntimeEffectUniforms uniforms) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + SKShader Legacy() => @this.ToShader(isOpaque, uniforms); + return Legacy(); + } + + // Note: No overload of ToShader in SkiaSharp 3 takes isOpaque parameter. So we ignore. + return SKRuntimeEffect_ToShader(@this, uniforms); + } + + [UnsafeAccessor(UnsafeAccessorKind.Method, Name = "ToShader")] + private static extern SKShader SKRuntimeEffect_ToShader(SKRuntimeEffect @this, SKRuntimeEffectUniforms uniforms); + + internal static ReadOnlySpan SKBitmap_GetPixelSpan(SKBitmap @this) + { + if (!_isSkiaSharp3OrLater) + { + [MethodImpl(MethodImplOptions.NoInlining)] + ReadOnlySpan Legacy() => @this.GetPixelSpan(); + return Legacy(); + } + + return SKBitmap_GetPixelSpan_SkiaSharp(@this); + } + + [UnsafeAccessor(UnsafeAccessorKind.Method, Name = "GetPixelSpan")] + private static extern Span SKBitmap_GetPixelSpan_SkiaSharp(SKBitmap @this); +} From 12ad68e132497727cfe7afc2b8e0cb7dbc822c72 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Tue, 11 Feb 2025 22:43:45 -0500 Subject: [PATCH 02/15] chore: pr comments --- .../SkiaCompact.skia.cs | 286 ------------------ 1 file changed, 286 deletions(-) diff --git a/src/Uno.Toolkit.Skia.WinUI/SkiaCompact.skia.cs b/src/Uno.Toolkit.Skia.WinUI/SkiaCompact.skia.cs index edf40d3d7..d5cdab782 100644 --- a/src/Uno.Toolkit.Skia.WinUI/SkiaCompact.skia.cs +++ b/src/Uno.Toolkit.Skia.WinUI/SkiaCompact.skia.cs @@ -25,290 +25,4 @@ internal static SKImageFilter SKImageFilter_CreateBlur(float sigmaX, float sigma [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateBlur")] private static extern SKImageFilter SKImageFilter_CreateBlur(SKImageFilter? _, float sigmaX, float sigmaY); - - - internal static SKImageFilter SKImageFilter_CreateColorFilter(SKColorFilter cf, SKImageFilter? input, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateColorFilter(cf, input, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreateColorFilter(null, cf, input, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateColorFilter")] - private static extern SKImageFilter SKImageFilter_CreateColorFilter(SKImageFilter? _, SKColorFilter cf, SKImageFilter? input, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreateColorFilter(SKColorFilter cf, SKImageFilter? input) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateColorFilter(cf, input); - return Legacy(); - } - - return SKImageFilter_CreateColorFilter(null, cf, input); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateColorFilter")] - private static extern SKImageFilter SKImageFilter_CreateColorFilter(SKImageFilter? _, SKColorFilter cf, SKImageFilter? input); - - internal static SKImageFilter SKImageFilter_CreateOffset(float dx, float dy, SKImageFilter? input, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateOffset(dx, dy, input, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreateOffset(null, dx, dy, input, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateOffset")] - private static extern SKImageFilter SKImageFilter_CreateOffset(SKImageFilter? _, float radiusX, float radiusY, SKImageFilter? input, SKRect cropRect); - - internal static SKRuntimeEffect SKRuntimeEffect_CreateShader(string sksl, out string errors) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKRuntimeEffect Legacy(out string errors) => SKRuntimeEffect.Create(sksl, out errors); - return Legacy(out errors); - } - - return SKRuntimeEffect_CreateShader(null, sksl, out errors); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateShader")] - private static extern SKRuntimeEffect SKRuntimeEffect_CreateShader(SKRuntimeEffect? _, string sksl, out string errors); - - internal static void SKRuntimeEffectChildren_Add_WithNull(SKRuntimeEffectChildren @this, string name) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - void Legacy() => @this.Add(name, null); - Legacy(); - return; - } - - // TODO(Youssef,SkiaSharp3): Find a way to support this... Reflection? - throw new NotSupportedException("CompositionEffectBrush is not supported for SkiaSharp 3."); - } - - internal static SKImageFilter SKImageFilter_CreateBlendMode(SKBlendMode mode, SKImageFilter? background, SKImageFilter? foreground, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateBlendMode(mode, background, foreground, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreateBlendMode(null, mode, background, foreground, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateBlendMode")] - private static extern SKImageFilter SKImageFilter_CreateBlendMode(SKImageFilter? _, SKBlendMode mode, SKImageFilter? background, SKImageFilter? foreground, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreatePaint(SKPaint paint, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreatePaint(paint, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreatePaint(null, paint, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreatePaint")] - private static extern SKImageFilter SKImageFilter_CreatePaint(SKImageFilter? _, SKPaint paint, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreateDropShadow(float dx, float dy, float sigmaX, float sigmaY, SKColor color) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateDropShadow(dx, dy, sigmaX, sigmaY, color); - return Legacy(); - } - - return SKImageFilter_CreateDropShadow(null, dx, dy, sigmaX, sigmaY, color); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateDropShadow")] - private static extern SKImageFilter SKImageFilter_CreateDropShadow(SKImageFilter? _, float dx, float dy, float sigmaX, float sigmaY, SKColor color); - - internal static SKImageFilter SKImageFilter_CreateArithmetic(float k1, float k2, float k3, float k4, bool enforcePMColor, SKImageFilter? background, SKImageFilter? foreground, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateArithmetic(k1, k2, k3, k4, enforcePMColor, background, foreground, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreateArithmetic(null, k1, k2, k3, k4, enforcePMColor, background, foreground, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateArithmetic")] - private static extern SKImageFilter SKImageFilter_CreateArithmetic(SKImageFilter? _, float k1, float k2, float k3, float k4, bool enforcePMColor, SKImageFilter? background, SKImageFilter? foreground, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreateMerge(ReadOnlySpan filters, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy(ReadOnlySpan filters) => SKImageFilter.CreateMerge(filters.ToArray(), new SKImageFilter.CropRect(cropRect)); - return Legacy(filters); - } - - return SKImageFilter_CreateMerge(null, filters, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateMerge")] - private static extern SKImageFilter SKImageFilter_CreateMerge(SKImageFilter? _, ReadOnlySpan filters, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreateMatrixConvolution(SKSizeI kernelSize, ReadOnlySpan kernel, float gain, float bias, SKPointI kernelOffset, SKShaderTileMode tileMode, bool convolveAlpha, SKImageFilter? input, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy(ReadOnlySpan kernel) => SKImageFilter.CreateMatrixConvolution(kernelSize, kernel.ToArray(), gain, bias, kernelOffset, tileMode, convolveAlpha, input, new SKImageFilter.CropRect(cropRect)); - return Legacy(kernel); - } - - return SKImageFilter_CreateMatrixConvolution(null, kernelSize, kernel, gain, bias, kernelOffset, tileMode, convolveAlpha, input, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateMatrixConvolution")] - private static extern SKImageFilter SKImageFilter_CreateMatrixConvolution(SKImageFilter? _, SKSizeI kernelSize, ReadOnlySpan kernel, float gain, float bias, SKPointI kernelOffset, SKShaderTileMode tileMode, bool convolveAlpha, SKImageFilter? input, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreateDistantLitDiffuse(SKPoint3 direction, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateDistantLitDiffuse(direction, lightColor, surfaceScale, kd, input, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreateDistantLitDiffuse(null, direction, lightColor, surfaceScale, kd, input, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateDistantLitDiffuse")] - private static extern SKImageFilter SKImageFilter_CreateDistantLitDiffuse(SKImageFilter? _, SKPoint3 direction, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreateDistantLitSpecular(SKPoint3 direction, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateDistantLitSpecular(direction, lightColor, surfaceScale, ks, shininess, input, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreateDistantLitSpecular(null, direction, lightColor, surfaceScale, ks, shininess, input, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateDistantLitSpecular")] - private static extern SKImageFilter SKImageFilter_CreateDistantLitSpecular(SKImageFilter? _, SKPoint3 direction, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreateSpotLitDiffuse(SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateSpotLitDiffuse(location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, kd, input, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreateSpotLitDiffuse(null, location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, kd, input, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateSpotLitDiffuse")] - private static extern SKImageFilter SKImageFilter_CreateSpotLitDiffuse(SKImageFilter? _, SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreateSpotLitSpecular(SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreateSpotLitSpecular(location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, ks, shininess, input, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreateSpotLitSpecular(null, location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, ks, shininess, input, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreateSpotLitSpecular")] - private static extern SKImageFilter SKImageFilter_CreateSpotLitSpecular(SKImageFilter? _, SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreatePointLitDiffuse(SKPoint3 location, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreatePointLitDiffuse(location, lightColor, surfaceScale, kd, input, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreatePointLitDiffuse(null, location, lightColor, surfaceScale, kd, input, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreatePointLitDiffuse")] - private static extern SKImageFilter SKImageFilter_CreatePointLitDiffuse(SKImageFilter? _, SKPoint3 location, SKColor lightColor, float surfaceScale, float kd, SKImageFilter? input, SKRect cropRect); - - internal static SKImageFilter SKImageFilter_CreatePointLitSpecular(SKPoint3 location, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKImageFilter Legacy() => SKImageFilter.CreatePointLitSpecular(location, lightColor, surfaceScale, ks, shininess, input, new SKImageFilter.CropRect(cropRect)); - return Legacy(); - } - - return SKImageFilter_CreatePointLitSpecular(null, location, lightColor, surfaceScale, ks, shininess, input, cropRect); - } - - [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "CreatePointLitSpecular")] - private static extern SKImageFilter SKImageFilter_CreatePointLitSpecular(SKImageFilter? _, SKPoint3 location, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter? input, SKRect cropRect); - - internal static SKShader SKRuntimeEffect_ToShader(SKRuntimeEffect @this, bool isOpaque, SKRuntimeEffectUniforms uniforms) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - SKShader Legacy() => @this.ToShader(isOpaque, uniforms); - return Legacy(); - } - - // Note: No overload of ToShader in SkiaSharp 3 takes isOpaque parameter. So we ignore. - return SKRuntimeEffect_ToShader(@this, uniforms); - } - - [UnsafeAccessor(UnsafeAccessorKind.Method, Name = "ToShader")] - private static extern SKShader SKRuntimeEffect_ToShader(SKRuntimeEffect @this, SKRuntimeEffectUniforms uniforms); - - internal static ReadOnlySpan SKBitmap_GetPixelSpan(SKBitmap @this) - { - if (!_isSkiaSharp3OrLater) - { - [MethodImpl(MethodImplOptions.NoInlining)] - ReadOnlySpan Legacy() => @this.GetPixelSpan(); - return Legacy(); - } - - return SKBitmap_GetPixelSpan_SkiaSharp(@this); - } - - [UnsafeAccessor(UnsafeAccessorKind.Method, Name = "GetPixelSpan")] - private static extern Span SKBitmap_GetPixelSpan_SkiaSharp(SKBitmap @this); } From f0d015a0a158e2264f570d98855139488c7c7095 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Thu, 13 Feb 2025 13:11:53 -0500 Subject: [PATCH 03/15] chore: test --- samples/Directory.Packages.props | 1 + .../Uno.Toolkit.WinUI.Samples.Mobile.csproj | 2 ++ 2 files changed, 3 insertions(+) diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index 59dcd6550..33db02da2 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -21,6 +21,7 @@ + diff --git a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj index 189431533..3fdf7a80f 100644 --- a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj +++ b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj @@ -74,6 +74,8 @@ + + iPhone Distribution From b5a9ad87e49dce7c607a0b56e36e8d484889dffe Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Thu, 13 Feb 2025 14:58:00 -0500 Subject: [PATCH 04/15] chore: test fix --- samples/Directory.Packages.props | 7 +++---- .../Uno.Toolkit.WinUI.Samples.Mobile.csproj | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index 33db02da2..5c62b08d4 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -17,11 +17,10 @@ - - + + - - + diff --git a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj index 3fdf7a80f..189431533 100644 --- a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj +++ b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj @@ -74,8 +74,6 @@ - - iPhone Distribution From 443d907186570ec931de0471062b76aabb130034 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Tue, 18 Feb 2025 07:05:14 -0500 Subject: [PATCH 05/15] chore: re-bump to skia 3 --- samples/Directory.Packages.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index 5c62b08d4..5808b7375 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -17,10 +17,10 @@ - - - - + + + + From 8ef87b15722a181f661038fb8d58a21bbba0d90d Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Tue, 18 Feb 2025 11:48:03 -0500 Subject: [PATCH 06/15] ci: bump net9 --- build/workflow/templates/dotnet-workload-install-mac.yml | 4 ++-- build/workflow/templates/dotnet-workload-install-windows.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/workflow/templates/dotnet-workload-install-mac.yml b/build/workflow/templates/dotnet-workload-install-mac.yml index 5474d4fce..b17d8c2fa 100644 --- a/build/workflow/templates/dotnet-workload-install-mac.yml +++ b/build/workflow/templates/dotnet-workload-install-mac.yml @@ -1,6 +1,6 @@ parameters: - DotNetVersion: '8.0.301' - UnoCheck_Version: '1.23.0' + DotNetVersion: '9.0.101' + UnoCheck_Version: '1.28.3' Dotnet_Root: '/usr/local/share/dotnet/' Dotnet_Tools: '~/.dotnet/tools' diff --git a/build/workflow/templates/dotnet-workload-install-windows.yml b/build/workflow/templates/dotnet-workload-install-windows.yml index fea537842..1141a5b13 100644 --- a/build/workflow/templates/dotnet-workload-install-windows.yml +++ b/build/workflow/templates/dotnet-workload-install-windows.yml @@ -1,6 +1,6 @@ parameters: - DotNetVersion: '8.0.301' - UnoCheck_Version: '1.23.0' + DotNetVersion: '9.0.101' + UnoCheck_Version: '1.28.3' steps: From 06a6a550a3a742d1ec71594cd066c9ed6228bcf9 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Wed, 19 Feb 2025 09:39:42 -0500 Subject: [PATCH 07/15] chore: fix skiasharp version --- samples/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index 5808b7375..59dcd6550 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -19,7 +19,7 @@ - + From 63dad37ad31f77d0c1f85b032ebbd936ed4dffe3 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Wed, 5 Mar 2025 22:08:01 -0500 Subject: [PATCH 08/15] chore: fix build --- build/workflow/pipeline.yml | 2 +- samples/Directory.Packages.props | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/build/workflow/pipeline.yml b/build/workflow/pipeline.yml index 81d052603..d99b5e222 100644 --- a/build/workflow/pipeline.yml +++ b/build/workflow/pipeline.yml @@ -36,7 +36,7 @@ variables: IsCanaryBranch: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/canaries/')] IsReleaseBranch: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))] - XCODE_ROOT: '/Applications/Xcode_15.4.app' + XCODE_ROOT: '/Applications/Xcode_16.app' stages: - stage: Determine_Changes diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index 59dcd6550..e0cce96df 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -18,8 +18,7 @@ - - + From f7ce26ac65b3d2decf4e46b18c7c88196eac24d6 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Wed, 5 Mar 2025 22:41:12 -0500 Subject: [PATCH 09/15] chore: fix xcode version --- build/workflow/pipeline.yml | 1 + build/workflow/stage-build-ios.yml | 3 +++ build/workflow/stage-uitests-ios.yml | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/workflow/pipeline.yml b/build/workflow/pipeline.yml index d99b5e222..6cdc8babb 100644 --- a/build/workflow/pipeline.yml +++ b/build/workflow/pipeline.yml @@ -37,6 +37,7 @@ variables: IsCanaryBranch: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/canaries/')] IsReleaseBranch: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))] XCODE_ROOT: '/Applications/Xcode_16.app' + XCODE_ROOT_UITESTS: '/Applications/Xcode_15.4.app' stages: - stage: Determine_Changes diff --git a/build/workflow/stage-build-ios.yml b/build/workflow/stage-build-ios.yml index c280eb8fd..40caec816 100644 --- a/build/workflow/stage-build-ios.yml +++ b/build/workflow/stage-build-ios.yml @@ -66,6 +66,9 @@ jobs: - template: templates/canary-updater.yml - template: templates/gitversion.yml - template: templates/set-app-versions.yml + - template: templates/xcode-select.yml + parameters: + xCodeRoot: $(XCODE_ROOT) - bash: | cd $(build.sourcesdirectory)/samples/$(ProjectName)/$(ProjectName).Mobile diff --git a/build/workflow/stage-uitests-ios.yml b/build/workflow/stage-uitests-ios.yml index a354145a2..51c76b20a 100644 --- a/build/workflow/stage-uitests-ios.yml +++ b/build/workflow/stage-uitests-ios.yml @@ -53,7 +53,7 @@ - template: templates/xcode-select.yml parameters: - xCodeRoot: $(XCODE_ROOT) + xCodeRoot: $(XCODE_ROOT_UITESTS) - bash: | chmod +x $(build.sourcesdirectory)/build/workflow/scripts/ios-uitest-run.sh From 6f6a32985c158bc51696e292faf57bf1a36e7b31 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Thu, 6 Mar 2025 10:04:58 -0500 Subject: [PATCH 10/15] ci: fix xcode version --- build/workflow/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/workflow/pipeline.yml b/build/workflow/pipeline.yml index 6cdc8babb..5412d5872 100644 --- a/build/workflow/pipeline.yml +++ b/build/workflow/pipeline.yml @@ -36,7 +36,7 @@ variables: IsCanaryBranch: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/canaries/')] IsReleaseBranch: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))] - XCODE_ROOT: '/Applications/Xcode_16.app' + XCODE_ROOT: '/Applications/Xcode_16.1.app' XCODE_ROOT_UITESTS: '/Applications/Xcode_15.4.app' stages: From b050a3b2bb7126b04f40a39b6de8c5b9c80bd49b Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Thu, 6 Mar 2025 10:23:42 -0500 Subject: [PATCH 11/15] build: try stuff --- samples/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index e0cce96df..b6a464add 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -17,7 +17,7 @@ - + From f3b7595a1dda5299a9d35c19eb2e6a7aaea0d712 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Thu, 6 Mar 2025 12:08:00 -0500 Subject: [PATCH 12/15] ci: fix xcode --- build/workflow/stage-build-ios.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/workflow/stage-build-ios.yml b/build/workflow/stage-build-ios.yml index 40caec816..ecfa5ee79 100644 --- a/build/workflow/stage-build-ios.yml +++ b/build/workflow/stage-build-ios.yml @@ -128,6 +128,10 @@ jobs: - template: templates/dotnet-workload-install-mac.yml - template: templates/canary-updater.yml + - template: templates/xcode-select.yml + parameters: + xCodeRoot: $(XCODE_ROOT) + - bash: | chmod +x $(build.sourcesdirectory)/build/workflow/scripts/ios-uitest-build.sh $(build.sourcesdirectory)/build/workflow/scripts/ios-uitest-build.sh From 233518a43d887036ee9cf50d2542492dd8dcc099 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Thu, 6 Mar 2025 20:28:31 -0500 Subject: [PATCH 13/15] build: fixes --- .../Uno.Toolkit.WinUI.Samples.Mobile.csproj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj index 189431533..e7eae73bd 100644 --- a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj +++ b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj @@ -19,7 +19,10 @@ True true - + 14.2 + 14.0 + 21.0 + 10.14 $(DefineConstants);IS_WINUI From a8349e677b9442ff8f2735e7084bb5b5ece2e0a2 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Thu, 6 Mar 2025 23:28:10 -0500 Subject: [PATCH 14/15] chore: fixes --- samples/Directory.Packages.props | 1 - .../Uno.Toolkit.Samples.Mobile.csproj | 3 +++ .../Uno.Toolkit.Samples.Skia.Gtk.csproj | 3 +++ .../Uno.Toolkit.WinUI.Samples.Mobile.csproj | 4 +++- .../Uno.Toolkit.WinUI.Samples.Skia.Gtk.csproj | 4 +++- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index b6a464add..b95f79d9a 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -17,7 +17,6 @@ - diff --git a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Mobile/Uno.Toolkit.Samples.Mobile.csproj b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Mobile/Uno.Toolkit.Samples.Mobile.csproj index d0fb88999..0f23e7839 100644 --- a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Mobile/Uno.Toolkit.Samples.Mobile.csproj +++ b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Mobile/Uno.Toolkit.Samples.Mobile.csproj @@ -26,6 +26,9 @@ maccatalyst-x64 osx-x64 + + + diff --git a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Skia.Gtk/Uno.Toolkit.Samples.Skia.Gtk.csproj b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Skia.Gtk/Uno.Toolkit.Samples.Skia.Gtk.csproj index 3cd4836bf..ab1c1a8f3 100644 --- a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Skia.Gtk/Uno.Toolkit.Samples.Skia.Gtk.csproj +++ b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Skia.Gtk/Uno.Toolkit.Samples.Skia.Gtk.csproj @@ -26,6 +26,9 @@ + + + diff --git a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj index e7eae73bd..3f951dbbb 100644 --- a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj +++ b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Mobile/Uno.Toolkit.WinUI.Samples.Mobile.csproj @@ -35,7 +35,9 @@ maccatalyst-x64 osx-x64 - + + + diff --git a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Skia.Gtk/Uno.Toolkit.WinUI.Samples.Skia.Gtk.csproj b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Skia.Gtk/Uno.Toolkit.WinUI.Samples.Skia.Gtk.csproj index f2fc0f390..d8f15f60f 100644 --- a/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Skia.Gtk/Uno.Toolkit.WinUI.Samples.Skia.Gtk.csproj +++ b/samples/Uno.Toolkit.WinUI.Samples/Uno.Toolkit.WinUI.Samples.Skia.Gtk/Uno.Toolkit.WinUI.Samples.Skia.Gtk.csproj @@ -4,7 +4,6 @@ WinExe Exe net8.0 - $(DefineConstants);IS_WINUI @@ -15,6 +14,9 @@ + + + From 14cb875aba244b771bbe97babbae506803917528 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Fri, 7 Mar 2025 11:36:06 -0500 Subject: [PATCH 15/15] chore: diagnostic --- build/workflow/stage-build-ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/workflow/stage-build-ios.yml b/build/workflow/stage-build-ios.yml index ecfa5ee79..eb0eddf17 100644 --- a/build/workflow/stage-build-ios.yml +++ b/build/workflow/stage-build-ios.yml @@ -73,7 +73,7 @@ jobs: - bash: | cd $(build.sourcesdirectory)/samples/$(ProjectName)/$(ProjectName).Mobile echo "BUILD_SOURCEBRANCH: $BUILD_SOURCEBRANCH" - dotnet publish -f net8.0-ios -c Release /p:ArchiveOnBuild=true "/p:InformationalVersion=%NBGV_InformationalVersion%" "/bl:$(build.artifactstagingdirectory)/toolkit-build-$(ArtifactName).binlog" + dotnet publish -f net8.0-ios -c Release /p:ArchiveOnBuild=true "/p:InformationalVersion=%NBGV_InformationalVersion%" /v:diag "/bl:$(build.artifactstagingdirectory)/toolkit-build-$(ArtifactName).binlog" displayName: Build project for Release - (net8.0-ios) condition: eq(variables['System.PullRequest.IsFork'],'False')