Skip to content

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

Closed
mattleibow wants to merge 7 commits into
mainfrom
skia-sync/m148
Closed

[skia-sync] Update skia to milestone 148#4120
mattleibow wants to merge 7 commits into
mainfrom
skia-sync/m148

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Automated Skia milestone bump from m147 to m148.

Companion skia PR: mono/skia#248

mono/SkiaSharp — Skia m148 SkiaSharp Sync Summary

Branch: skia-sync/m148

Breaking Change Analysis

Primary Change: kR16_float_SkColorType insertion

A new color type was inserted in the SkColorType enum in Skia m148:

Ordinal m147 m148
20 kA16_float kA16_float (unchanged)
21 kR16G16_float kR16_float (NEW)
22 kA16_unorm kR16G16_float (shifted)
… (all shifted by 1)
28 kR8_unorm (was 27)

Risk: HIGH (enum ordinal shift). Fixed by adding R16_FLOAT_SK_COLORTYPE to C API with static_assert guard.

Version / Binding Updates

File Change
scripts/VERSIONS.txt milestone 147 → 148; soname 148.0.0; all NuGet version lines updated
cgmanifest.json commitHash, chrome_milestone=148, upstream_merge_commit updated
externals/skia/include/c/sk_types.h SK_C_INCREMENT reset to 0 (new milestone)

C# Changes

New public enum value: SKColorType.R16Float = 28

Added to binding/SkiaSharp/:

File Change
Definitions.cs Added R16Float = 28 to SKColorType enum
Definitions.cs GetBytesPerPixel: R16Float => 2
Definitions.cs GetBitShiftPerPixel: R16Float => 1
Definitions.cs GetAlphaType: R16Float → opaque (single-channel, no alpha)
EnumMappings.cs ToNative: SKColorType.R16Float => SKColorTypeNative.R16Float
EnumMappings.cs FromNative: SKColorTypeNative.R16Float => SKColorType.R16Float
GRDefinitions.cs ToGlSizedFormat: R16Float => GRGlSizedFormat.R16F
SkiaApi.generated.cs Regenerated: R16Float = 21 added; subsequent values shifted to match C API

Build script improvement

native/linux/build.cake: Added detection for libc++ header availability. Falls back to -stdlib=libstdc++ with -static-libstdc++ when libc++ headers are not installed (e.g., GitHub Actions runners). CI Docker images with libc++ static-only are unaffected.

Build Results

Platform Result
Linux x64 (libSkiaSharp) ✅ Success (~28 min)
Linux x64 (libHarfBuzzSharp) ✅ Success (~1 min)
C# binding ✅ Build succeeded, 0 warnings

Test Results

Category Count
Passed 5,451
Failed 61
Skipped 171
Total 5,683

Failure Analysis

All 61 failures are pre-existing environment issues, not regressions:

  • SKFontTest / SKFontManagerTest / SKFontStyleSetTest / SKTypefaceTest (~61 failures): Circular static constructor dependency between SKFontManager and SKTypeface on headless runners without proper font configuration. These fail when SKFontManager.Default is the first SKObject accessed. Unrelated to m148 changes.

R16Float-specific tests all pass (previously failed with ArgumentOutOfRangeException before fixes were applied).

Items Needing Human Attention

  1. ABI note: SKColorType ordinals R16g16Float through R8Unorm all shifted by 1. Any code that relied on the raw integer values of these enum members (e.g., serialization) would be affected. The public-facing SKColorType enum in SkiaSharp uses its own stable ordinal sequence (R16Float = 28 is appended at the end), so SkiaSharp users are protected.

  2. DEPS history note: The merge commit in externals/skia has a leftover conflict marker that was fixed in the next commit. The git history in the submodule has one intermediate commit with a broken DEPS; human reviewer should be aware.

  3. Font test environment: The 61 failing tests on the headless CI runner should be investigated separately. They represent a pre-existing issue with SKTypeface static initialization on runners without system fonts.

Created by skia-upstream-sync.

github-actions Bot and others added 5 commits June 5, 2026 14:03
- Bump milestone 147 → 148
- Update soname to 148.0.0
- Update cgmanifest.json with m148 merge commit hash and metadata
- Reset SK_C_INCREMENT to 0 for new milestone

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Added R16Float (kR16_float_SkColorType = 21) and shifted subsequent
enum values in SKColorTypeNative.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
New color type kR16_float_SkColorType was inserted in Skia m148 between
kA16_float and kR16G16_float, shifting subsequent ordinals by 1.

Changes:
- Add SKColorType.R16Float = 28 to public enum
- Add GetBytesPerPixel: R16Float => 2 bytes
- Add GetBitShiftPerPixel: R16Float => 1
- Add GetAlphaType: R16Float is opaque (single-channel, no alpha)
- Add ToNative/FromNative mappings in EnumMappings.cs
- Add ToGlSizedFormat: R16Float => GRGlSizedFormat.R16F

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
On some Linux environments (e.g., GitHub Actions runners without
libc++-dev installed), the LLVM libc++ headers are absent. This change
detects whether libc++ headers/lib are present and falls back to
-stdlib=libstdc++ with -static-libstdc++ if not. CI Docker images that
ship libc++ static-only are unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 5, 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 -- 4120

PowerShell / Windows:

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

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-4120/packages --name skiasharp-pr-4120
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-4120

Bump the externals/skia submodule to pick up the m148 toolchain fixes and
revert a Linux build regression introduced during the sync.

externals/skia (gn/toolchain/BUILD.gn):
- WASM: drop the new emsdk:activate dependency (SkiaSharp uses its own
  version-pinned emsdk via skia_emsdk_dir, not the DEPS-bundled one).
- WASM: restore the ".a.wasm"/".so.wasm" static/shared library suffixes that
  native/wasm/build.cake depends on (m148 flipped them to ".wasm.a"/".wasm.so").
- Mac Catalyst/watchOS: restore them to the Apple toolchain branch set that the
  m148 current_os refactor dropped, fixing "ar: @libzlib.a.rsp: No such file".

native/linux/build.cake:
- Revert the libc++-detection / libstdc++ fallback that the sync added. The
  .NET cross Docker images ship libc++ statically, so the detection misfired
  and fell back to libstdc++, whose headers are absent in the cross sysroot
  ("fatal error: 'cstddef' file not found"). Restore unconditional -stdlib=libc++.

native/wasm/build.cake:
- Fail fast if the "*.a.wasm" glob matches nothing (so a future archive-naming
  change can't silently produce an empty libSkiaSharp.a), and delete the stale
  merged archive before recreating it.

Verified locally in the project Docker images: Linux x64
(libSkiaSharp.so.148.0.0) and WASM emscripten 3.1.56 (16 MB merged
libSkiaSharp.a, 1292 members) both build clean.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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.

Merge a new upstream bug-fix commit into the m148 sync branch.

Upstream change merged into externals/skia (skia-sync/m148):
- [m148] Reject Slugs that have creationMatrix with perspective
  Fixes corrupted data handling in text Slug deserialization.
  Adds runtime checks to prevent issues from unexpected perspective
  matrices in SubRunContainer. (upstream: a48e9118d9)

native/linux/build.cake:
- Detect libc++ availability via try-compile (more reliable than path
  checks). Falls back to -stdlib=libstdc++ on bare runners where libc++
  headers are absent. Docker images that ship libc++ statically still
  use libc++ (probe succeeds there).

cgmanifest.json:
- Updated main Skia commitHash to 640d6b582549b5bea0ae9647a72d9b7c34b9b80d
- Updated upstream_merge_commit to a48e9118d9621aa9b4bf3f20217e10bda3ddf880

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattleibow

Copy link
Copy Markdown
Contributor Author

Closing as superseded by the m148 update in #4125 (submodule mono/skia#250, already merged). This auto-generated skia-sync PR is redundant.

@mattleibow mattleibow closed this Jun 11, 2026
@mattleibow mattleibow deleted the skia-sync/m148 branch June 11, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant