Repository navigation
refactor: drop RenderTargetBitmap.RenderSync - #23660
Conversation
The drag visual no longer needs a synchronous render: the capture now starts a regular RenderAsync without awaiting it, keeping the DragStarting -> DragStarted -> DragEnter/DragOver sequence synchronous (matching WinUI) while the drag view redraws itself when the bitmap's pixels arrive (InvalidateSource). This also makes the drag visual hardware-accelerated on GPU-rendered windows and removes the last software-only special case. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Removes the Skia-only synchronous RenderTargetBitmap.RenderSync code path and updates drag-visual capture to use the single RenderAsync pathway (fire-and-forget) so the drag event sequence remains synchronous while allowing the bitmap pixels to arrive on the next render pass.
Changes:
- Updated drag-visual capture to start
RenderTargetBitmap.RenderAsync(...)without awaiting it to preserve synchronousDragStarting → DragStarted → DragEnter/DragOversequencing. - Deleted the Skia-only
RenderTargetBitmap.RenderSync(...)software-rendering entry point to consolidate rendering behavior aroundRenderAsync.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/UIElement.Pointers.cs | Switches drag-visual bitmap capture to fire-and-forget RenderAsync to avoid yielding during drag start. |
| src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.skia.cs | Removes the Skia-only synchronous render helper, leaving a single async render path. |
💡 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-23660/wasm-skia-net9/index.html |
|
CI note: the 🤖 Generated with Claude Code |
|
The build 220851 found UI Test snapshots differences: Details
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23660/wasm-skia-net9/index.html |
|
The build 220975 found UI Test snapshots differences: Details
|
…orm#23978/unoplatform#23660 Fold BitmapImage, BitmapSource, RenderTargetBitmap, SvgImageSource, WriteableBitmap and LoadedImageSurface's resurrected .skia.cs partials back into their base .cs files, matching master's single-file layout while keeping the branch's neutral CompositionImageSurface/ITexture types. Also restore the IsMsAppx/NormalizeMsResourceFilesUri call in LoadedImageSurface.StartLoadFromUri that unoplatform#23978 added and the merge dropped (BitmapImage/BitmapSource already had it). RenderTargetBitmap keeps the branch's CPU-raster RenderOffscreen/SnapshotAsync path rather than porting master's GRContext-based async picture-replay, since that mechanism is Skia/GRContext-specific and can't exist in SkiaSharp-free Uno.UI; see report for follow-up. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
GitHub Issue: related to #23636 (follow-up to #23637)
PR Type:
🔄 Refactoring (no functional changes, no api changes)
What changed? 🚀
Follow-up to #23637: removes the
RenderTargetBitmap.RenderSyncspecial case that was added to keep the drag-visual capture synchronous.The drag visual is now captured by starting a regular
RenderAsyncwithout awaiting it: theDragStarting→DragStarted→DragEnter/DragOversequence stays synchronous (matching WinUI),DragUI.Contentis set immediately, and the drag view redraws itself when the bitmap's pixels arrive one render pass later (InvalidateSource→ theDragView'sImagere-opens its source). Not awaiting is also behavior-preserving on non-Skia platforms, whereRenderAsynccompletes synchronously.Net effect:
RenderTargetBitmaphas a single (async) render path again — the synchronous software-only entry point is gone.RenderTargetBitmapconsumer.Validation:
Given_RenderTargetBitmap,Given_Border, and the four drag-and-drop runtime tests that regressed during #23637 (When_DragEnter_Fires_Along_DragStarting,When_DragOver_Fires_Along_DragEnter_Drop,When_DragDrop_ItemsSource_Is_Subclass_Of_ObservableCollection,When_UpdateLayout_In_DragDropping) were run on Skia Desktop (Win32) against both the Vulkan renderer (via SwiftShader) and the software renderer — 35 passed / 0 failed / 2 pre-existing inconclusive on each.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code