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 <noreply@anthropic.com>
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
|
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