Skip to content

[release/10.0.1xx-sr10] Update SkiaSharp to 4.150.1 - #37731

Merged
kubaflo merged 3 commits into
dotnet:vs/10.0.101from
kubaflo:release-agent/sr10-skia-4.150.1
Aug 22, 2026
Merged

kubaflo merged 3 commits into
dotnet:vs/10.0.101from
kubaflo:release-agent/sr10-skia-4.150.1

Conversation

@kubaflo

@kubaflo kubaflo commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

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.

Validation

  • The target-relative diff is 17 files, 73 insertions, and 84 deletions.
  • Microsoft.Maui.BuildTasks.slnf builds successfully with zero errors.
  • Graphics.Skia.csproj builds all target frameworks with warnings as errors and zero warnings/errors.
  • All 372 Graphics.Tests pass under the normal warnings-as-errors configuration.
  • All 339 focused ResizetizeImagesTests pass.

Release risk

_SkiaSharpNativeAssetsVersion remains 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.

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
Copilot AI lite review requested due to automatic review settings August 21, 2026 21:49
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 21, 2026 21:49 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37731

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37731"

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 21, 2026 21:49 — with GitHub Actions Inactive
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@kubaflo

kubaflo commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 21, 2026 21:54 — with GitHub Actions Inactive
@github-actions github-actions Bot added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Aug 21, 2026
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 21, 2026 21:55 — with GitHub Actions Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread eng/Versions.props
<_SkiaSharpVersion>3.116.1</_SkiaSharpVersion>
<_SkiaSharpExtendedVersion>3.0.0-preview.13</_SkiaSharpExtendedVersion>
<_HarfBuzzSharpVersion>8.3.0.1</_HarfBuzzSharpVersion>
<_SkiaSharpVersion>4.150.1</_SkiaSharpVersion>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/Graphics/tests/Graphics.Tests/ImageAssert.cs

@PureWeen PureWeen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copilot AI review requested due to automatic review settings August 22, 2026 00:11
@kubaflo

kubaflo commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@PureWeen Addressed in 8b42f957c0. Migrated the 27 affected calls to the SkiaSharp 4 APIs (SKPathBuilder, explicit SKTextAlign.Left, and explicit nearest/no-mipmap SKSamplingOptions) rather than suppressing obsoletion warnings. Graphics.Skia.csproj now builds all target frameworks with zero warnings/errors under the normal warnings-as-errors configuration, and all 372 Graphics.Tests pass without overriding TreatWarningsAsErrors. The PR description and validation section are updated. Ready for re-review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated 1 comment.

Comment thread src/SingleProject/Resizetizer/src/ResizetizerPackages.projitems

@PureWeen PureWeen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copilot AI review requested due to automatic review settings August 22, 2026 01:32
@kubaflo

kubaflo commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot addressed the Resizetizer signing-list feedback in 3d05f04 by adding Svg.SceneGraph.dll and Svg.Animation.dll to 3PartySHA2. This is ready for re-review; the separate native-assets/PDB release gate remains open.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.07 to 0.2, but SkiaSharpScenarioTests.cs:43 still passes 0.07; this changed ImageAssert line 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 adding link_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 PureWeen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

kubaflo added a commit that referenced this pull request Sep 15, 2026
<!-- 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>
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants