From b89c476c0d23a3fcab29445e722c16142b3a0927 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 7 Nov 2024 22:03:17 +0800 Subject: [PATCH 01/10] Bump skia to milestone 119 --- externals/skia | 2 +- scripts/VERSIONS.txt | 66 +++++++++++++-------------- scripts/azure-pipelines-variables.yml | 2 +- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/externals/skia b/externals/skia index 1342f89446..251a663707 160000 --- a/externals/skia +++ b/externals/skia @@ -1 +1 @@ -Subproject commit 1342f8944692d4355de3287f6d14c3a954d6773c +Subproject commit 251a663707ad8260603035f11f7629b905500112 diff --git a/scripts/VERSIONS.txt b/scripts/VERSIONS.txt index 1e715d9fa8..a61fe5996d 100644 --- a/scripts/VERSIONS.txt +++ b/scripts/VERSIONS.txt @@ -1,7 +1,7 @@ # dependencies mdoc release 5.8.9 harfbuzz release 8.3.1 -skia release m118 +skia release m119 xunit release 2.4.2 xunit.runner.console release 2.4.2 OpenTK release 3.1.0 @@ -23,18 +23,18 @@ ANGLE release chromium/6275 # 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 118 +libSkiaSharp milestone 119 libSkiaSharp increment 0 # native sonames # ..0 -libSkiaSharp soname 118.0.0 +libSkiaSharp soname 119.0.0 # 0.<60000 + major*100 + minor*10 + micro>.0 HarfBuzz soname 0.60831.0 # SkiaSharp.dll -SkiaSharp assembly 3.118.0.0 -SkiaSharp file 3.118.0.0 +SkiaSharp assembly 3.119.0.0 +SkiaSharp file 3.119.0.0 # HarfBuzzSharp.dll HarfBuzzSharp assembly 1.0.0.0 @@ -42,34 +42,34 @@ HarfBuzzSharp file 8.3.1 # nuget versions # SkiaSharp -SkiaSharp nuget 3.118.0 -SkiaSharp.NativeAssets.Linux nuget 3.118.0 -SkiaSharp.NativeAssets.Linux.NoDependencies nuget 3.118.0 -SkiaSharp.NativeAssets.NanoServer nuget 3.118.0 -SkiaSharp.NativeAssets.WebAssembly nuget 3.118.0 -SkiaSharp.NativeAssets.Android nuget 3.118.0 -SkiaSharp.NativeAssets.iOS nuget 3.118.0 -SkiaSharp.NativeAssets.MacCatalyst nuget 3.118.0 -SkiaSharp.NativeAssets.macOS nuget 3.118.0 -SkiaSharp.NativeAssets.Tizen nuget 3.118.0 -SkiaSharp.NativeAssets.tvOS nuget 3.118.0 -SkiaSharp.NativeAssets.Win32 nuget 3.118.0 -SkiaSharp.NativeAssets.WinUI nuget 3.118.0 -SkiaSharp.Views nuget 3.118.0 -SkiaSharp.Views.Desktop.Common nuget 3.118.0 -SkiaSharp.Views.Gtk3 nuget 3.118.0 -SkiaSharp.Views.WindowsForms nuget 3.118.0 -SkiaSharp.Views.WPF nuget 3.118.0 -SkiaSharp.Views.Uno.WinUI nuget 3.118.0 -SkiaSharp.Views.WinUI nuget 3.118.0 -SkiaSharp.Views.Maui.Core nuget 3.118.0 -SkiaSharp.Views.Maui.Controls nuget 3.118.0 -SkiaSharp.Views.Blazor nuget 3.118.0 -SkiaSharp.HarfBuzz nuget 3.118.0 -SkiaSharp.Skottie nuget 3.118.0 -SkiaSharp.SceneGraph nuget 3.118.0 -SkiaSharp.Resources nuget 3.118.0 -SkiaSharp.Vulkan.SharpVk nuget 3.118.0 +SkiaSharp nuget 3.119.0 +SkiaSharp.NativeAssets.Linux nuget 3.119.0 +SkiaSharp.NativeAssets.Linux.NoDependencies nuget 3.119.0 +SkiaSharp.NativeAssets.NanoServer nuget 3.119.0 +SkiaSharp.NativeAssets.WebAssembly nuget 3.119.0 +SkiaSharp.NativeAssets.Android nuget 3.119.0 +SkiaSharp.NativeAssets.iOS nuget 3.119.0 +SkiaSharp.NativeAssets.MacCatalyst nuget 3.119.0 +SkiaSharp.NativeAssets.macOS nuget 3.119.0 +SkiaSharp.NativeAssets.Tizen nuget 3.119.0 +SkiaSharp.NativeAssets.tvOS nuget 3.119.0 +SkiaSharp.NativeAssets.Win32 nuget 3.119.0 +SkiaSharp.NativeAssets.WinUI nuget 3.119.0 +SkiaSharp.Views nuget 3.119.0 +SkiaSharp.Views.Desktop.Common nuget 3.119.0 +SkiaSharp.Views.Gtk3 nuget 3.119.0 +SkiaSharp.Views.WindowsForms nuget 3.119.0 +SkiaSharp.Views.WPF nuget 3.119.0 +SkiaSharp.Views.Uno.WinUI nuget 3.119.0 +SkiaSharp.Views.WinUI nuget 3.119.0 +SkiaSharp.Views.Maui.Core nuget 3.119.0 +SkiaSharp.Views.Maui.Controls nuget 3.119.0 +SkiaSharp.Views.Blazor nuget 3.119.0 +SkiaSharp.HarfBuzz nuget 3.119.0 +SkiaSharp.Skottie nuget 3.119.0 +SkiaSharp.SceneGraph nuget 3.119.0 +SkiaSharp.Resources nuget 3.119.0 +SkiaSharp.Vulkan.SharpVk nuget 3.119.0 # HarfBuzzSharp HarfBuzzSharp nuget 8.3.1 HarfBuzzSharp.NativeAssets.Android nuget 8.3.1 diff --git a/scripts/azure-pipelines-variables.yml b/scripts/azure-pipelines-variables.yml index 754b7dc087..017a1a8b41 100644 --- a/scripts/azure-pipelines-variables.yml +++ b/scripts/azure-pipelines-variables.yml @@ -1,6 +1,6 @@ variables: SKIASHARP_MAJOR_VERSION: 3 - SKIASHARP_VERSION: 3.118.0 + SKIASHARP_VERSION: 3.119.0 FEATURE_NAME_PREFIX: 'feature/' VERBOSITY: normal GIT_SHA: $(Build.SourceVersion) From 7d4d62c761b359388c7390fdaeac308e7a5303f3 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 7 Nov 2024 22:15:20 +0800 Subject: [PATCH 02/10] SkTime::DateTime is replaced with SkPDF::DateTime --- binding/libSkiaSharp.json | 2 +- externals/skia | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/binding/libSkiaSharp.json b/binding/libSkiaSharp.json index adeb369440..48e0c26191 100644 --- a/binding/libSkiaSharp.json +++ b/binding/libSkiaSharp.json @@ -341,7 +341,7 @@ } }, // internal types - "sk_time_datetime_t": { + "sk_document_pdf_datetime_t": { "cs": "SKTimeDateTimeInternal", "internal": true }, diff --git a/externals/skia b/externals/skia index 251a663707..57030b6fc5 160000 --- a/externals/skia +++ b/externals/skia @@ -1 +1 @@ -Subproject commit 251a663707ad8260603035f11f7629b905500112 +Subproject commit 57030b6fc58fe77a9fff7d69aa6ac4507433cb0a From 9342809d53184a5ea85ef89b62deb1b65886fbab Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 7 Nov 2024 23:00:50 +0800 Subject: [PATCH 03/10] Add the new color type --- binding/SkiaSharp/Definitions.cs | 4 ++++ binding/SkiaSharp/EnumMappings.cs | 2 ++ binding/SkiaSharp/GRDefinitions.cs | 1 + 3 files changed, 7 insertions(+) diff --git a/binding/SkiaSharp/Definitions.cs b/binding/SkiaSharp/Definitions.cs index a9217f6fcf..501e4d7921 100644 --- a/binding/SkiaSharp/Definitions.cs +++ b/binding/SkiaSharp/Definitions.cs @@ -59,6 +59,7 @@ public enum SKColorType Bgr101010xXR = 21, Srgba8888 = 22, R8Unorm = 23, + Rgba10x6 = 24, } public static partial class SkiaExtensions @@ -106,6 +107,7 @@ public static int GetBytesPerPixel (this SKColorType colorType) => SKColorType.RgbaF16Clamped => 8, SKColorType.RgbaF16 => 8, SKColorType.Rgba16161616 => 8, + SKColorType.Rgba10x6 => 8, // 16 SKColorType.RgbaF32 => 16, // @@ -143,6 +145,7 @@ public static int GetBitShiftPerPixel (this SKColorType colorType) => SKColorType.RgbaF16Clamped => 3, SKColorType.RgbaF16 => 3, SKColorType.Rgba16161616 => 3, + SKColorType.Rgba10x6 => 3, // 4 SKColorType.RgbaF32 => 4, // @@ -177,6 +180,7 @@ public static SKAlphaType GetAlphaType (this SKColorType colorType, SKAlphaType case SKColorType.RgbaF16: case SKColorType.RgbaF32: case SKColorType.Rgba16161616: + case SKColorType.Rgba10x6: break; // opaque diff --git a/binding/SkiaSharp/EnumMappings.cs b/binding/SkiaSharp/EnumMappings.cs index 52f2654c21..cf0e3918c9 100644 --- a/binding/SkiaSharp/EnumMappings.cs +++ b/binding/SkiaSharp/EnumMappings.cs @@ -62,6 +62,7 @@ internal static SKColorTypeNative ToNative (this SKColorType colorType) => SKColorType.Alpha16 => SKColorTypeNative.A16Unorm, SKColorType.Rg1616 => SKColorTypeNative.R16g16Unorm, SKColorType.Rgba16161616 => SKColorTypeNative.R16g16b16a16Unorm, + SKColorType.Rgba10x6 => SKColorTypeNative.Rgb10x6, SKColorType.Bgra1010102 => SKColorTypeNative.Bgra1010102, SKColorType.Bgr101010x => SKColorTypeNative.Bgr101010x, SKColorType.Bgr101010xXR => SKColorTypeNative.Bgr101010xXr, @@ -92,6 +93,7 @@ internal static SKColorType FromNative (this SKColorTypeNative colorType) => SKColorTypeNative.A16Unorm => SKColorType.Alpha16, SKColorTypeNative.R16g16Unorm => SKColorType.Rg1616, SKColorTypeNative.R16g16b16a16Unorm => SKColorType.Rgba16161616, + SKColorTypeNative.Rgba10x6 => SKColorType.Rgba10x6 SKColorTypeNative.Bgra1010102 => SKColorType.Bgra1010102, SKColorTypeNative.Bgr101010x => SKColorType.Bgr101010x, SKColorTypeNative.Bgr101010xXr => SKColorType.Bgr101010xXR, diff --git a/binding/SkiaSharp/GRDefinitions.cs b/binding/SkiaSharp/GRDefinitions.cs index ed6c3facb0..6eeed36020 100644 --- a/binding/SkiaSharp/GRDefinitions.cs +++ b/binding/SkiaSharp/GRDefinitions.cs @@ -153,6 +153,7 @@ public static uint ToGlSizedFormat (this SKColorType colorType) => SKColorType.Alpha16 => GRGlSizedFormat.R16, SKColorType.Rg1616 => GRGlSizedFormat.RG16, SKColorType.Rgba16161616 => GRGlSizedFormat.RGBA16, + SKColorType.Rgba10x6 => 0, SKColorType.RgF16 => GRGlSizedFormat.RG16F, SKColorType.Rg88 => GRGlSizedFormat.RG8, SKColorType.Rgb101010x => 0, From 60812cd74f7a27f7a01958857ade1d65b3dd5a33 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 7 Nov 2024 23:03:58 +0800 Subject: [PATCH 04/10] Use the new SkImages::MakeWithFilter instead --- externals/skia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externals/skia b/externals/skia index 57030b6fc5..f8c48e097e 160000 --- a/externals/skia +++ b/externals/skia @@ -1 +1 @@ -Subproject commit 57030b6fc58fe77a9fff7d69aa6ac4507433cb0a +Subproject commit f8c48e097ee00001bc6d9bac9c881cdcbdb16525 From 02133158fddeea2c98921f08549c4fd19ff975ec Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 8 Nov 2024 00:48:20 +0800 Subject: [PATCH 05/10] Update the GrDirectContext APIs --- externals/skia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externals/skia b/externals/skia index f8c48e097e..69aba75b25 160000 --- a/externals/skia +++ b/externals/skia @@ -1 +1 @@ -Subproject commit f8c48e097ee00001bc6d9bac9c881cdcbdb16525 +Subproject commit 69aba75b2575c0d1f4f4ed8cc870cc9a01069aa9 From 0d3b44400055fa9fd4b4d576afde1472a5ebe654 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 8 Nov 2024 04:14:15 +0800 Subject: [PATCH 06/10] typo --- binding/SkiaSharp/EnumMappings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding/SkiaSharp/EnumMappings.cs b/binding/SkiaSharp/EnumMappings.cs index cf0e3918c9..ff23c9162c 100644 --- a/binding/SkiaSharp/EnumMappings.cs +++ b/binding/SkiaSharp/EnumMappings.cs @@ -93,7 +93,7 @@ internal static SKColorType FromNative (this SKColorTypeNative colorType) => SKColorTypeNative.A16Unorm => SKColorType.Alpha16, SKColorTypeNative.R16g16Unorm => SKColorType.Rg1616, SKColorTypeNative.R16g16b16a16Unorm => SKColorType.Rgba16161616, - SKColorTypeNative.Rgba10x6 => SKColorType.Rgba10x6 + SKColorTypeNative.Rgba10x6 => SKColorType.Rgba10x6, SKColorTypeNative.Bgra1010102 => SKColorType.Bgra1010102, SKColorTypeNative.Bgr101010x => SKColorType.Bgr101010x, SKColorTypeNative.Bgr101010xXr => SKColorType.Bgr101010xXR, From 3a6c55e6d2ea3e6135b48ee7692c5dc699b942e6 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Sat, 1 Mar 2025 20:25:04 +0800 Subject: [PATCH 07/10] regen --- binding/SkiaSharp/SkiaApi.generated.cs | 168 +++++++++++++------------ 1 file changed, 85 insertions(+), 83 deletions(-) diff --git a/binding/SkiaSharp/SkiaApi.generated.cs b/binding/SkiaSharp/SkiaApi.generated.cs index efa7515f2f..abece5aed6 100644 --- a/binding/SkiaSharp/SkiaApi.generated.cs +++ b/binding/SkiaSharp/SkiaApi.generated.cs @@ -18449,6 +18449,63 @@ public readonly override int GetHashCode () } + // sk_document_pdf_datetime_t + [StructLayout (LayoutKind.Sequential)] + internal unsafe partial struct SKTimeDateTimeInternal : IEquatable { + // public int16_t fTimeZoneMinutes + public Int16 fTimeZoneMinutes; + + // public uint16_t fYear + public UInt16 fYear; + + // public uint8_t fMonth + public Byte fMonth; + + // public uint8_t fDayOfWeek + public Byte fDayOfWeek; + + // public uint8_t fDay + public Byte fDay; + + // public uint8_t fHour + public Byte fHour; + + // public uint8_t fMinute + public Byte fMinute; + + // public uint8_t fSecond + public Byte fSecond; + + public readonly bool Equals (SKTimeDateTimeInternal obj) => +#pragma warning disable CS8909 + fTimeZoneMinutes == obj.fTimeZoneMinutes && fYear == obj.fYear && fMonth == obj.fMonth && fDayOfWeek == obj.fDayOfWeek && fDay == obj.fDay && fHour == obj.fHour && fMinute == obj.fMinute && fSecond == obj.fSecond; +#pragma warning restore CS8909 + + public readonly override bool Equals (object obj) => + obj is SKTimeDateTimeInternal f && Equals (f); + + public static bool operator == (SKTimeDateTimeInternal left, SKTimeDateTimeInternal right) => + left.Equals (right); + + public static bool operator != (SKTimeDateTimeInternal left, SKTimeDateTimeInternal right) => + !left.Equals (right); + + public readonly override int GetHashCode () + { + var hash = new HashCode (); + hash.Add (fTimeZoneMinutes); + hash.Add (fYear); + hash.Add (fMonth); + hash.Add (fDayOfWeek); + hash.Add (fDay); + hash.Add (fHour); + hash.Add (fMinute); + hash.Add (fSecond); + return hash.ToHashCode (); + } + + } + // sk_document_pdf_metadata_t [StructLayout (LayoutKind.Sequential)] internal unsafe partial struct SKDocumentPdfMetadataInternal : IEquatable { @@ -18470,10 +18527,10 @@ internal unsafe partial struct SKDocumentPdfMetadataInternal : IEquatable { - // public int16_t fTimeZoneMinutes - public Int16 fTimeZoneMinutes; - - // public uint16_t fYear - public UInt16 fYear; - - // public uint8_t fMonth - public Byte fMonth; - - // public uint8_t fDayOfWeek - public Byte fDayOfWeek; - - // public uint8_t fDay - public Byte fDay; - - // public uint8_t fHour - public Byte fHour; - - // public uint8_t fMinute - public Byte fMinute; - - // public uint8_t fSecond - public Byte fSecond; - - public readonly bool Equals (SKTimeDateTimeInternal obj) => -#pragma warning disable CS8909 - fTimeZoneMinutes == obj.fTimeZoneMinutes && fYear == obj.fYear && fMonth == obj.fMonth && fDayOfWeek == obj.fDayOfWeek && fDay == obj.fDay && fHour == obj.fHour && fMinute == obj.fMinute && fSecond == obj.fSecond; -#pragma warning restore CS8909 - - public readonly override bool Equals (object obj) => - obj is SKTimeDateTimeInternal f && Equals (f); - - public static bool operator == (SKTimeDateTimeInternal left, SKTimeDateTimeInternal right) => - left.Equals (right); - - public static bool operator != (SKTimeDateTimeInternal left, SKTimeDateTimeInternal right) => - !left.Equals (right); - - public readonly override int GetHashCode () - { - var hash = new HashCode (); - hash.Add (fTimeZoneMinutes); - hash.Add (fYear); - hash.Add (fMonth); - hash.Add (fDayOfWeek); - hash.Add (fDay); - hash.Add (fHour); - hash.Add (fMinute); - hash.Add (fSecond); - return hash.ToHashCode (); - } - - } - // sk_webpencoder_options_t [StructLayout (LayoutKind.Sequential)] public readonly unsafe partial struct SKWebpEncoderOptions : IEquatable { @@ -20281,30 +20281,32 @@ internal enum SKColorTypeNative { Bgr101010x = 10, // BGR_101010X_XR_SK_COLORTYPE = 11 Bgr101010xXr = 11, - // GRAY_8_SK_COLORTYPE = 12 - Gray8 = 12, - // RGBA_F16_NORM_SK_COLORTYPE = 13 - RgbaF16Norm = 13, - // RGBA_F16_SK_COLORTYPE = 14 - RgbaF16 = 14, - // RGBA_F32_SK_COLORTYPE = 15 - RgbaF32 = 15, - // R8G8_UNORM_SK_COLORTYPE = 16 - R8g8Unorm = 16, - // A16_FLOAT_SK_COLORTYPE = 17 - A16Float = 17, - // R16G16_FLOAT_SK_COLORTYPE = 18 - R16g16Float = 18, - // A16_UNORM_SK_COLORTYPE = 19 - A16Unorm = 19, - // R16G16_UNORM_SK_COLORTYPE = 20 - R16g16Unorm = 20, - // R16G16B16A16_UNORM_SK_COLORTYPE = 21 - R16g16b16a16Unorm = 21, - // SRGBA_8888_SK_COLORTYPE = 22 - Srgba8888 = 22, - // R8_UNORM_SK_COLORTYPE = 23 - R8Unorm = 23, + // 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, } // sk_encoded_image_format_t From 76e31d03f5476cc9d151b9104deabd68911c1886 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Sun, 2 Mar 2025 14:17:01 +0800 Subject: [PATCH 08/10] typo --- binding/SkiaSharp/EnumMappings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding/SkiaSharp/EnumMappings.cs b/binding/SkiaSharp/EnumMappings.cs index ff23c9162c..4f0ed3b3f1 100644 --- a/binding/SkiaSharp/EnumMappings.cs +++ b/binding/SkiaSharp/EnumMappings.cs @@ -62,7 +62,7 @@ internal static SKColorTypeNative ToNative (this SKColorType colorType) => SKColorType.Alpha16 => SKColorTypeNative.A16Unorm, SKColorType.Rg1616 => SKColorTypeNative.R16g16Unorm, SKColorType.Rgba16161616 => SKColorTypeNative.R16g16b16a16Unorm, - SKColorType.Rgba10x6 => SKColorTypeNative.Rgb10x6, + SKColorType.Rgba10x6 => SKColorTypeNative.Rgba10x6, SKColorType.Bgra1010102 => SKColorTypeNative.Bgra1010102, SKColorType.Bgr101010x => SKColorTypeNative.Bgr101010x, SKColorType.Bgr101010xXR => SKColorTypeNative.Bgr101010xXr, From 9b2844c196c1e3011c91ffda04421887fa7fc3db Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Tue, 4 Mar 2025 02:16:30 +0800 Subject: [PATCH 09/10] Fix tests --- tests/Tests/SkiaSharp/GRContextTest.cs | 3 ++- tests/Tests/SkiaSharp/SKBitmapTest.cs | 5 ++++ tests/Tests/SkiaSharp/SKPictureTest.cs | 25 ++++++++++++++++++++ tests/Tests/SkiaSharp/SKRuntimeEffectTest.cs | 2 +- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/tests/Tests/SkiaSharp/GRContextTest.cs b/tests/Tests/SkiaSharp/GRContextTest.cs index 52d2287bab..a94d2e481c 100644 --- a/tests/Tests/SkiaSharp/GRContextTest.cs +++ b/tests/Tests/SkiaSharp/GRContextTest.cs @@ -58,7 +58,8 @@ public void ToGlSizedFormat() SKColorType.RgbaF32, SKColorType.Bgra1010102, SKColorType.Bgr101010x, - SKColorType.Bgr101010xXR + SKColorType.Bgr101010xXR, + SKColorType.Rgba10x6, }; foreach (SKColorType value in Enum.GetValues(typeof(SKColorType))) diff --git a/tests/Tests/SkiaSharp/SKBitmapTest.cs b/tests/Tests/SkiaSharp/SKBitmapTest.cs index 57d4d3fcd0..c5ae9c5684 100644 --- a/tests/Tests/SkiaSharp/SKBitmapTest.cs +++ b/tests/Tests/SkiaSharp/SKBitmapTest.cs @@ -115,6 +115,11 @@ public void CopyWithAlphaToSucceeds(SKColorType colorType) // SRGB processing Assert.Equal((SKColor)0xAAFE0000, color); } + else if (colorType == SKColorType.Rgba10x6) + { + // alpha % is included + Assert.Equal((SKColor)0xAAAA0000, color); + } else { Assert.Equal((SKColor)0xAAFF0000, color); diff --git a/tests/Tests/SkiaSharp/SKPictureTest.cs b/tests/Tests/SkiaSharp/SKPictureTest.cs index fb6e547bb0..bf3e0a484e 100644 --- a/tests/Tests/SkiaSharp/SKPictureTest.cs +++ b/tests/Tests/SkiaSharp/SKPictureTest.cs @@ -109,5 +109,30 @@ public void CanGetApproximateBytesUsed() Assert.True(picture.ApproximateBytesUsed > 0); } + + [SkippableFact] + public void EncodesImageIntoPicture() + { + // create an image + using var sourceBitmap = CreateTestBitmap(); + + // create a picture that has an image in it + using var picRecorder = new SKPictureRecorder(); + using var picCanvas = picRecorder.BeginRecording(SKRect.Create(0, 0, 40, 40)); + picCanvas.DrawBitmap(sourceBitmap, 0, 0); + using var picture = picRecorder.EndRecording(); + + // serialize and then deserialize the picture + using var serialized = picture.Serialize(); + using var deserialized = SKPicture.Deserialize(serialized); + + // draw the picture into a new bitmap + using var desBitmap = new SKBitmap(40, 40); + using var destCanvas = new SKCanvas(desBitmap); + destCanvas.DrawPicture(deserialized); + + // make sure the bitmap made it through the serialization + ValidateTestBitmap(desBitmap); + } } } diff --git a/tests/Tests/SkiaSharp/SKRuntimeEffectTest.cs b/tests/Tests/SkiaSharp/SKRuntimeEffectTest.cs index e7465d2fbc..c783387a7f 100644 --- a/tests/Tests/SkiaSharp/SKRuntimeEffectTest.cs +++ b/tests/Tests/SkiaSharp/SKRuntimeEffectTest.cs @@ -785,7 +785,7 @@ half4 main(float2 p) { builder.Children["child"] = null; - Test(builder, 0xFF00FFFF, (c, p) => p.ColorF = new SKColorF(1.0f, 1.0f, 0.0f, 1.0f)); + Test(builder, 0x00000000, (c, p) => p.ColorF = new SKColorF(1.0f, 1.0f, 0.0f, 1.0f)); } [SkippableFact] From b13dce5665ab395f7a534e27e1a6da6cdcc9b3b3 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Tue, 4 Mar 2025 04:53:48 +0800 Subject: [PATCH 10/10] Update externals --- externals/skia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externals/skia b/externals/skia index fa299e7fd5..fba34929c3 160000 --- a/externals/skia +++ b/externals/skia @@ -1 +1 @@ -Subproject commit fa299e7fd5753086f61aba7bbf7ac80b5929724a +Subproject commit fba34929c38a88ab693768ce3e87680d49bfcc8d