[release/10.0.1xx-sr10] Update SkiaSharp to 4.150.1 - #37731
Conversation
Manual backport of dotnet#36255 from candidate commit 08a2078 for .NET MAUI 10.0.101. Also includes only the SkiaSharpAppIconTools.cs AddCircle compatibility hunk from dotnet#36787 (81c9eca). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1e7f77e3-4862-4b92-a662-d12b5918bb59
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37731Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37731" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Backports SkiaSharp 4.150.1 and related dependency updates to the MAUI SR10 branch, with graphics and Resizetizer compatibility changes.
Changes:
- Updates SkiaSharp, HarfBuzzSharp, Svg.Skia, and supporting packages.
- Ports graphics and Resizetizer code to newer SkiaSharp APIs.
- Refreshes SVG tests, fixtures, and rendering diagnostics.
Reviewed changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Reviewed changes |
|---|---|
src/SingleProject/Resizetizer/test/UnitTests/ResizetizeImagesTests.cs |
Updates valid and invalid SVG test coverage. |
src/SingleProject/Resizetizer/test/UnitTests/images/invalid.svg |
Adds malformed SVG test coverage. |
src/SingleProject/Resizetizer/src/TizenSplashUpdater.cs |
Removes obsolete filter-quality configuration. |
src/SingleProject/Resizetizer/src/SkiaSharpTools.cs |
Removes obsolete filter-quality configuration. |
src/SingleProject/Resizetizer/src/SkiaSharpAppIconTools.cs |
Applies the SKPath.AddCircle compatibility update. |
src/SingleProject/Resizetizer/src/ResizetizerPackages.projitems |
Packages updated SVG assemblies. |
src/Graphics/tests/Graphics.Tests/ImageAssert.cs |
Corrects threshold diagnostics; the scenario tolerance remains 0.07 despite the stated 0.2 change. |
src/Graphics/src/Graphics.Skia/SKPaintExtensions.cs |
Removes obsolete paint members. |
src/Graphics/src/Graphics.Skia/SkiaTextLayout.cs |
Ports text layout away from obsolete APIs. |
src/Graphics/src/Graphics.Skia/SkiaCanvasStateService.cs |
Updates default font setup. |
src/Graphics/src/Graphics.Skia/SkiaCanvasState.cs |
Uses SKFont for text state. |
eng/Versions.props |
Updates SkiaSharp versions; matching 4.150.1 native symbols or a release waiver is still required. |
eng/NuGetVersions.targets |
Updates SVG dependency versions. |
| <_SkiaSharpVersion>3.116.1</_SkiaSharpVersion> | ||
| <_SkiaSharpExtendedVersion>3.0.0-preview.13</_SkiaSharpExtendedVersion> | ||
| <_HarfBuzzSharpVersion>8.3.0.1</_HarfBuzzSharpVersion> | ||
| <_SkiaSharpVersion>4.150.1</_SkiaSharpVersion> |
There was a problem hiding this comment.
Agreed this must remain a release gate. The current PR body already calls it out under Release risk and explicitly requires either a matching SkiaSharp 4.150.1 native-assets/PDB build or a release-owner waiver; the human-approval review gate also prevents treating this as shippable meanwhile. There is no verified replacement build or authorized waiver for the monitor to commit, so I am leaving this thread open for the release owner.
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial review
An independent reviewer found a release-blocking regression.
❌ Build Regression — Updating _SkiaSharpVersion to 4.150.1 makes the ordinary Graphics.Skia and Graphics.Tests builds fail with 27 CS0618 errors. SkiaSharp 4.150.1 marks existing SKPath mutation methods, SKCanvas.DrawText(string, float, float, SKFont, SKPaint), and SKCanvas.DrawBitmap(..., SKPaint) obsolete, while this payload leaves their callers in SKGraphicsExtensions.cs and SkiaCanvas.cs unchanged. Directory.Build.props treats warnings as errors, and the Graphics unit-test pipeline does not override that setting.
Migrate those usages to the new SKPathBuilder, SKTextAlign, and SKSamplingOptions APIs, or add narrowly scoped servicing suppressions before this version update. This is anchored on the changed version property because the failing consumer files are outside the PR diff.
Flagged by: 3/3 reviewers after adversarial consensus.
Automated assessment complete: verified current head 9f573a85fb0272640806474ab329e50cb2e5797f; coordination sender session 20939cfd-13dd-40eb-83ee-cdb524c95e95.
Use SKPathBuilder, explicit text alignment, and explicit bitmap sampling so normal warnings-as-errors builds succeed after the package update. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d00747b7-96f3-4e7a-8dfb-e3a48db04b2d
|
@PureWeen Addressed in |
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial review
An independent reviewer found no new in-scope issues at commit 8b42f957c02e1ff8b890e61f74cefbb809397e25.
Three independent reviewers with adversarial consensus, plus the MAUI repository specialist, reviewed the SkiaSharp 4 migration, graphics behavior, package/config consumers, and Resizetizer updates. The specialist cross-platform snapshot concern and two independent concerns about sampling/path/text migration were rejected in a two-reviewer dispute pass because the current source did not establish a concrete regression.
Changed Graphics and Resizetizer test assets cover the updated SVG error path and Mac rendering baselines. Existing current-head feedback was checked and not duplicated.
Include Svg.SceneGraph and Svg.Animation in the explicit third-party signing set now that both assemblies ship in the Resizetizer package. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d00747b7-96f3-4e7a-8dfb-e3a48db04b2d
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 18 changed files in this pull request and generated no new comments.
Suppressed comments (3)
eng/Versions.props:125
- The validation summary is stale for the current head: GitHub reports 18 changed files, 75 additions, and 84 deletions, rather than the stated 17/73/84 (the extra changes include the two modified Mac baseline PNGs). Please update the PR description so the release scope is accurate.
<_SkiaSharpVersion>4.150.1</_SkiaSharpVersion>
src/Graphics/tests/Graphics.Tests/ImageAssert.cs:61
- The current PR description again says the per-scenario snapshot tolerance was raised from
0.07to0.2, butSkiaSharpScenarioTests.cs:43still passes0.07; this changedImageAssertline only corrects the diagnostic text. Please either update the scenario call/tolerance or correct the description so it matches the behavior actually implemented.
Assert.Fail($"Image was not equal. Error was {similarity.ErrorPixelPercentage}% ({similarity.AbsoluteError} pixels), which was higher than the threshold of {threshold}%. See {diffFilename}");
src/SingleProject/Resizetizer/test/UnitTests/ResizetizeImagesTests.cs:69
- Could this add a fixture containing an actual SVG
<text>element and assert successful rasterization/content, rather than only addinglink_out.svg? The package bump is needed because the older Svg.Skia path can call the SKPaint text members removed by SkiaSharp 4.x, but none of the current Resizetizer SVG fixtures contain<text>, so these tests would still pass while that MissingMethodException regression remains.
[InlineData("link_out.svg")]
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial review
An independent reviewer found no new high-confidence, in-scope issues at commit 3d05f047d86bcf3122a27255de70d1fbf52e8410.
Three independent reviewers with adversarial consensus, plus the MAUI repository specialist, reviewed the SkiaSharp 4 migration, Graphics rendering/text/path semantics, Resizetizer SVG handling, package payload/signing consumers, and the changed test assets. The path-builder ownership, SKFont migration, sampling behavior, package/signing propagation, and valid/malformed SVG coverage were verified. Existing current-head feedback was checked and not duplicated.
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change Targets **net11.0**. The automated main-to-net11.0 merge #38455 brought in the SkiaSharp 4 source changes from #37731 while retaining the older dependency and packaging definitions. Graphics.Skia therefore uses `SKPathBuilder` and the newer `DrawBitmap` overload but restores SkiaSharp 3.116.1. This breaks Windows/macOS solution builds, unit-test builds, and macOS packing; Helix monitoring and native-artifact publishing fail downstream. Restore the coordinated upgrade from #37731: - SkiaSharp 4.150.1, SkiaSharp.Extended 3.0.0, HarfBuzzSharp 14.2.1.1, and Svg.Skia 5.1.1. - Matching System.Memory, System.Buffers, and ExCSS versions. - Svg.SceneGraph and Svg.Animation version mappings, Resizetizer package contents, and third-party signing entries. With Graphics compiling, [PR build 1596609](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1596609) exposed two further Android recreation-test compilation problems. This PR also: - Aliases `Android.Content.ActivityFlags` so the new `AndroidX.Activity.ActivityFlags` type does not make intent flags ambiguous. - Shares an API-aware task-ID lookup between activity-result monitoring and the recreation test: `TaskInfo.TaskId` on Android 29+, `RecentTaskInfo.PersistentId` on Android 24–28. This preserves support for older Android versions instead of suppressing the platform warning or raising the minimum OS version. [PR build 1596661](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1596661) then reached integration testing and exposed JDK-discovery failures in macOS NativeAOT and Windows/macOS MultiProject tests. Although provisioning selected a valid JDK, Android SDK discovery still inspected broken system registrations (`java_home -X` returning empty XML) or the parent of a nested Windows JDK installation (missing `jar`). `ProvisionJdk` now publishes the validated home as `JavaSdkDirectory` in addition to `JAVA_HOME`, so downstream MSBuild processes use that JDK directly. The existing JDK validation and strict integration-test warning checks remain intact. No Graphics implementation changes, public API additions, or warning suppressions are needed. ### Issues Fixed Fixes the persistent `maui-pr` compilation failure on net11.0, observed in [build 1593297](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1593297) and [build 1594662](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1594662), plus the Android compilation and JDK-discovery blockers subsequently exposed in PR builds 1596609 and 1596661. ### Validation **Full CI: [maui-pr build 1596781](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1596781) completed successfully for head `7cbfdec35ece2ad29e072bae352fd29d3f417abb` on September 15, 2026. All 31 jobs succeeded, including Windows/macOS Debug/Release solution builds, both packaging jobs, and all integration jobs. All 48 Helix unit-test work items passed.** The previously failing JDK-sensitive integration jobs now pass: macOS AOT (18 passed), MultiProject macOS and Windows (19 passed and four existing skips each). The final Windows Build integration suite passed 84 tests with two existing skips. No tests were skipped or warning checks relaxed by this PR. Local and earlier CI evidence: - Reproduced all seven `CS0246`/`CS1501` errors with a targeted Graphics.Skia netstandard2.0 build before the change; the identical build passes afterward with zero warnings/errors. - Graphics.Tests (net11.0): 375 passed. - Resizetizer.UnitTests (net11.0): 782 passed, 2 skipped. - Resizetizer packing succeeds; the package contains all required Skia/SVG assemblies, including Svg.SceneGraph and Svg.Animation. - Confirmed restored managed/native package versions are aligned. - Reproduced both `CS0104` intent-flag errors and the `CA1416` task-ID error locally in Essentials.DeviceTests for net11.0-android; the same Debug build succeeds after the Android repair, with only existing MAUI1001 warnings. - Android API 30 emulator: all six ActivityStateManager tests passed, including all three recreation tests. The Essentials runner did not apply the requested category filter, so this run also exercised the broader suite: 386 passed, 30 ignored, and four Launcher mailto-resolution failures. Confirmed the emulator has no mailto handler. The API 24–28 task-ID fallback remains untested at runtime. - Before the JDK repair, CI build 1596661 passed both macOS solution configurations, Windows/macOS packing, and all 48 Helix unit-test work items across Windows/macOS and Debug/Release. Its iOS runtime integration cases also passed. - Ran `ProvisionJdk` locally and verified that both Azure variables contain the validated JDK home. Passed its emitted value to a fresh Android `_ResolveSdks` invocation using Azure's uppercase environment-variable convention; it selected the expected JDK even with an intentionally invalid `JAVA_HOME`. The CI agent-specific broken registrations were not reproduced locally. Local validation used the installed .NET 11 Preview 6 SDK; the successful full `maui-pr` build used the branch's RC.2 SDK. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Summary
Manual Skia payload backport for .NET MAUI 10.0.101, targeting
release/10.0.1xx-sr10.inflight/candidatecommit08a2078a086a496195f5b9b39fa0888567d4e183.3.116.1to4.150.1, HarfBuzzSharp8.3.0.1to14.2.1.1, Svg.Skia2.0.0.4to5.1.1, and the required supporting dependencies and source ports.SkiaSharpAppIconTools.csSKPath.AddCirclecompatibility hunk from Fix inflight/current build breaks (duplicate MAUIX2017, obsolete AddCircle, Assert.IsTrue) #36787 /81c9eca0f98a1b0c0f3b147d2ac120fb2444e2df.SKPathBuilder,SKTextAlign, andSKSamplingOptionsAPIs so normal warnings-as-errors builds remain clean.10.0.100to10.0.101out of this PR.Validation
Microsoft.Maui.BuildTasks.slnfbuilds successfully with zero errors.Graphics.Skia.csprojbuilds all target frameworks with warnings as errors and zero warnings/errors.Graphics.Testspass under the normal warnings-as-errors configuration.ResizetizeImagesTestspass.Release risk
_SkiaSharpNativeAssetsVersionremains unchanged. Before shipping, the release owner must confirm a matching SkiaSharp 4.150.1 native-assets/PDB build or record an explicit release waiver.Review gate
This agent-authored release PR must remain unmerged until two distinct non-bot MAUI maintainers with write access, other than the PR author, approve the current head SHA.