Repository navigation
fix(skia): Bound frame picture recording to frame size - #23815
ramezgerges merged 1 commit into
Conversation
The frame picture's CullRect now reports the frame bounds in logical pixels instead of a near-infinite rect, so FrameData consumers can size surfaces from it. Ops entirely outside the frame get culled at record time; they were never visible in the window. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR adjusts Skia’s root frame SKPicture recording bounds so that the picture’s CullRect reflects the actual frame size (logical pixels), enabling RenderingEventArgs.FrameData consumers to derive a correctly sized surface from the frame picture.
Changes:
- Bound the root frame recording via
BeginRecording(new SKRect(0, 0, width, height))instead ofVisual.InfiniteClipRect. - Documented the behavioral reason (FrameData consumers rely on
CullRectbeing frame-bounded).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23815/wasm-skia-net9/index.html |
|
The build 223077 found UI Test snapshots differences: Details
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23815/wasm-skia-net9/index.html |
|
The build 223687 found UI Test snapshots differences: Details
|
|
|
|
Tick the box to add this pull request to the merge queue (same as
|
RenderingEventArgs.FrameData kept its shape through the port but nothing ever filled it in, so the API that unoplatform#23762/unoplatform#23815 added was always null and its consumers got nothing. The frame is an opaque IRenderRecord now, so the backend says what it can expose: Skia hands out the SKPicture it recorded, and a backend with no meaningful equivalent hands out null. SkiaSharp has no public way to wrap an existing handle, so the managed picture has to be the one EndRecording produced -- and that costs a wrapper per recording. It is therefore opt-in through RenderRecordingOptions.CaptureFrameData, which is set only while a Rendering subscriber is attached; nothing else pays for it. Frames handed to subscribers outlive the pipeline, so ownership goes through FrameHold: the record is disposed once the pipeline is done and no in-flight raise still holds it, unless a subscriber actually read FrameData, in which case app code may keep it and the GC reclaims it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
GitHub Issue: https://github.com/unoplatform/kahua-private/issues/505
PR Type:
🐞 Bugfix
What changed? 🚀
Follow-up to #23762. The
SKPictureexposed throughRenderingEventArgs.FrameDatahad a near-infiniteCullRect, so consumers couldn't size a surface from it. The root frame recording is now bounded to the frame (BeginRecording(new SKRect(0, 0, width, height))instead ofVisual.InfiniteClipRect), makingCullRectreport the frame bounds in logical pixels.This only affects the root frame picture, whose consumers are the window present (already clipped to the window) and
FrameDatareaders;RenderTargetBitmaprecords its own picture, and the per-Visualpicture caches keep the infinite cull rect they require. Draw ops entirely outside the frame are now culled at record time — they were never visible in the window.Validated at runtime on Skia Desktop (Win32):
Given_CompositionTarget,Given_RenderTargetBitmap,Given_ItemCollectionTransitionProvider, andGiven_AnimatedVisualPlayerruntime tests all pass (11/11).PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code