Skip to content

[skia-sync] Update skia to milestone 148 - #4125

Merged
mattleibow merged 13 commits into
mainfrom
mattleibow/skia-sync-m148
Jun 11, 2026
Merged

mattleibow merged 13 commits into
mainfrom
mattleibow/skia-sync-m148

Conversation

@mattleibow

@mattleibow mattleibow commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Updates the externals/skia submodule to Google Skia chrome/m148, adapts the SkiaSharp bindings, and carries the native-build and tooling fixes needed for a clean cross-platform build.

  • Base milestone: m147 → Target: m148 (submodule tip 54851b68b7)
  • Submodule companion PR: [skia-sync] Merge upstream chrome/m148 skia#250 (must merge into skiasharp first)
  • CI: AzDO build 158159 is fully green — 82/82 jobs (native across all platforms, managed builds, full test suite, and NuGet packaging).

What changed

Version files

  • scripts/VERSIONS.txt: milestone → 148, soname/assembly/file/all nuget lines → 4.148.0, increment reset to 0.
  • cgmanifest.json: commitHash, chrome/m148, chrome_milestone: 148, upstream_merge_commit → 54851b68b7.

C API (submodule, PR #250)

  • m148 inserted kR16_float_SkColorType mid-enum (after kA16_float), renumbering subsequent SkColorType values. Mirrored with R16_FLOAT_SK_COLORTYPE in sk_colortype_t + a static_assert in sk_enums.cpp.

Bindings

  • Regenerated SkiaApi.generated.cs: SKColorTypeNative.R16Float = 21 inserted, later values renumbered (name-based EnumMappings stay valid).
  • Exposed the new type as public SKColorType.RedF16 = 28 (next free value → ABI-safe; existing values unchanged).
  • Updated all six exhaustive SKColorType switches: GetBytesPerPixel (2), GetBitShiftPerPixel (1), GetAlphaType (opaque), ToNative/FromNative (↔ R16Float), ToGlSizedFormat (R16F).
  • Added enum-mapping test coverage for the RedF16 ↔ R16Float name mismatch.

Native build fixes

  • WASM (native/wasm/build.cake): m148 emscripten emits archives as *.wasm.a (was *.a.wasm); updated the merge glob and the libHarfBuzzSharp copy so the WASM build links again. Builds against the external emsdk (in-tree emsdk stays commented out in DEPS).
  • Mac Catalyst & Linux fontconfig: fixed via submodule patches (see Bind the rest of SKImage #250) — Apple toolchain restored, and the fontconfig fontmgr dependency the C API needs on Linux re-guarded.

Tooling / infra cleanup

  • Dropped redundant GIT_SYNC_DEPS_SKIP_EMSDK from native-shared.cake. The fork's bin/activate-emsdk no-op patch already makes activation a guaranteed no-op when the in-tree emsdk is absent, so the env var no longer did anything. Documented in update-skia/references/known-gotchas.md.
  • Fixed the review-skia-update skill (run_review.py): it called dotnet cake --target=git-sync-deps from the repo root, but that target is only defined in the per-platform native cake files — so it always failed "target not found". Now invokes tools/git-sync-deps directly from the submodule.

Breaking change analysis

Only one m148 change affects our C API (the color-type enum insertion). SkEventTracer (leakTracer removed / new onExit()), SkImages::WrapTexture, mock calls moving out of GrBackendSurface.h, and the additive SkDeserialProcs/SkBitmap private changes were validated as having no C API impact. Independently validated — no missed items.

Merge order

  1. Merge [skia-sync] Merge upstream chrome/m148 skia#250 into skiasharp.
  2. Update this PR's submodule pointer to that merge SHA.
  3. Merge this PR into main.

Note: this branch is currently a few commits behind main; rebase/merge main before the final submodule-pointer bump.

Updates the externals/skia submodule to chrome/m148 and adapts SkiaSharp:

- Bump milestone to 148 across VERSIONS.txt and cgmanifest.json (increment 0)
- Regenerate SkiaApi.generated.cs: SKColorTypeNative gains R16Float and
  renumbers subsequent values to match the m148 SkColorType enum
- Expose the new color type as public SKColorType.RedF16 (additive, ABI-safe)
  with byte-size, bit-shift, alpha-type, native and GL-format mappings
- Add enum-mapping test coverage for the RedF16 <-> R16Float name mismatch

Companion submodule PR: mono/skia#250

Co-authored-by: Copilot <[email protected]>
@github-actions

github-actions Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4125

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4125"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-4125/packages --name skiasharp-pr-4125
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-4125

mattleibow and others added 2 commits June 8, 2026 21:11
Advance the externals/skia submodule to include the restored Mac Catalyst
Apple toolchain selection (mono/skia: e238c61a97), and point cgmanifest.json
at the same commit.

The upstream m148 toolchain refactor caused Mac Catalyst to use the Linux
archiver/linker path; the submodule commit restores the Apple (libtool /
-install_name / .dylib) behavior so the maccatalyst framework builds.

Co-authored-by: Copilot <[email protected]>
Bump skia submodule to 28dddae371 which skips in-tree emsdk activation when
using an external emsdk (the activate action added in m148).

m148 also changed the wasm static-lib output extension from .a.wasm to .wasm.a.
Adapt native/wasm/build.cake to the new upstream naming (glob *.wasm.a for the
merge step and copy libHarfBuzzSharp.wasm.a) rather than patching the upstream
toolchain, keeping the submodule closer to vanilla Skia.

Co-authored-by: Copilot <[email protected]>
@github-actions

github-actions Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation for this PR has been deployed and is available at:

🔗 View Staging Site
🔗 View Staging Docs
🔗 View Staging Gallery (Blazor)
🔗 View Staging Gallery (Uno Platform)
🔗 View Staging SkiaFiddle

This preview will be updated automatically when you push new commits to this PR.


This comment is automatically updated by the documentation staging workflow.

mattleibow and others added 7 commits June 9, 2026 18:14
Updates externals/skia to da8c325ec3, which restores the :fontmgr_fontconfig
dependency on :core so SkiaSharp's C API sees SK_FONTMGR_FONTCONFIG_AVAILABLE
on Linux. Fixes 244 Linux font-test failures (empty default font manager)
introduced by the m148 merge.

Co-authored-by: Copilot <[email protected]>
Pull the externals/skia branch up to the current upstream/chrome/m148 tip
(a48e9118d9), which advanced two commits past our original merge point with
post-cut bug fixes:

  * a48e9118d9 [m148] Reject Slugs that have creationMatrix with perspective
  * 3646e4efab Turn off LCD in SDF slugs when downscaling too far

These touch AtlasTextOp.cpp, SDFTextLCDRenderStep.cpp, SubRunContainer.cpp,
and SlugTest.cpp. We previously matched the milestone cut exactly; absorbing
these keeps us current with the m148 branch and clears false-positive
'upstream divergence' flags in the skia-update review (which diffs against the
live milestone tip).

Updates cgmanifest commitHash to 92dfce6a68 and upstream_merge_commit to
a48e9118d9.

Co-authored-by: Copilot <[email protected]>
The orchestrator synced Skia's third-party DEPS (harfbuzz, freetype, etc.)
with 'dotnet cake --target=git-sync-deps' run from the repo root. That target
is only defined in scripts/infra/native/shared/native-shared.cake, which is
#load-ed exclusively by the per-platform native/*/build.cake files — never by
the root build.cake. From the repo root the target does not exist, so the step
failed with:

    Error: The target 'git-sync-deps' was not found.

This was latent: earlier runs happened to die first at the 'working tree dirty'
pre-flight check (a dirty externals/depot_tools submodule), so the deps step
was never reached until now.

Call Skia's tools/git-sync-deps directly from the submodule instead. The cake
wrapper's only added behavior was a milestone/increment version check (already
covered by the orchestrator's Phase 1 milestone validation); the emsdk
activation step is a no-op for this fork because the in-tree emsdk is not
fetched by DEPS, so bin/activate-emsdk returns early.

Co-authored-by: Copilot <[email protected]>
The git-sync-deps cake task set GIT_SYNC_DEPS_SKIP_EMSDK=1 to avoid the
activate-emsdk step that upstream added to tools/git-sync-deps in m121+. That
env var was a workaround from before the fork patched bin/activate-emsdk
(skia commit 28dddae371) to return early when there is no in-tree emsdk.

Since this fork comments out emsdk in DEPS and builds WASM against an external,
pre-activated emsdk (skia_emsdk_dir), third_party/externals/emsdk is never
fetched, so bin/activate-emsdk is already a guaranteed no-op for every caller.
The env var is therefore redundant. Drop it from native-shared.cake and update
the update-skia known-gotchas reference accordingly.

Verified: 'dotnet cake native/macos/build.cake --target=git-sync-deps' and a
direct 'python3 tools/git-sync-deps' both complete cleanly (exit 0) without the
env var.

Co-authored-by: Copilot <[email protected]>
Advance externals/skia to the current upstream/chrome/m148 tip (54851b68b7),
one commit past our previous merge point:

  * 54851b68b7 [m148] Avoid improper mask formats for SDFT runs

Touches SubRunContainer.cpp and SlugTest.cpp. Keeps the fork level with the
m148 branch and clears the corresponding 'upstream divergence' flags in the
skia-update review (which diffs against the live milestone tip).

Updates cgmanifest commitHash to 641164ea1c and upstream_merge_commit to
54851b68b7.

Co-authored-by: Copilot <[email protected]>
Picks up the submodule change that syncs modules/skcms/version.sha1 to the
upstream chrome/m148 value (92c79500bad2). The vendored skcms source was
already identical; this only corrects the recorded provenance revision that
had drifted to an older main-lineage autoroll value during the milestone
merge. Updates cgmanifest commitHash to 0baca362ab; upstream_merge_commit is
unchanged (still 54851b68b7, the last upstream tip merged).

Co-authored-by: Copilot <[email protected]>
Picks up the submodule cleanup that deletes the duplicate
relnotes/event_tracer_leaking.md (its content already lives in
RELEASE_NOTES.md), aligning relnotes/ with upstream chrome/m148. Updates
cgmanifest commitHash to 54e5d913d6; upstream_merge_commit unchanged
(54851b68b7).

Co-authored-by: Copilot <[email protected]>
mattleibow added a commit to mono/skia that referenced this pull request Jun 10, 2026
[skia] Merge upstream chrome/m148 (#250)

Changes: google/skia@4c9e500...54851b6
Companion: mono/SkiaSharp#4125

Advance the `skiasharp` fork from Google Skia m147 (4c9e500) to the
m148 release branch. This is a two-parent merge against upstream
`chrome/m148` (tip 54851b6) so upstream `git blame` attribution is
preserved. The branch was re-merged to the moving m148 tip twice during
review (92dfce6, 641164e) to stay level with late cherry-picks
(Slug/SDFT mask-format fixes); only those merges touch the affected
upstream files.

~~ Breaking changes (m147 -> m148) ~~

Only one upstream change reaches our C API shim:

  * kR16_float_SkColorType was inserted mid-enum in SkColorType.h (after
    kA16_float), renumbering every subsequent value. Mirrored in the C
    API as R16_FLOAT_SK_COLORTYPE in sk_colortype_t, pinned with a
    static_assert in sk_enums.cpp so future enum drift fails the build.

Validated as no C API impact: SkEventTracer (leakTracer removed, new
onExit() — m148 now leaks the tracer, matching our prior fork patch, so
we took upstream), SkImages::WrapTexture losing its SkColorType arg
(we use Borrow/AdoptTextureFrom), mock calls moving to
GrMockBackendSurface.h, and the additive SkDeserialProcs / SkBitmap
private-field changes.

~~ Fork patches carried on top of the merge ~~

  * Add R16_FLOAT_SK_COLORTYPE to the C API (48aab63).
  * Restore the Mac Catalyst Apple toolchain clobbered by the merge
    (e238c61).
  * Restore the fontconfig fontmgr dependency the SkiaSharp C API needs
    on Linux — re-guarded under skia_enable_fontmgr_fontconfig in the
    core source_set (da8c325).
  * Make in-tree emsdk activation a no-op when the external emsdk is in
    use, so tools/git-sync-deps no longer needs GIT_SYNC_DEPS_SKIP_EMSDK
    (28dddae).

~~ Conflict / divergence cleanup ~~

  * Kept ours (fork-managed pins): DEPS, third_party/harfbuzz/BUILD.gn.
  * Took upstream: RELEASE_NOTES.md, infra/bots/tasks.json,
    SkEventTracer.{h,cpp}, src/gpu/graphite/mtl/MtlCaps.mm.
  * modules/skcms/version.sha1: realigned to upstream m148
    (92c79500) — the merge had kept our stale main-lineage value
    (24b120). The vendored skcms source is byte-identical either way;
    version.sha1 is only an autoroll provenance marker, so this just
    removes confusing metadata drift (0baca36).
  * Removed relnotes/event_tracer_leaking.md — upstream consolidated the
    standalone relnotes into RELEASE_NOTES.md (fe2718d) and our merge
    kept a stale duplicate; the content is preserved verbatim there
    (54e5d91).

Companion SkiaSharp PR #4125 is green across the full CI matrix
(AzDO build 158159, 82/82 jobs).

Co-authored-by: Matthew Leibowitz <[email protected]>
Co-authored-by: Copilot <[email protected]>
mattleibow and others added 2 commits June 11, 2026 01:36
PR mono/skia#250 ([skia] Merge upstream chrome/m148) merged into the
skiasharp branch as 1a155bae3a. Point the submodule at that merge
commit and update cgmanifest.json accordingly. Tree content is
identical to the previous fork tip (54e5d913d6); this just moves the
pointer onto the merged, blessed skiasharp history.

upstream_merge_commit is unchanged (54851b68b7) — no new upstream code.

Co-authored-by: Copilot <[email protected]>
The m148 binding added kR16_float_SkColorType as public SKColorType.RedF16.
That spelled-out 'Red' breaks the enum's convention: the red channel is
abbreviated 'R' everywhere else (R8Unorm, R16Unorm, RgF16, Rgba*, Rgb*),
and only alpha is ever spelled out (because there is no bare 'A').

The directly analogous sibling is RgF16 (kR16G16_float -> Rg + F16), so the
single red-channel float should be RF16. Rename before it ships so the public
surface stays consistent. Value (= 28) and the RF16 <-> R16Float native
mapping are unchanged, so this is ABI-neutral for the unreleased m148 type.

Co-authored-by: Copilot <[email protected]>
@mattleibow
mattleibow marked this pull request as ready for review June 10, 2026 23:57
@mattleibow
mattleibow merged commit 476b0e6 into main Jun 11, 2026
5 of 6 checks passed
@mattleibow
mattleibow deleted the mattleibow/skia-sync-m148 branch June 11, 2026 11:03
mattleibow added a commit that referenced this pull request Jun 11, 2026
Fix SKIASHARP_VERSION yaml missed by the m148 bump (#4144)

Context: #4125
Context: #3247
Context: #3574

The m148 milestone bump (#4125) updated every version number in
scripts/VERSIONS.txt to 4.148.0 but left scripts/azure-templates-variables.yml
at SKIASHARP_VERSION: 4.147.0 — even though that variable's own comment requires
it to match the nuget version in VERSIONS.txt. It is a compile-time constant
feeding the BUILD_NUMBER counter expression and cannot be derived dynamically,
so the stale value silently mismatches the rest of the release.

This was not a manual oversight: the update-skia Phase 6 script
(.agents/skills/update-skia/scripts/update-versions.ps1) was pointed at a file
that no longer exists. #3247 moved SKIASHARP_VERSION out of the deleted
scripts/azure-pipelines-variables.yml into scripts/azure-templates-variables.yml
(Apr 2025). When the script was authored in #3574 (Mar 2026) it referenced the
old, already-deleted filename, and its `Test-Path ... else { skip }` guard made
the miss invisible — so the m148 run skipped the file with no error and no gate
failure.

~~ The fix ~~

  * Bump SKIASHARP_VERSION to 4.148.0 in scripts/azure-templates-variables.yml.
  * Repoint update-versions.ps1 Step 3 at scripts/azure-templates-variables.yml,
    replace only the SKIASHARP_VERSION line via a targeted regex, and hard-fail
    (Write-Error) if the file is missing instead of silently skipping — a future
    rename now breaks loudly.
  * Replace the stale-only verification (which merely checked the old milestone
    number was gone) with a positive assertion that SKIASHARP_VERSION exactly
    equals the target nuget version. Per GPT-5.5 review the old check would have
    falsely passed if the value were stuck on a different milestone (e.g.
    4.146.0, where the replace is a no-op) or carried a suffix (4.147.0-preview.2
    -> 4.148.0-preview.2 no longer contains 147).
  * Update SKILL.md and references/typical-changes.md to the correct filename.

Verified: PowerShell parses clean; simulated the gate against 4.146.0 (fails as
expected) and 4.147.0 (passes at 4.148.0).

Co-authored-by: Matthew Leibowitz <[email protected]>
Co-authored-by: Copilot <[email protected]>
@mattleibow mattleibow added this to the 4.148.0-rc.1 milestone Jun 15, 2026
@mattleibow mattleibow added the type/milestone-bump Bumps the bundled Skia to a new Chrome/Skia milestone (upstream version sync). label Jul 2, 2026
@mattleibow mattleibow added the type/milestone-sync Any Skia upstream sync PR (milestone bump, same-milestone bug-fix re-sync, or tip sync). label Jul 3, 2026
@mattleibow mattleibow added the partner/agentic-workflows Issues and PRs created by SkiaSharp agentic workflows. label Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

partner/agentic-workflows Issues and PRs created by SkiaSharp agentic workflows. type/milestone-bump Bumps the bundled Skia to a new Chrome/Skia milestone (upstream version sync). type/milestone-sync Any Skia upstream sync PR (milestone bump, same-milestone bug-fix re-sync, or tip sync).

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant