diff --git a/.github/skills/review-skia-update/scripts/run_review.py b/.github/skills/review-skia-update/scripts/run_review.py index c80a30ffac6..4dcae3047f6 100755 --- a/.github/skills/review-skia-update/scripts/run_review.py +++ b/.github/skills/review-skia-update/scripts/run_review.py @@ -47,6 +47,26 @@ def run_git(args: list, cwd: str, check: bool = True) -> subprocess.CompletedPro return result +def ensure_remote(cwd: str, name: str, url: str): + """Ensure a git remote exists and points at the expected URL.""" + result = subprocess.run( + ["git", "remote", "get-url", name], + cwd=cwd, + capture_output=True, + text=True, + ) + + if result.returncode == 0: + current = result.stdout.strip() + if current != url: + eprint(f"▸ Updating remote '{name}' → {url}") + run_git(["remote", "set-url", name, url], cwd=cwd) + return + + eprint(f"▸ Adding remote '{name}' → {url}") + run_git(["remote", "add", name, url], cwd=cwd) + + def main(): parser = argparse.ArgumentParser( description="Run all mechanical checks for a Skia update review." @@ -154,6 +174,7 @@ def main(): # 1c. Fetch git refs eprint("▸ Fetching git refs...") + ensure_remote(skia_root, "upstream", "https://github.com/google/skia.git") run_git(["fetch", "upstream", old_milestone, new_milestone], cwd=skia_root) # Fetch the base branch and the PR head via GitHub's PR ref. This works for # both same-repo and fork PRs — the branch name only exists on the fork's diff --git a/.gitmodules b/.gitmodules index 3048e4eee1a..5b6ebcc4ce2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "externals/skia"] path = externals/skia url = https://github.com/mono/skia.git - branch = xamarin-mobile-bindings + branch = skiasharp [submodule "externals/depot_tools"] path = externals/depot_tools url = https://chromium.googlesource.com/chromium/tools/depot_tools.git diff --git a/README.md b/README.md index 7764a32f3b6..09653c2b091 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,6 @@ Made with [contrib.rocks](https://contrib.rocks). Here are some links to show the differences in our code as compared to Google's code. -What version are we on? [**m119**](https://github.com/google/skia/tree/chrome/m119) -Are we up-to-date with Google? [Compare](https://github.com/mono/skia/compare/skiasharp...google:chrome/m119) -What have we added? [Compare](https://github.com/google/skia/compare/chrome/m119...mono:skiasharp) +What version are we on? [**m132**](https://github.com/google/skia/tree/chrome/m132) +Are we up-to-date with Google? [Compare](https://github.com/mono/skia/compare/skiasharp...google:chrome/m132) +What have we added? [Compare](https://github.com/google/skia/compare/chrome/m132...mono:skiasharp) diff --git a/binding/SkiaSharp/Definitions.cs b/binding/SkiaSharp/Definitions.cs index 8ae31de724a..8a0ff162e79 100644 --- a/binding/SkiaSharp/Definitions.cs +++ b/binding/SkiaSharp/Definitions.cs @@ -60,6 +60,8 @@ public enum SKColorType Srgba8888 = 22, R8Unorm = 23, Rgba10x6 = 24, + Bgra10101010XR = 25, + RgbF16F16F16x = 26, } public static partial class SkiaExtensions @@ -108,6 +110,8 @@ public static int GetBytesPerPixel (this SKColorType colorType) => SKColorType.RgbaF16 => 8, SKColorType.Rgba16161616 => 8, SKColorType.Rgba10x6 => 8, + SKColorType.Bgra10101010XR => 8, + SKColorType.RgbF16F16F16x => 8, // 16 SKColorType.RgbaF32 => 16, // @@ -146,6 +150,8 @@ public static int GetBitShiftPerPixel (this SKColorType colorType) => SKColorType.RgbaF16 => 3, SKColorType.Rgba16161616 => 3, SKColorType.Rgba10x6 => 3, + SKColorType.Bgra10101010XR => 3, + SKColorType.RgbF16F16F16x => 3, // 4 SKColorType.RgbaF32 => 4, // @@ -181,6 +187,7 @@ public static SKAlphaType GetAlphaType (this SKColorType colorType, SKAlphaType case SKColorType.RgbaF32: case SKColorType.Rgba16161616: case SKColorType.Rgba10x6: + case SKColorType.Bgra10101010XR: break; // opaque @@ -194,6 +201,7 @@ public static SKAlphaType GetAlphaType (this SKColorType colorType, SKAlphaType case SKColorType.Bgr101010x: case SKColorType.Bgr101010xXR: case SKColorType.R8Unorm: + case SKColorType.RgbF16F16F16x: alphaType = SKAlphaType.Opaque; break; @@ -548,6 +556,8 @@ public SKJpegEncoderOptions (int quality) fICCProfile = default; fICCProfileDescription = default; xmpMetadata = default; + fOrigin = default; + fHasOrigin = default; fQuality = quality; fDownsample = SKJpegEncoderDownsample.Downsample420; @@ -559,6 +569,8 @@ public SKJpegEncoderOptions (int quality, SKJpegEncoderDownsample downsample, SK fICCProfile = default; fICCProfileDescription = default; xmpMetadata = default; + fOrigin = default; + fHasOrigin = default; fQuality = quality; fDownsample = downsample; diff --git a/binding/SkiaSharp/EnumMappings.cs b/binding/SkiaSharp/EnumMappings.cs index 4f0ed3b3f15..b986e9e5961 100644 --- a/binding/SkiaSharp/EnumMappings.cs +++ b/binding/SkiaSharp/EnumMappings.cs @@ -68,6 +68,8 @@ internal static SKColorTypeNative ToNative (this SKColorType colorType) => SKColorType.Bgr101010xXR => SKColorTypeNative.Bgr101010xXr, SKColorType.Srgba8888 => SKColorTypeNative.Srgba8888, SKColorType.R8Unorm => SKColorTypeNative.R8Unorm, + SKColorType.Bgra10101010XR => SKColorTypeNative.Bgra10101010Xr, + SKColorType.RgbF16F16F16x => SKColorTypeNative.RgbF16f16f16x, _ => throw new ArgumentOutOfRangeException (nameof (colorType), $"Unknown color type: '{colorType}'"), }; @@ -99,6 +101,8 @@ internal static SKColorType FromNative (this SKColorTypeNative colorType) => SKColorTypeNative.Bgr101010xXr => SKColorType.Bgr101010xXR, SKColorTypeNative.Srgba8888 => SKColorType.Srgba8888, SKColorTypeNative.R8Unorm => SKColorType.R8Unorm, + SKColorTypeNative.Bgra10101010Xr => SKColorType.Bgra10101010XR, + SKColorTypeNative.RgbF16f16f16x => SKColorType.RgbF16F16F16x, _ => throw new ArgumentOutOfRangeException (nameof (colorType), $"Unknown color type: '{colorType}'"), }; } diff --git a/binding/SkiaSharp/GRDefinitions.cs b/binding/SkiaSharp/GRDefinitions.cs index 00cb118e527..7688f8a8519 100644 --- a/binding/SkiaSharp/GRDefinitions.cs +++ b/binding/SkiaSharp/GRDefinitions.cs @@ -161,8 +161,10 @@ public static uint ToGlSizedFormat (this SKColorType colorType) => SKColorType.Bgra1010102 => 0, SKColorType.Bgr101010x => 0, SKColorType.Bgr101010xXR => 0, + SKColorType.Bgra10101010XR => 0, SKColorType.Srgba8888 => GRGlSizedFormat.SRGB8_ALPHA8, SKColorType.R8Unorm => GRGlSizedFormat.R8, + SKColorType.RgbF16F16F16x => 0, _ => throw new ArgumentOutOfRangeException (nameof (colorType), $"Unknown color type: '{colorType}'"), }; } diff --git a/binding/SkiaSharp/SkiaApi.generated.cs b/binding/SkiaSharp/SkiaApi.generated.cs index 36a99043c72..80deadae129 100644 --- a/binding/SkiaSharp/SkiaApi.generated.cs +++ b/binding/SkiaSharp/SkiaApi.generated.cs @@ -15142,6 +15142,25 @@ internal static void sk_surface_draw (sk_surface_t surface, sk_canvas_t canvas, (sk_surface_draw_delegate ??= GetSymbol ("sk_surface_draw")).Invoke (surface, canvas, x, y, paint); #endif + // void sk_surface_draw_with_sampling(sk_surface_t* surface, sk_canvas_t* canvas, float x, float y, const sk_sampling_options_t* sampling, const sk_paint_t* paint) + #if !USE_DELEGATES + #if USE_LIBRARY_IMPORT + [LibraryImport (SKIA)] + internal static partial void sk_surface_draw_with_sampling (sk_surface_t surface, sk_canvas_t canvas, Single x, Single y, SKSamplingOptions* sampling, sk_paint_t paint); + #else // !USE_LIBRARY_IMPORT + [DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)] + internal static extern void sk_surface_draw_with_sampling (sk_surface_t surface, sk_canvas_t canvas, Single x, Single y, SKSamplingOptions* sampling, sk_paint_t paint); + #endif + #else + private partial class Delegates { + [UnmanagedFunctionPointer (CallingConvention.Cdecl)] + internal delegate void sk_surface_draw_with_sampling (sk_surface_t surface, sk_canvas_t canvas, Single x, Single y, SKSamplingOptions* sampling, sk_paint_t paint); + } + private static Delegates.sk_surface_draw_with_sampling sk_surface_draw_with_sampling_delegate; + internal static void sk_surface_draw_with_sampling (sk_surface_t surface, sk_canvas_t canvas, Single x, Single y, SKSamplingOptions* sampling, sk_paint_t paint) => + (sk_surface_draw_with_sampling_delegate ??= GetSymbol ("sk_surface_draw_with_sampling")).Invoke (surface, canvas, x, y, sampling, paint); + #endif + // sk_canvas_t* sk_surface_get_canvas(sk_surface_t*) #if !USE_DELEGATES #if USE_LIBRARY_IMPORT @@ -17929,24 +17948,12 @@ internal unsafe partial struct GRVkBackendContextNative : IEquatable #pragma warning disable CS8909 - fInstance == obj.fInstance && fPhysicalDevice == obj.fPhysicalDevice && fDevice == obj.fDevice && fQueue == obj.fQueue && fGraphicsQueueIndex == obj.fGraphicsQueueIndex && fMinAPIVersion == obj.fMinAPIVersion && fInstanceVersion == obj.fInstanceVersion && fMaxAPIVersion == obj.fMaxAPIVersion && fExtensions == obj.fExtensions && fVkExtensions == obj.fVkExtensions && fFeatures == obj.fFeatures && fDeviceFeatures == obj.fDeviceFeatures && fDeviceFeatures2 == obj.fDeviceFeatures2 && fMemoryAllocator == obj.fMemoryAllocator && fGetProc == obj.fGetProc && fGetProcUserData == obj.fGetProcUserData && fOwnsInstanceAndDevice == obj.fOwnsInstanceAndDevice && fProtectedContext == obj.fProtectedContext; + fInstance == obj.fInstance && fPhysicalDevice == obj.fPhysicalDevice && fDevice == obj.fDevice && fQueue == obj.fQueue && fGraphicsQueueIndex == obj.fGraphicsQueueIndex && fMaxAPIVersion == obj.fMaxAPIVersion && fVkExtensions == obj.fVkExtensions && fDeviceFeatures == obj.fDeviceFeatures && fDeviceFeatures2 == obj.fDeviceFeatures2 && fMemoryAllocator == obj.fMemoryAllocator && fGetProc == obj.fGetProc && fGetProcUserData == obj.fGetProcUserData && fProtectedContext == obj.fProtectedContext; #pragma warning restore CS8909 public readonly override bool Equals (object obj) => @@ -17994,18 +17998,13 @@ public readonly override int GetHashCode () hash.Add (fDevice); hash.Add (fQueue); hash.Add (fGraphicsQueueIndex); - hash.Add (fMinAPIVersion); - hash.Add (fInstanceVersion); hash.Add (fMaxAPIVersion); - hash.Add (fExtensions); hash.Add (fVkExtensions); - hash.Add (fFeatures); hash.Add (fDeviceFeatures); hash.Add (fDeviceFeatures2); hash.Add (fMemoryAllocator); hash.Add (fGetProc); hash.Add (fGetProcUserData); - hash.Add (fOwnsInstanceAndDevice); hash.Add (fProtectedContext); return hash.ToHashCode (); } @@ -18133,6 +18132,63 @@ public readonly override int GetHashCode () } + // gr_vk_ycbcr_components_t + [StructLayout (LayoutKind.Sequential)] + public unsafe partial struct GRVkYcbcrComponents : IEquatable { + // public uint32_t r + private UInt32 r; + public UInt32 R { + readonly get => r; + set => r = value; + } + + // public uint32_t g + private UInt32 g; + public UInt32 G { + readonly get => g; + set => g = value; + } + + // public uint32_t b + private UInt32 b; + public UInt32 B { + readonly get => b; + set => b = value; + } + + // public uint32_t a + private UInt32 a; + public UInt32 A { + readonly get => a; + set => a = value; + } + + public readonly bool Equals (GRVkYcbcrComponents obj) => +#pragma warning disable CS8909 + r == obj.r && g == obj.g && b == obj.b && a == obj.a; +#pragma warning restore CS8909 + + public readonly override bool Equals (object obj) => + obj is GRVkYcbcrComponents f && Equals (f); + + public static bool operator == (GRVkYcbcrComponents left, GRVkYcbcrComponents right) => + left.Equals (right); + + public static bool operator != (GRVkYcbcrComponents left, GRVkYcbcrComponents right) => + !left.Equals (right); + + public readonly override int GetHashCode () + { + var hash = new HashCode (); + hash.Add (r); + hash.Add (g); + hash.Add (b); + hash.Add (a); + return hash.ToHashCode (); + } + + } + // gr_vk_ycbcrconversioninfo_t [StructLayout (LayoutKind.Sequential)] public unsafe partial struct GrVkYcbcrConversionInfo : IEquatable { @@ -18199,9 +18255,16 @@ public UInt32 FormatFeatures { set => fFormatFeatures = value; } + // public gr_vk_ycbcr_components_t fComponents + private GRVkYcbcrComponents fComponents; + public GRVkYcbcrComponents Components { + readonly get => fComponents; + set => fComponents = value; + } + public readonly bool Equals (GrVkYcbcrConversionInfo obj) => #pragma warning disable CS8909 - fFormat == obj.fFormat && fExternalFormat == obj.fExternalFormat && fYcbcrModel == obj.fYcbcrModel && fYcbcrRange == obj.fYcbcrRange && fXChromaOffset == obj.fXChromaOffset && fYChromaOffset == obj.fYChromaOffset && fChromaFilter == obj.fChromaFilter && fForceExplicitReconstruction == obj.fForceExplicitReconstruction && fFormatFeatures == obj.fFormatFeatures; + fFormat == obj.fFormat && fExternalFormat == obj.fExternalFormat && fYcbcrModel == obj.fYcbcrModel && fYcbcrRange == obj.fYcbcrRange && fXChromaOffset == obj.fXChromaOffset && fYChromaOffset == obj.fYChromaOffset && fChromaFilter == obj.fChromaFilter && fForceExplicitReconstruction == obj.fForceExplicitReconstruction && fFormatFeatures == obj.fFormatFeatures && fComponents == obj.fComponents; #pragma warning restore CS8909 public readonly override bool Equals (object obj) => @@ -18225,6 +18288,7 @@ public readonly override int GetHashCode () hash.Add (fChromaFilter); hash.Add (fForceExplicitReconstruction); hash.Add (fFormatFeatures); + hash.Add (fComponents); return hash.ToHashCode (); } @@ -19181,9 +19245,15 @@ public readonly override int GetHashCode () // public const char* fICCProfileDescription private readonly /* char */ void* fICCProfileDescription; + // public int32_t fOrigin + private readonly Int32 fOrigin; + + // public bool fHasOrigin + private readonly Byte fHasOrigin; + public readonly bool Equals (SKJpegEncoderOptions obj) => #pragma warning disable CS8909 - fQuality == obj.fQuality && fDownsample == obj.fDownsample && fAlphaOption == obj.fAlphaOption && xmpMetadata == obj.xmpMetadata && fICCProfile == obj.fICCProfile && fICCProfileDescription == obj.fICCProfileDescription; + fQuality == obj.fQuality && fDownsample == obj.fDownsample && fAlphaOption == obj.fAlphaOption && xmpMetadata == obj.xmpMetadata && fICCProfile == obj.fICCProfile && fICCProfileDescription == obj.fICCProfileDescription && fOrigin == obj.fOrigin && fHasOrigin == obj.fHasOrigin; #pragma warning restore CS8909 public readonly override bool Equals (object obj) => @@ -19204,6 +19274,8 @@ public readonly override int GetHashCode () hash.Add (xmpMetadata); hash.Add (fICCProfile); hash.Add (fICCProfileDescription); + hash.Add (fOrigin); + hash.Add (fHasOrigin); return hash.ToHashCode (); } @@ -20556,32 +20628,36 @@ internal enum SKColorTypeNative { Bgr101010x = 10, // BGR_101010X_XR_SK_COLORTYPE = 11 Bgr101010xXr = 11, - // RGBA_10X6_SK_COLORTYPE = 12 - Rgba10x6 = 12, - // GRAY_8_SK_COLORTYPE = 13 - Gray8 = 13, - // RGBA_F16_NORM_SK_COLORTYPE = 14 - RgbaF16Norm = 14, - // RGBA_F16_SK_COLORTYPE = 15 - RgbaF16 = 15, - // RGBA_F32_SK_COLORTYPE = 16 - RgbaF32 = 16, - // R8G8_UNORM_SK_COLORTYPE = 17 - R8g8Unorm = 17, - // A16_FLOAT_SK_COLORTYPE = 18 - A16Float = 18, - // R16G16_FLOAT_SK_COLORTYPE = 19 - R16g16Float = 19, - // A16_UNORM_SK_COLORTYPE = 20 - A16Unorm = 20, - // R16G16_UNORM_SK_COLORTYPE = 21 - R16g16Unorm = 21, - // R16G16B16A16_UNORM_SK_COLORTYPE = 22 - R16g16b16a16Unorm = 22, - // SRGBA_8888_SK_COLORTYPE = 23 - Srgba8888 = 23, - // R8_UNORM_SK_COLORTYPE = 24 - R8Unorm = 24, + // BGRA_10101010_XR_SK_COLORTYPE = 12 + Bgra10101010Xr = 12, + // RGBA_10X6_SK_COLORTYPE = 13 + Rgba10x6 = 13, + // GRAY_8_SK_COLORTYPE = 14 + Gray8 = 14, + // RGBA_F16_NORM_SK_COLORTYPE = 15 + RgbaF16Norm = 15, + // RGBA_F16_SK_COLORTYPE = 16 + RgbaF16 = 16, + // RGB_F16F16F16X_SK_COLORTYPE = 17 + RgbF16f16f16x = 17, + // RGBA_F32_SK_COLORTYPE = 18 + RgbaF32 = 18, + // R8G8_UNORM_SK_COLORTYPE = 19 + R8g8Unorm = 19, + // A16_FLOAT_SK_COLORTYPE = 20 + A16Float = 20, + // R16G16_FLOAT_SK_COLORTYPE = 21 + R16g16Float = 21, + // A16_UNORM_SK_COLORTYPE = 22 + A16Unorm = 22, + // R16G16_UNORM_SK_COLORTYPE = 23 + R16g16Unorm = 23, + // R16G16B16A16_UNORM_SK_COLORTYPE = 24 + R16g16b16a16Unorm = 24, + // SRGBA_8888_SK_COLORTYPE = 25 + Srgba8888 = 25, + // R8_UNORM_SK_COLORTYPE = 26 + R8Unorm = 26, } // sk_encoded_image_format_t diff --git a/externals/skia b/externals/skia index 7a95fc39fbf..e2260f39c46 160000 --- a/externals/skia +++ b/externals/skia @@ -1 +1 @@ -Subproject commit 7a95fc39fbf18e7ad88b423b610e41254204945a +Subproject commit e2260f39c46784103dcb169e36780b7e540d11d4 diff --git a/native/android/build.cake b/native/android/build.cake index b978dac519b..b045a535aa7 100644 --- a/native/android/build.cake +++ b/native/android/build.cake @@ -30,7 +30,6 @@ Task("libSkiaSharp") $"skia_use_harfbuzz=false " + $"skia_use_icu=false " + $"skia_use_piex=true " + - $"skia_use_sfntly=false " + $"skia_use_system_expat=false " + $"skia_use_system_freetype2=false " + $"skia_use_system_libjpeg_turbo=false " + diff --git a/native/ios/build.cake b/native/ios/build.cake index 3cd6a13d3fb..659440d9073 100644 --- a/native/ios/build.cake +++ b/native/ios/build.cake @@ -57,7 +57,6 @@ Task("libSkiaSharp") $"skia_use_icu=false " + $"skia_use_metal=true " + $"skia_use_piex=true " + - $"skia_use_sfntly=false " + $"skia_use_system_expat=false " + $"skia_use_system_libjpeg_turbo=false " + $"skia_use_system_libpng=false " + diff --git a/native/linux/build.cake b/native/linux/build.cake index ff72882ee87..7676b74eb25 100644 --- a/native/linux/build.cake +++ b/native/linux/build.cake @@ -97,7 +97,6 @@ Task("libSkiaSharp") $"skia_use_harfbuzz=false " + $"skia_use_icu=false " + $"skia_use_piex=true " + - $"skia_use_sfntly=false " + $"skia_use_system_expat=false " + $"skia_use_system_freetype2=false " + $"skia_use_system_libjpeg_turbo=false " + diff --git a/native/macos/build.cake b/native/macos/build.cake index cf83e7538b3..05929c831d6 100644 --- a/native/macos/build.cake +++ b/native/macos/build.cake @@ -34,7 +34,6 @@ Task("libSkiaSharp") $"skia_use_icu=false " + $"skia_use_metal=true " + $"skia_use_piex=true " + - $"skia_use_sfntly=false " + $"skia_use_system_expat=false " + $"skia_use_system_libjpeg_turbo=false " + $"skia_use_system_libpng=false " + diff --git a/native/tizen/build.cake b/native/tizen/build.cake index 1c22e96ae4b..508991e0bbd 100644 --- a/native/tizen/build.cake +++ b/native/tizen/build.cake @@ -29,7 +29,6 @@ Task("libSkiaSharp") $"skia_use_harfbuzz=false " + $"skia_use_icu=false " + $"skia_use_piex=true " + - $"skia_use_sfntly=false " + $"skia_use_system_expat=false " + $"skia_use_system_freetype2=true " + $"skia_use_system_libjpeg_turbo=false " + diff --git a/native/tvos/build.cake b/native/tvos/build.cake index 7bc4f7bbb37..f66730ffdbc 100644 --- a/native/tvos/build.cake +++ b/native/tvos/build.cake @@ -41,7 +41,6 @@ Task("libSkiaSharp") $"skia_use_icu=false " + $"skia_use_metal=true " + $"skia_use_piex=true " + - $"skia_use_sfntly=false " + $"skia_use_system_expat=false " + $"skia_use_system_libjpeg_turbo=false " + $"skia_use_system_libpng=false " + diff --git a/native/wasm/build.cake b/native/wasm/build.cake index 8256df7d89d..11b595b52d9 100644 --- a/native/wasm/build.cake +++ b/native/wasm/build.cake @@ -47,7 +47,6 @@ Task("libSkiaSharp") $"skia_use_harfbuzz=false " + $"skia_use_icu=false " + $"skia_use_piex=false " + - $"skia_use_sfntly=false " + $"skia_use_expat=true " + $"skia_use_libwebp_encode=true " + $"skia_use_system_expat=false " + diff --git a/native/windows/build.cake b/native/windows/build.cake index c3c5367990c..7ef31c1271e 100644 --- a/native/windows/build.cake +++ b/native/windows/build.cake @@ -66,7 +66,6 @@ Task("libSkiaSharp") $"skia_use_harfbuzz=false " + $"skia_use_icu=false " + $"skia_use_piex=true " + - $"skia_use_sfntly=false " + $"skia_use_system_expat=false " + $"skia_use_system_libjpeg_turbo=false " + $"skia_use_system_libpng=false " + diff --git a/scripts/VERSIONS.txt b/scripts/VERSIONS.txt index a9fe699ff8c..42b760095fc 100644 --- a/scripts/VERSIONS.txt +++ b/scripts/VERSIONS.txt @@ -1,6 +1,6 @@ # native sources harfbuzz release 8.3.1 -skia release m119 +skia release m132 ANGLE release chromium/6275 # product dependencies @@ -48,18 +48,18 @@ xunit.runner.console release 2.4.2 # this is related to the API versions, not the library versions # - milestone: the skia milestone determined by Google/Chromium # - increment: the C API version increment caused by new APIs (externals\skia\include\c\sk_types.h) -libSkiaSharp milestone 119 +libSkiaSharp milestone 132 libSkiaSharp increment 0 # native sonames # ..0 -libSkiaSharp soname 119.0.0 +libSkiaSharp soname 132.0.0 # 0.<60000 + major*100 + minor*10 + micro>.0 HarfBuzz soname 0.60831.0 # SkiaSharp.dll -SkiaSharp assembly 3.119.0.0 -SkiaSharp file 3.119.4.0 +SkiaSharp assembly 3.132.0.0 +SkiaSharp file 3.132.0.0 # HarfBuzzSharp.dll HarfBuzzSharp assembly 1.0.0.0 @@ -67,36 +67,36 @@ HarfBuzzSharp file 8.3.1.5 # nuget versions # SkiaSharp -SkiaSharp nuget 3.119.4 -SkiaSharp.NativeAssets.Linux nuget 3.119.4 -SkiaSharp.NativeAssets.Linux.NoDependencies nuget 3.119.4 -SkiaSharp.NativeAssets.NanoServer nuget 3.119.4 -SkiaSharp.NativeAssets.WebAssembly nuget 3.119.4 -SkiaSharp.NativeAssets.Android nuget 3.119.4 -SkiaSharp.NativeAssets.iOS nuget 3.119.4 -SkiaSharp.NativeAssets.MacCatalyst nuget 3.119.4 -SkiaSharp.NativeAssets.macOS nuget 3.119.4 -SkiaSharp.NativeAssets.Tizen nuget 3.119.4 -SkiaSharp.NativeAssets.tvOS nuget 3.119.4 -SkiaSharp.NativeAssets.Win32 nuget 3.119.4 -SkiaSharp.NativeAssets.WinUI nuget 3.119.4 -SkiaSharp.Views nuget 3.119.4 -SkiaSharp.Views.Desktop.Common nuget 3.119.4 -SkiaSharp.Views.Gtk3 nuget 3.119.4 -SkiaSharp.Views.Gtk4 nuget 3.119.4 -SkiaSharp.Views.WindowsForms nuget 3.119.4 -SkiaSharp.Views.WPF nuget 3.119.4 -SkiaSharp.Views.Uno.WinUI nuget 3.119.4 -SkiaSharp.Views.WinUI nuget 3.119.4 -SkiaSharp.Views.Maui.Core nuget 3.119.4 -SkiaSharp.Views.Maui.Controls nuget 3.119.4 -SkiaSharp.Views.Blazor nuget 3.119.4 -SkiaSharp.HarfBuzz nuget 3.119.4 -SkiaSharp.Skottie nuget 3.119.4 -SkiaSharp.SceneGraph nuget 3.119.4 -SkiaSharp.Resources nuget 3.119.4 -SkiaSharp.Vulkan.SharpVk nuget 3.119.4 -SkiaSharp.Direct3D.Vortice nuget 3.119.4 +SkiaSharp nuget 3.132.0 +SkiaSharp.NativeAssets.Linux nuget 3.132.0 +SkiaSharp.NativeAssets.Linux.NoDependencies nuget 3.132.0 +SkiaSharp.NativeAssets.NanoServer nuget 3.132.0 +SkiaSharp.NativeAssets.WebAssembly nuget 3.132.0 +SkiaSharp.NativeAssets.Android nuget 3.132.0 +SkiaSharp.NativeAssets.iOS nuget 3.132.0 +SkiaSharp.NativeAssets.MacCatalyst nuget 3.132.0 +SkiaSharp.NativeAssets.macOS nuget 3.132.0 +SkiaSharp.NativeAssets.Tizen nuget 3.132.0 +SkiaSharp.NativeAssets.tvOS nuget 3.132.0 +SkiaSharp.NativeAssets.Win32 nuget 3.132.0 +SkiaSharp.NativeAssets.WinUI nuget 3.132.0 +SkiaSharp.Views nuget 3.132.0 +SkiaSharp.Views.Desktop.Common nuget 3.132.0 +SkiaSharp.Views.Gtk3 nuget 3.132.0 +SkiaSharp.Views.Gtk4 nuget 3.132.0 +SkiaSharp.Views.WindowsForms nuget 3.132.0 +SkiaSharp.Views.WPF nuget 3.132.0 +SkiaSharp.Views.Uno.WinUI nuget 3.132.0 +SkiaSharp.Views.WinUI nuget 3.132.0 +SkiaSharp.Views.Maui.Core nuget 3.132.0 +SkiaSharp.Views.Maui.Controls nuget 3.132.0 +SkiaSharp.Views.Blazor nuget 3.132.0 +SkiaSharp.HarfBuzz nuget 3.132.0 +SkiaSharp.Skottie nuget 3.132.0 +SkiaSharp.SceneGraph nuget 3.132.0 +SkiaSharp.Resources nuget 3.132.0 +SkiaSharp.Vulkan.SharpVk nuget 3.132.0 +SkiaSharp.Direct3D.Vortice nuget 3.132.0 # HarfBuzzSharp HarfBuzzSharp nuget 8.3.1.5 HarfBuzzSharp.NativeAssets.Android nuget 8.3.1.5 diff --git a/scripts/azure-templates-variables.yml b/scripts/azure-templates-variables.yml index 7b79d03ff7e..c3209b711f4 100644 --- a/scripts/azure-templates-variables.yml +++ b/scripts/azure-templates-variables.yml @@ -1,6 +1,6 @@ variables: SKIASHARP_MAJOR_VERSION: 3 - SKIASHARP_VERSION: 3.119.4 + SKIASHARP_VERSION: 3.132.0 FEATURE_NAME_PREFIX: 'feature/' VERBOSITY: normal GIT_SHA: $(Build.SourceVersion) diff --git a/scripts/cake/native-shared.cake b/scripts/cake/native-shared.cake index e4a926095fc..bcf39345a0d 100644 --- a/scripts/cake/native-shared.cake +++ b/scripts/cake/native-shared.cake @@ -38,7 +38,8 @@ Task("git-sync-deps") if (actualIncrement != expectedIncrement) throw new Exception($"The libSkiaSharp C API version did not match the expected '{expectedIncrement}', instead was '{actualIncrement}'."); - RunPython(SKIA_PATH, SKIA_PATH.CombineWithFilePath("tools/git-sync-deps")); + RunPython(SKIA_PATH, SKIA_PATH.CombineWithFilePath("tools/git-sync-deps"), + envVars: new Dictionary { ["GIT_SYNC_DEPS_SKIP_EMSDK"] = "1" }); }); //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -170,11 +171,12 @@ void CheckLinuxDependencies(FilePath so, string[] excluded = null, string[] incl // HELPERS //////////////////////////////////////////////////////////////////////////////////////////////////// -void RunPython(DirectoryPath working, FilePath script, string args = "") +void RunPython(DirectoryPath working, FilePath script, string args = "", IDictionary envVars = null) { RunProcess(PYTHON_EXE, new ProcessSettings { Arguments = $"{script.FullPath} {args}", WorkingDirectory = working.FullPath, + EnvironmentVariables = envVars, }); } diff --git a/tests/Tests/SkiaSharp/EnumMappingsTest.cs b/tests/Tests/SkiaSharp/EnumMappingsTest.cs index 0a9462dd62b..b3c66a94853 100644 --- a/tests/Tests/SkiaSharp/EnumMappingsTest.cs +++ b/tests/Tests/SkiaSharp/EnumMappingsTest.cs @@ -43,6 +43,10 @@ public void SKColorTypeMappingsToNative(SKColorType value) Assert.Equal(SKColorTypeNative.A16Float, native); else if (value == SKColorType.RgF16) Assert.Equal(SKColorTypeNative.R16g16Float, native); + else if (value == SKColorType.Bgra10101010XR) + Assert.Equal(SKColorTypeNative.Bgra10101010Xr, native); + else if (value == SKColorType.RgbF16F16F16x) + Assert.Equal(SKColorTypeNative.RgbF16f16f16x, native); else Assert.Equal(value.ToString(), native.ToString(), true); } @@ -68,6 +72,10 @@ public void SKColorTypeMappingsFromNative() Assert.Equal(SKColorType.AlphaF16, managed); else if (value == SKColorTypeNative.R16g16Float) Assert.Equal(SKColorType.RgF16, managed); + else if (value == SKColorTypeNative.Bgra10101010Xr) + Assert.Equal(SKColorType.Bgra10101010XR, managed); + else if (value == SKColorTypeNative.RgbF16f16f16x) + Assert.Equal(SKColorType.RgbF16F16F16x, managed); else Assert.Equal(value.ToString(), managed.ToString(), true); } diff --git a/tests/Tests/SkiaSharp/GRContextTest.cs b/tests/Tests/SkiaSharp/GRContextTest.cs index a94d2e481c6..093a1540130 100644 --- a/tests/Tests/SkiaSharp/GRContextTest.cs +++ b/tests/Tests/SkiaSharp/GRContextTest.cs @@ -59,7 +59,9 @@ public void ToGlSizedFormat() SKColorType.Bgra1010102, SKColorType.Bgr101010x, SKColorType.Bgr101010xXR, + SKColorType.Bgra10101010XR, SKColorType.Rgba10x6, + SKColorType.RgbF16F16F16x, }; foreach (SKColorType value in Enum.GetValues(typeof(SKColorType))) diff --git a/tests/Tests/SkiaSharp/SKBitmapTest.cs b/tests/Tests/SkiaSharp/SKBitmapTest.cs index 1bb99c26feb..b83d8cfd7ac 100644 --- a/tests/Tests/SkiaSharp/SKBitmapTest.cs +++ b/tests/Tests/SkiaSharp/SKBitmapTest.cs @@ -35,8 +35,8 @@ public void CanCopyToIsCorrect(SKColorType colorType) [MemberData(nameof(GetAllColorTypes))] public void CopyToSucceeds(SKColorType colorType) { - if (colorType == SKColorType.Bgr101010xXR) - throw new SkipException("The Bgr101010xXR does not support getting pixel colors."); + if (colorType == SKColorType.Bgr101010xXR || colorType == SKColorType.Bgra10101010XR) + throw new SkipException("The Bgr101010xXR and Bgra10101010XR do not support getting pixel colors."); var alphaType = colorType.GetAlphaType(); @@ -69,8 +69,8 @@ public void CopyToSucceeds(SKColorType colorType) [MemberData(nameof(GetAllColorTypes))] public void CopyWithAlphaToSucceeds(SKColorType colorType) { - if (colorType == SKColorType.Bgr101010xXR) - throw new SkipException("The Bgr101010xXR does not support getting pixel colors."); + if (colorType == SKColorType.Bgr101010xXR || colorType == SKColorType.Bgra10101010XR) + throw new SkipException("The Bgr101010xXR and Bgra10101010XR do not support getting pixel colors."); var alphaType = colorType.GetAlphaType(); diff --git a/tests/Tests/SkiaSharp/SKColorSpaceTest.cs b/tests/Tests/SkiaSharp/SKColorSpaceTest.cs index 78a29cdd1f8..f4fb9826fae 100644 --- a/tests/Tests/SkiaSharp/SKColorSpaceTest.cs +++ b/tests/Tests/SkiaSharp/SKColorSpaceTest.cs @@ -170,10 +170,10 @@ void CheckExistingImage(int expected, SKImage image, IntPtr csh) Assert.Equal(expected, csh.GetReferenceCount(false)); var info = peek.Info; - Assert.Equal(4, csh.GetReferenceCount(false)); + Assert.InRange(csh.GetReferenceCount(false), expected, expected + 1); var cs = info.ColorSpace; - Assert.Equal(4, csh.GetReferenceCount(false)); + Assert.InRange(csh.GetReferenceCount(false), expected, expected + 1); Assert.NotNull(cs); } diff --git a/tests/Tests/SkiaSharp/SKFontManagerTest.cs b/tests/Tests/SkiaSharp/SKFontManagerTest.cs index 2970dd67124..83684a85497 100644 --- a/tests/Tests/SkiaSharp/SKFontManagerTest.cs +++ b/tests/Tests/SkiaSharp/SKFontManagerTest.cs @@ -255,9 +255,13 @@ public unsafe void TypefaceAndFontManagerReturnsSameObject() { var fonts = SKFontManager.Default; - var tf1 = fonts.MatchFamily("Times New Roman"); - var tf2 = SKTypeface.FromFamilyName("Times New Roman"); + // Use a font family known to exist on the current platform + var familyName = DefaultFontFamily; + var tf1 = fonts.MatchFamily(familyName); + var tf2 = SKTypeface.FromFamilyName(familyName); + + Assert.NotNull(tf1); Assert.Same(tf1, tf2); } diff --git a/tests/Tests/SkiaSharp/SKFontTest.cs b/tests/Tests/SkiaSharp/SKFontTest.cs index 5fd354bb6be..d8e31d4a328 100644 --- a/tests/Tests/SkiaSharp/SKFontTest.cs +++ b/tests/Tests/SkiaSharp/SKFontTest.cs @@ -494,7 +494,17 @@ public void CanSetTypefacesWithoutCrashing(string fontfile) using var typeface = SKTypeface.FromFile(Path.Combine(PathToFonts, fontfile)); font.Typeface = typeface; - Assert.Same(typeface, font.Typeface); + // In Skia m132, attempting to load woff2 files will still create a non-null typeface + // with an empty family name + if (typeface == null || string.IsNullOrEmpty(typeface?.FamilyName)) + { + var result = font.Typeface; + Assert.True(result == null || ReferenceEquals(result, typeface) || string.IsNullOrEmpty(result?.FamilyName)); + } + else + { + Assert.Same(typeface, font.Typeface); + } } } } diff --git a/tests/Tests/SkiaSharp/SKImageTest.cs b/tests/Tests/SkiaSharp/SKImageTest.cs index 9dd8c92cff3..85a3cce9344 100644 --- a/tests/Tests/SkiaSharp/SKImageTest.cs +++ b/tests/Tests/SkiaSharp/SKImageTest.cs @@ -382,7 +382,7 @@ public unsafe void DataInstanceIsCorrectlyDisposedWhenPassed() Assert.Equal(1, input.GetReferenceCount()); var image = SKImage.FromEncodedData(input); - Assert.Equal(3, input.GetReferenceCount()); + Assert.Equal(2, input.GetReferenceCount()); Assert.False(released, "Data was disposed too soon."); image.Dispose(); @@ -470,7 +470,7 @@ SKImage DoWork(out IntPtr handle) handle = input.Handle; var img = SKImage.FromEncodedData(input); - Assert.Equal(3, input.GetReferenceCount()); + Assert.Equal(2, input.GetReferenceCount()); Assert.False(released, "Data was disposed too soon."); var result = img.Encode(); @@ -525,7 +525,7 @@ IntPtr DoWork() var handle = input.Handle; var img = SKImage.FromEncodedData(input); - Assert.Equal(3, input.GetReferenceCount()); + Assert.Equal(2, input.GetReferenceCount()); Assert.False(released, "Data was disposed too soon."); img.Dispose(); diff --git a/tests/Tests/SkiaSharp/SKPaintTest.cs b/tests/Tests/SkiaSharp/SKPaintTest.cs index 37c83035246..53a3476ed1b 100644 --- a/tests/Tests/SkiaSharp/SKPaintTest.cs +++ b/tests/Tests/SkiaSharp/SKPaintTest.cs @@ -720,7 +720,17 @@ public void CanSetTypefacesWithoutCrashing(string fontfile) using var typeface = SKTypeface.FromFile(Path.Combine(PathToFonts, fontfile)); paint.Typeface = typeface; - Assert.Same(typeface, paint.Typeface); + // In Skia m132, attempting to load woff2 files will still create a non-null typeface + // with an empty family name + if (typeface == null || string.IsNullOrEmpty(typeface?.FamilyName)) + { + var result = paint.Typeface; + Assert.True(result == null || ReferenceEquals(result, typeface) || string.IsNullOrEmpty(result?.FamilyName)); + } + else + { + Assert.Same(typeface, paint.Typeface); + } } [SkippableFact]