Repository navigation
Add Graphite presentation interop - #4729
mattleibow wants to merge 7 commits into
Conversation
📦 Try the packages from this PRWarning 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 -- 4729PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4729"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4729/packages --name skiasharp-pr-4729More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4729 |
|
📖 Documentation Preview The documentation for this PR has been deployed and is available at: 🔗 View Staging Site This preview will be updated automatically when you push new commits to this PR. This comment is automatically updated by the documentation staging workflow. |
📊 SkiaSharp benchmarks — PR #4729⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS
Highlights⏱️ Time — 🔴 59 slower · 🟢 28 faster
Full per-OS benchmark deltasLinux⏱️ Time (vs 🌙 nightly
Windows⏱️ Time (vs 🌙 nightly
macOS⏱️ Time (vs 🌙 nightly
|
📦 Artifact size reportPackages from this PR (build Total Packages
+36 package(s) unchanged (< 50.0 KB). Per-file changes
|
| File | Size |
|---|---|
lib/net462/SkiaSharp.dll |
862.0 KB → 872.0 KB (🔴 +10.0 KB) |
lib/net48/SkiaSharp.dll |
862.0 KB → 871.5 KB (🔴 +9.5 KB) |
lib/net10.0-android36.0/SkiaSharp.dll |
534.0 KB → 540.5 KB (🔴 +6.5 KB) |
lib/net10.0-ios26.0/SkiaSharp.dll |
536.5 KB → 543.0 KB (🔴 +6.5 KB) |
lib/net10.0-maccatalyst26.0/SkiaSharp.dll |
536.5 KB → 543.0 KB (🔴 +6.5 KB) |
lib/net10.0-tvos26.0/SkiaSharp.dll |
536.5 KB → 543.0 KB (🔴 +6.5 KB) |
lib/net6.0/SkiaSharp.dll |
510.0 KB → 516.5 KB (🔴 +6.5 KB) |
lib/net9.0-android35.0/SkiaSharp.dll |
534.0 KB → 540.5 KB (🔴 +6.5 KB) |
lib/net9.0-ios18.0/SkiaSharp.dll |
536.5 KB → 543.0 KB (🔴 +6.5 KB) |
lib/net9.0-maccatalyst18.0/SkiaSharp.dll |
536.5 KB → 543.0 KB (🔴 +6.5 KB) |
lib/net9.0-tvos18.0/SkiaSharp.dll |
536.5 KB → 543.0 KB (🔴 +6.5 KB) |
lib/netstandard2.1/SkiaSharp.dll |
514.0 KB → 520.5 KB (🔴 +6.5 KB) |
lib/net10.0-macos26.0/SkiaSharp.dll |
536.5 KB → 542.5 KB (🔴 +6.0 KB) |
lib/net10.0-tizen10.0/SkiaSharp.dll |
554.0 KB → 560.0 KB (🔴 +6.0 KB) |
lib/net10.0-windows10.0.19041/SkiaSharp.dll |
539.0 KB → 545.0 KB (🔴 +6.0 KB) |
lib/net10.0/SkiaSharp.dll |
538.0 KB → 544.0 KB (🔴 +6.0 KB) |
lib/net6.0-tizen8.0/SkiaSharp.dll |
527.0 KB → 533.0 KB (🔴 +6.0 KB) |
lib/net9.0-macos15.0/SkiaSharp.dll |
536.5 KB → 542.5 KB (🔴 +6.0 KB) |
lib/net9.0-tizen8.0/SkiaSharp.dll |
554.0 KB → 560.0 KB (🔴 +6.0 KB) |
lib/net9.0-windows10.0.19041/SkiaSharp.dll |
539.0 KB → 545.0 KB (🔴 +6.0 KB) |
lib/net9.0/SkiaSharp.dll |
538.0 KB → 544.0 KB (🔴 +6.0 KB) |
lib/netstandard2.0/SkiaSharp.dll |
518.0 KB → 524.0 KB (🔴 +6.0 KB) |
ref/net462/SkiaSharp.dll |
470.0 KB → 475.0 KB (🔴 +5.0 KB) |
ref/net48/SkiaSharp.dll |
470.0 KB → 475.0 KB (🔴 +5.0 KB) |
ref/net6.0/SkiaSharp.dll |
296.0 KB → 299.5 KB (🔴 +3.5 KB) |
| +41 more file(s) |
SkiaSharp.NativeAssets.WebAssembly
| File | Size |
|---|---|
🧬 wasm 5.0.6/st · libSkiaSharp.a (buildTransitive/netstandard1.0/libSkiaSharp.a/5.0.6/st/libSkiaSharp.a) |
18.0 MB → 18.0 MB (🔴 +3.7 KB) |
🧬 wasm 5.0.6/st,simd · libSkiaSharp.a (buildTransitive/netstandard1.0/libSkiaSharp.a/5.0.6/st,simd/libSkiaSharp.a) |
18.2 MB → 18.2 MB (🔴 +3.7 KB) |
🧬 wasm 5.0.6/mt · libSkiaSharp.a (buildTransitive/netstandard1.0/libSkiaSharp.a/5.0.6/mt/libSkiaSharp.a) |
17.9 MB → 17.9 MB (🔴 +3.7 KB) |
🧬 wasm 5.0.6/mt,simd · libSkiaSharp.a (buildTransitive/netstandard1.0/libSkiaSharp.a/5.0.6/mt,simd/libSkiaSharp.a) |
18.2 MB → 18.2 MB (🔴 +3.6 KB) |
🧬 wasm 3.1.56/st · libSkiaSharp.a (buildTransitive/netstandard1.0/libSkiaSharp.a/3.1.56/st/libSkiaSharp.a) |
17.8 MB → 17.8 MB (🔴 +3.3 KB) |
🧬 wasm 3.1.56/st,simd · libSkiaSharp.a (buildTransitive/netstandard1.0/libSkiaSharp.a/3.1.56/st,simd/libSkiaSharp.a) |
18.1 MB → 18.1 MB (🔴 +3.3 KB) |
🧬 wasm 3.1.56/mt · libSkiaSharp.a (buildTransitive/netstandard1.0/libSkiaSharp.a/3.1.56/mt/libSkiaSharp.a) |
17.8 MB → 17.8 MB (🔴 +3.2 KB) |
🧬 wasm 3.1.56/mt,simd · libSkiaSharp.a (buildTransitive/netstandard1.0/libSkiaSharp.a/3.1.56/mt,simd/libSkiaSharp.a) |
18.0 MB → 18.0 MB (🔴 +3.2 KB) |
SkiaSharp.NativeAssets.Win32
| File | Size |
|---|---|
runtimes/win-x86/native/libSkiaSharp.pdb |
97.1 MB → 97.1 MB (🔴 +72.0 KB) |
runtimes/win-arm64/native/libSkiaSharp.pdb |
91.2 MB → 91.2 MB (🔴 +60.0 KB) |
runtimes/win-x64/native/libSkiaSharp.pdb |
94.3 MB → 94.4 MB (🔴 +44.0 KB) |
🧬 win-x64 (runtimes/win-x64/native/libSkiaSharp.dll) |
12.8 MB → 12.8 MB (🔴 +9.0 KB) |
🧬 win-arm64 (runtimes/win-arm64/native/libSkiaSharp.dll) |
11.0 MB → 11.0 MB (🔴 +8.5 KB) |
🧬 win-x86 (runtimes/win-x86/native/libSkiaSharp.dll) |
11.1 MB → 11.1 MB (🔴 +7.5 KB) |
SkiaSharp.NativeAssets.WinUI
| File | Size |
|---|---|
runtimes/win-arm64/native/libGLESv2.pdb |
64.5 MB → 64.4 MB (🟢 −80.0 KB) |
runtimes/win-x64/native/libGLESv2.pdb |
66.6 MB → 66.6 MB (🟢 −48.0 KB) |
runtimes/win-x86/native/libGLESv2.pdb |
67.2 MB → 67.2 MB (🟢 −32.0 KB) |
Informational only — this never blocks the PR. Native binaries are labelled by os/arch.
Carve the reviewed native Graphite views package from the combined Graphite views work and add direct native Basic samples for Android, iOS, Mac Catalyst, macOS, and tvOS. Gate Android below API 24 and keep the sample render loops lifecycle-aware and failure-reporting. Related: #4721 Requires: #4729 Requires: mono/skia#345 Co-authored-by: Copilot App <[email protected]> Copilot-Session: dd83f08e-1222-4b30-b315-1a5c2103463a
|
Split follow-ups:
|
|
The view work has been restaged around this interop PR:
|
4e6d126 to
60e6c52
Compare
492a001 to
b2d53c2
Compare
36c836a to
14157c0
Compare
Expose deferred canvases, Vulkan synchronization and texture-state primitives, and 64-bit-safe external handles independently of any view implementation.\n\nCo-authored-by: Copilot App <[email protected]>\nCopilot-Session: 00cda8ff-9603-406f-ae2e-45c70e39b3e7
Use scoped semaphore marshalling, release callback roots when native dispatch throws, reject unsupported alpha types, and verify deferred replay and exactly-once completion on each supported Graphite backend. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cd863066-e555-4b94-a17a-cc1bc0633c2f
Co-authored-by: Copilot App <[email protected]> Copilot-Session: cd863066-e555-4b94-a17a-cc1bc0633c2f
Regenerate the Skottie, SceneGraph and Resources groups so their native aliases include the new Graphite descriptor typedefs and match deterministic CI generation. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cd863066-e555-4b94-a17a-cc1bc0633c2f
Regenerate the new entry points with current Cdecl calling conventions and blittable one-byte Boolean callbacks. Preserve the m159 engine and dependency history by rebasing the native prerequisite and updating its Component Governance registration to the matching feature pin. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 55b79da2-dd67-4d9c-9456-0cbd00b46d64
Pin the native guard for MSAA-incompatible tessellation targets, add Metal coverage proving deferred canvases remain available when internal MSAA is disabled, and document that completion callbacks must not throw across the native boundary. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 55b79da2-dd67-4d9c-9456-0cbd00b46d64
Exercise a renderable RG32Float target which lacks MSAA support in Graphite Apple-family caps. The isolated test crashes with SIGSEGV against the pre-fix source-built shim; the guarded shim must reject it without affecting supported Metal families or MSAA-disabled rendering. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 55b79da2-dd67-4d9c-9456-0cbd00b46d64
14157c0 to
f5b6f58
Compare
Description
Expose the Graphite synchronization and deferred-recording primitives needed for native GPU presentation: Vulkan acquisition waits and rendering-completion signals, presentation image-state transitions, completion callbacks, texture metadata, and complete 64-bit Vulkan image handles. This is the prerequisite interop layer, not a view implementation; the native/MAUI views remain separately reviewable in #5329. Stack 5781 retains the order #4729 → #5329.
Rebased onto
maincommit5e3e1c51bab1b5ef41017f570717e173108b48b4, inheriting the already-landed x86 toolchain-image repair (#5795) and Uno 7 smoke-layout repair (#5788), alongside merged Mesh and device-archive changes. All seven interop patches are range-diff identical to the previous published head14157c0030ab0c339310b3c68999e866cf0ab918; no new feature or CI-specific changes were added to this PR's diff.The native prerequisite remains based on main's m159/Mesh baseline
5d226f638edbb3c0dac0ac93ac1ff349298880a4; the gitlink and Component Governance registration both pin feature commit75ab194f675fe445dac44ea98829148fc6c6848d. All five native Graphite patches remain unchanged. Current XML documentation, byte-sized unmanaged Boolean callbacks, Cdecl LibraryImport conventions, and merged Mesh/Graphite generated aliases are preserved.Rubber-duck review found a concrete deferred-canvas crash: a renderable texture can lack the MSAA support required by tessellation. The C shim now mirrors
Device::Make's renderer-specific requirement before calling the upstream factory; raster/compute and explicitly MSAA-disabled rendering are not blanket-rejected. The RG32Float/RgF16 crash was reproduced with pre-fix source-built natives, and both rejection and valid single-sample behavior are covered.Related issues
Related to #4721 and #3962.
Required skia PR
Requires mono/skia#345; pinned native feature commit
75ab194f675fe445dac44ea98829148fc6c6848d.Areas affected
binding/)externals/skia/src/c,include/c)Changes
Public API
Additive APIs; all existing signatures and native struct layouts are retained:
Behavior
Semaphore/state wrappers are descriptors; callers retain ownership of the underlying GPU resources until execution completes. Deferred canvases are borrowed and invalidated by Snap/disposal; unsupported targets return null rather than entering the upstream null-Device crash. Completion is delivered once on success or failure, and user callbacks must not throw across the native boundary. Graphite's fallback Vulkan allocator is synchronized for independent recorders.
Testing
Latest CI-baseline refresh: 2026-11-17, managed
f5b6f58ee7aaf8c327268df04fa3907b4a4541f8, exact main base5e3e1c51bab1b5ef41017f570717e173108b48b4.Required Azure build 1685682 failed only the x86/x86-nodeps Docker CMake compiler probes on missing
Scrt1.o/crti.o(54 other jobs passed). The same errors were verified on the unmodified original-main build 1685624 atb555694c, as well as previous PR build 1685555. The published branch now inherits the landed #5795 digest fix rather than blindly retrying the broken base. Uno Gallery/SkiaFiddle published successfully but their smoke checks rejected the obsoletepackage_*/uno-config.jslayout; the branch now also inherits the landed #5788 repair.git range-diff --no-color b555694c3b03671421d6d2907626ca2799024f98..14157c0030ab0c339310b3c68999e866cf0ab918 5e3e1c51bab1b5ef41017f570717e173108b48b4..f5b6f58ee7aaf8c327268df04fa3907b4a4541f8— passed: all seven feature patches identical.git diff --exit-code 14157c0030ab0c339310b3c68999e866cf0ab918 HEAD -- binding tests cgmanifest.json externals/skia— passed: managed/native implementation, generated bindings, tests and provenance unchanged.git diff --exit-code 5e3e1c51bab1b5ef41017f570717e173108b48b4 HEAD -- .github scripts samples documentation— passed: shared repairs are inherited byte-identically from main, not reimplemented in this feature diff.bash -n samples/Gallery/Uno/scripts/smoke.sh samples/SkiaFiddle/scripts/smoke.sh— passed; syntax proof only, not browser/runtime acceptance.dotnet test tests/SkiaSharp.Tests.Console.slnx -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 --verbosity quiet -- --report-trx— passed again on the latest managed head: 6,787 passed, 55 existing declared platform/capability skips, zero failures across all five hosts. No GPU opt-outs. Both concrete MSAA rejection and valid single-sample control pass. All five hosts match the verified source-native artifact below.New-head Azure/Linux/browser CI results are pending and are not claimed green. Native source and pin are unchanged in this last refresh; verified local source-built artifacts were reused without downloading prebuilt natives. Stack metadata, draft/base states, and the companion native branch were not changed.
Source-native verification for the retained
75ab194f675fe445dac44ea98829148fc6c6848dpin:dotnet cake --target=externals-macos --arch=arm64— passed with Xcode 27.2 against combined Mesh/Graphite source. No deployment-target or shared Xcode-selection changes.pwsh -NoLogo -NoProfile -File ./utils/generate.ps1— passed all five configurations with no additional changes after the Mesh rebase. No generated declarations were hand-edited.clang++ -std=c++20 -fsyntax-only -DSK_GRAPHITE -DSK_VULKAN -I externals/skia -I externals/skia/third_party/externals/vulkan-headers/include externals/skia/src/c/sk_graphite.cpp externals/skia/src/c/sk_graphite_vulkan.cpp— passed, with the existing UNKNOWN backend switch warning. Compile-level Vulkan proof is not Vulkan-device runtime acceptance.dotnet build binding/SkiaSharp/SkiaSharp.csproj -f netstandard2.0 -p:TargetFrameworks=netstandard2.0 --verbosity quiet— passed, zero warnings/errors.git -C externals/skia range-diff --no-color 1c8b6db33a5c9ff2292fb58d65d7b344e91085f3..ff6c43af25a86e1a2a3c23b1d8d76e1420c95a9f 5d226f638edbb3c0dac0ac93ac1ff349298880a4..75ab194f675fe445dac44ea98829148fc6c6848d— passed: all five native feature patches identical.Earlier red/green proof for the retained guard: with the exact pre-fix source-built shim,
dotnet tests/SkiaSharp.Tests.Console/bin/Debug/net10.0/SkiaSharp.Tests.dll --filter-method '*DeferredCanvasRejectsTargetsWithoutRequiredMsaa*'reproduced native SIGSEGV/139. After the fix,dotnet test tests/SkiaSharp.Tests.Console/SkiaSharp.Tests.Console.csproj -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 --verbosity quiet -- --filter-method '*DeferredCanvas*' --report-trxpassed both the concrete rejection and MSAA-disabled control; both pass again in the latest unfiltered gate.All five rebuilt test-host native SHA256s match produced
libSkiaSharp(fce798551b6779290b0f5b052ef521d4da33be23be2286a87142e64037ea1e02). Worktrees are clean, native ancestry preserves main's merged Mesh and m159 fixes, and gitlink/provenance pins agree. Feature refs were published with exact guarded leases.Windows, Vulkan-device, Android/iOS/Mac Catalyst, and WASM runtime acceptance are not claimed for this refresh. No manual CI queues or device runs were started; downstream presentation screenshots and package consumers remain scoped to #5329.
Checklist
Changesabove lists all public API and behavioral changes (or "None.")///documentation and regenerated bindings when applicablemono/skiaPR linked above and bindings regenerated