Repository navigation
feat!: Move to SkiaSharp 4.148 and Enable Vulkan by default - #23598
ramezgerges merged 10 commits into
Conversation
|
🤖 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 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. |
|
|
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. |
|
|
Fixes: unoplatform#23159 Context: dotnet/runtime#4538 (comment) Context: https://github.com/unoplatform/uno/blob/ffbb0c0ed47679ede7c67effaa979e7a9934ed33/doc/articles/controls/WebView.md?plain=1#L198-L206 Use of WebView2 on Linux Wayland requires that the `GDK_BACKEND` environment variable be set, lest Bad Things Happen™. On the ignorable side, the bad things are simply messages written to stdout. For example, build and run SamplesApp.Skia.Generic: dotnet build -c Release -f net10.0 src/SamplesApp/SamplesApp.Skia.Generic/SamplesApp.Skia.Generic.csproj LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libfreetype.so.6.20.1 \ dotnet src/SamplesApp/SamplesApp.Skia.Generic/bin/Release/net10.0/SamplesApp.Skia.Generic.dll (The $LD_PRELOAD is needed to avoid [a *different* problem][0], which should get fixed by updating SkiaSharp; see unoplatform#23598.) Once SamplesApp.Skia.Generic has launched: 1. Click the "checkbox list" icon on the top-left to show the RuntimeTests panel. 2. In the "Enter test filter here" textbox, enter `When_ExecuteScriptAsync`. 3. Click the▶️ Run button Console output will contain messages such as: (SamplesApp.Skia.Generic:25303): Gdk-CRITICAL **: 09:20:32.946: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed … fail: Uno.UI.WebView.Skia.X11.X11NativeWebView[0] SetScrollingEnabled is not supported on the X11 target. … warn: Uno.WinUI.Runtime.Skia.X11.X11ApplicationHost[0] X11 protocol error — ErrorCode: 3, RequestCode: X_UnmapWindow, MinorCode: 0, ResourceId: 0x0, Serial: 428 However, the tests *pass* and the app *doesn't crash*. Enter unoplatform#23159: if we build Uno.Gallery for *Native AOT* and hit the WebView2 logic, we see the same `Gdk-CRITICAL` message, *and also* these messages: fail: Uno.WinUI.Runtime.Skia.X11.X11NativeOverlappedPresenter[0] Couldn't get OverlappedPresenterState: _NET_WM_STATE does not exist on the window. Make sure you use an EWMH-compliant WM. fail: Uno.WinUI.Runtime.Skia.X11.X11NativeOverlappedPresenter[0] Couldn't get OverlappedPresenterState: _NET_WM_STATE does not exist on the window. Make sure you use an EWMH-compliant WM. followed by a *hard crash*: (Uno.Gallery:8586): Gdk-CRITICAL **: 14:46:16.851: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 3 (X_GetWindowAttributes) Resource id in failed request: 0x0 Serial number of failed request: 103 Current serial number in output stream: 104 The workaround for this, as documented in `doc/articles/controls/WebView.md`, is to export the `GDK_BACKEND` environment variable to `x11`: export GDK_BACKEND=x11 dotnet … This works, but requires reading documentation (who does that?!). The ideal fix would be to have `X11NativeWebProvider` export the environment variable during app startup. The problem is that the "obvious" way to do this: Environment.SetEnvironmentVariable("GDK_BACKEND", "x11"); [*does not work*][1] > we will not support the case where a user wants to modify the > environment from managed code and expects to see those changes > reflected in a native library they PInvoke to, or vice versa. Since we *need* native code in `libgdk*` et al to see the `GDK_BACKEND` environment variable, we can't use `Environment.SetEnvironmentVariable()` to do so. Instead, P/Invoke into **setenv**(3). This allows us to set the `GDK_BACKEND` environment variable on the native side, allowing `libdk*` et al to see the value we set and behave accordingly. With this fix in place, `SamplesApp.Skia.Generic.dll` no longer produces the `Gdk-CRITICAL` or X11 protocol error messages. [0]: unoplatform#20532 (comment) [1]: dotnet/runtime#4538 (comment)
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) <[email protected]>
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) <[email protected]>
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) <[email protected]>
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) <[email protected]>
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) <[email protected]>
- 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 <[email protected]>
- 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 <[email protected]>
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 <[email protected]>
The Android CoreCLR/NativeAOT Skia publish steps hardcoded the old 3.119.2-preview.1 SkiaSharp version, so they still compiled against the pre-migration API (SKPath construction, 5-arg DrawBitmap) and failed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
4bb1caf to
cace064
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 221210 found UI Test snapshots differences: Details
|
|
|
When_Negative_Margin_Should_Not_Clip asserted exact ellipse pixel bounds. With SkiaSharp 4.148 and the now-default Vulkan GPU backend, the ellipse's anti-aliased core shifts by a couple of pixels per rasterizer, so the exact bounds are no longer portable across CI platforms. Assert the red (ellipse) bounds with a 3px tolerance instead; a real clip removes the ~4px top/right overflow, which still exceeds the tolerance. Rectangle bounds (purple, yellow) stay exact. Co-Authored-By: Claude Opus 4.8 <[email protected]>
cace064 to
56b58be
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 221285 found UI Test snapshots differences: Details
|
007a5c2
into
unoplatform:feature/breakingchanges
GitHub Issue: closes https://github.com/unoplatform/uno-private/issues/2156
PR Type:
What changed? 🚀
PR Checklist ✅
Screenshots Compare Test Runresults.