Add Graphite presentation interop - #4729
Conversation
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 <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 00cda8ff-9603-406f-ae2e-45c70e39b3e7
📦 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 — 🔴 53 slower · 🟢 27 faster
📦 Allocations — 🔴 1 more alloc · 🟢 0 less alloc
Full per-OS benchmark deltasLinux⏱️ Time (vs 🌙 nightly
📦 Allocations (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 <223556219+Copilot@users.noreply.github.com> Copilot-Session: dd83f08e-1222-4b30-b315-1a5c2103463a
|
Split follow-ups:
|
|
The view work has been restaged around this interop PR:
|
Description
Adds the Graphite APIs required for on-screen presentation without adding any view implementation. Vulkan presentation needs acquisition waits, render-complete signals, a transition to
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, and completion callbacks; the existing binding only supported offscreen recording.This layer also exposes deferred canvases for independent thread-affine recorders, a 64-bit-safe Vulkan image overload for 32-bit Android, and backend texture metadata. Native views and MAUI are intentionally split into follow-up PRs.
Related issues
Related to #4721
Related to #3962
Required skia PR
Requires mono/skia#345
Areas affected
binding/)externals/skia/src/c,include/c)Changes
Public API
Behavior
The fallback Vulkan allocator is internally synchronized so multiple Graphite recorders can allocate concurrently. Invalid target-state and deferred-canvas inputs are rejected before entering unsafe native paths.
Testing
dotnet build binding/SkiaSharp/SkiaSharp.csproj -f net10.0Checklist
Changesabove lists all public API and behavioral changes (or "None.")mono/skiaPR linked above and bindings regenerated