feat!: Move to SkiaSharp 4.148 and Enable Vulkan by default by ramezgerges · Pull Request #23598 · unoplatform/uno · GitHub
Skip to content

feat!: Move to SkiaSharp 4.148 and Enable Vulkan by default#23598

Open
ramezgerges wants to merge 8 commits into
unoplatform:feature/breakingchangesfrom
ramezgerges:feature/vulkan-default-skiasharp-4148
Open

feat!: Move to SkiaSharp 4.148 and Enable Vulkan by default#23598
ramezgerges wants to merge 8 commits into
unoplatform:feature/breakingchangesfrom
ramezgerges:feature/vulkan-default-skiasharp-4148

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #

PR Type:

What changed? 🚀

PR Checklist ✅

@github-actions github-actions Bot added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform area/solution-templates Categorizes an issue or PR as relevant to the solution template area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/build Categorizes an issue or PR as relevant to build infrastructure area/automation Categorizes an issue or PR as relevant to project automation kind/documentation platform/x11 🐧 Categorizes an issue or PR as relevant to X11 labels Jun 29, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220164 did not find any UI Test snapshots differences.

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 220164 has failed on Uno.UI - CI.

@MartinZikmund MartinZikmund 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.

May need a follow up uno.templates PR for skiasharp update, will create some 7.0 feature branch there

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23598/wasm-skia-net9/index.html

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220430 did not find any UI Test snapshots differences.

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 220430 has failed on Uno.UI - CI.

ramezgerges and others added 8 commits July 2, 2026 14:00
Bump SkiaSharp 3.119.0 -> 4.148.0 and HarfBuzzSharp 8.3.1.1 -> 14.2.0
across central versioning, nuspecs, solution template, test apps, the
macOS native dylib fetch script, add-in error messages and docs.

SkiaSharp 4 deprecates the mutable SKPath API (and a few SKCanvas /
SKTypeface members) in favor of the immutable SKPathBuilder / SKFont /
SKSamplingOptions APIs. Uno's renderer intentionally relies on the
mutable, poolable SKPath (per-frame Rewind/Op/Transform reuse), so the
deprecation is suppressed with a documented, greppable per-file
"#pragma warning disable CS0618" instead of being rewritten. The
SKPathBuilder rearchitecture is deferred to dedicated, benchmarked work.

BREAKING CHANGE: SkiaSharp is bumped to the 4.148 (milestone-148)
versioning scheme; consumers pinning SkiaSharp/HarfBuzzSharp must align.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Flip the default of UseVulkanOnWin32, UseVulkanOnX11 and
UseVulkanOnSkiaAndroid to true. Each rendering path already falls back to
OpenGL/OpenGL ES and then software when Vulkan is unavailable, so the new
default degrades gracefully. Update the Win32/X11 RenderingBackend.Default
enum docs to reflect the Vulkan-first order.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the temporary CS0618 pragma suppressions with a real migration to
the SkiaSharp 4 immutable path model:

- Path construction/mutation now goes through SKPathBuilder; the built path
  is obtained via Detach() (fresh) or Snapshot() (copy). Pooled/reusable
  paths pool the builder and Reset() it between uses.
- Surviving SKPath operations (Op, Transform, Offset, Reset) are kept; only
  the deprecated construction methods are moved off. Rewind() -> Reset().
- The renderer's clip plumbing keeps its out-param/scratch signatures: a
  Transform(identity, dst) helper (CopyPath/SetPathToRect) overwrites an
  existing path with an exact copy, replacing the deprecated dst.AddPath/
  AddRect re-seeding while preserving verbs and fill type.
- SKPaint.GetFillPath now fills an SKPathBuilder; SKCanvas.DrawBitmap/
  DrawImage take SKSamplingOptions; SKCanvas.DrawText takes SKTextAlign;
  SKTypeface.ContainsGlyph -> SKFont.ContainsGlyph.

Builds clean (0 warnings/errors, TreatWarningsAsErrors) for the full
SamplesApp.Skia.Generic plus the Win32 and X11 hosts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When a resolved typeface is a variable font (exposes OpenType variation
axes), instantiate it at the requested style via SKTypeface.Clone with an
SKFontArguments variation position, mapping the WinUI font properties onto
the standard axes:
- wght <- FontWeight.Weight (exact numeric weight, e.g. 350/650)
- wdth <- FontStretch (as a width percentage)
- ital <- FontStyle.Italic
- slnt <- FontStyle.Italic/Oblique

Values are clamped to each axis' supported range and axes already at their
default are left untouched; static fonts are returned unchanged. This lets
a single variable font render arbitrary weights/widths instead of snapping
to the nearest static instance. Per-style results stay cached by the
existing FontDetailsCache key.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use the typeface introspection added in SkiaSharp 4 when resolving fonts:

- Honor the "<file-uri>#<family name>" hint for embedded fonts. When the
  file is a TrueType/OpenType collection (.ttc/.otc), probe its faces and
  pick the one whose family or PostScript name matches the hint instead of
  always loading face 0. The default (no hint / single face) path is
  unchanged and streams directly; probing only happens when face 0 doesn't
  match, reading the data back via SKTypeface.OpenStream/SKStream.GetData,
  and is bounded to guard malformed files.
- Treat an empty typeface (SKTypeface.IsEmpty) from FromFamilyName the same
  as null so resolution falls back to the default font.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Replace the CopyPath helper with inline src.Transform(SKMatrix.Identity, dst)
  and share a single CreateRectPath from SkiaExtensions (was duplicated in Visual
  and SkiaRenderHelper); drop the SetPathToRect indirection and a dead Reset() +
  redundant transform on the native-clip path.
- Use SKSamplingOptions.Default instead of default(SKSamplingOptions) on the
  DrawBitmap/DrawImage calls.
- Draw the sample's rounded rect with DrawRoundRect instead of building a path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Select collection faces by probing the font's own SKData; SKTypeface.OpenStream
  ().GetData() returns null here, so the previous approach never found sub-faces
  and every "#family" hint fell back to face 0.
- Carry the face's collection index in SKFontArguments when cloning; otherwise
  Clone() silently drops the weight/width variation for any non-first face.
- Cache loaded font data per source uri so a new FontWeight of the same file
  resolves synchronously instead of momentarily rendering the default font
  (flicker when animating weight on a variable font).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds a Fonts sample that loads two families (Inter + Bitter) from a single .ttc
via the "#family" hint and sweeps the wght axis, exercising collection face
selection and variable-weight rendering. Bundles the OFL-licensed collection and
its license.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ramezgerges ramezgerges force-pushed the feature/vulkan-default-skiasharp-4148 branch from 7fafc3b to 79c11f2 Compare July 2, 2026 18:03
@github-actions github-actions Bot added the area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk label Jul 2, 2026
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23598/wasm-skia-net9/index.html

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220539 did not find any UI Test snapshots differences.

@unodevops

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/build Categorizes an issue or PR as relevant to build infrastructure area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/solution-templates Categorizes an issue or PR as relevant to the solution template kind/documentation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/x11 🐧 Categorizes an issue or PR as relevant to X11

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants