feat!: Move to SkiaSharp 4.148 and Enable Vulkan by default#23598
feat!: Move to SkiaSharp 4.148 and Enable Vulkan by default#23598ramezgerges wants to merge 8 commits into
Conversation
|
The build 220164 did not find any UI Test snapshots differences. |
|
|
MartinZikmund
left a comment
There was a problem hiding this comment.
May need a follow up uno.templates PR for skiasharp update, will create some 7.0 feature branch there
|
🤖 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 |
|
The build 220430 did not find any UI Test snapshots differences. |
|
|
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>
7fafc3b to
79c11f2
Compare
|
🤖 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 |
|
The build 220539 did not find any UI Test snapshots differences. |

GitHub Issue: closes #
PR Type:
What changed? 🚀
PR Checklist ✅
Screenshots Compare Test Runresults.