Skip to content

refactor: drop RenderTargetBitmap.RenderSync#23660

Merged
ramezgerges merged 1 commit into
unoplatform:masterfrom
ramezgerges:rtb_async_drag_visual
Jul 7, 2026
Merged

refactor: drop RenderTargetBitmap.RenderSync#23660
ramezgerges merged 1 commit into
unoplatform:masterfrom
ramezgerges:rtb_async_drag_visual

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

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.RenderSync special case that was added to keep the drag-visual capture synchronous.

The drag visual is now captured by starting a regular RenderAsync without awaiting it: the DragStartingDragStartedDragEnter/DragOver sequence stays synchronous (matching WinUI), DragUI.Content is set immediately, and the drag view redraws itself when the bitmap's pixels arrive one render pass later (InvalidateSource → the DragView's Image re-opens its source). Not awaiting is also behavior-preserving on non-Skia platforms, where RenderAsync completes synchronously.

Net effect:

  • RenderTargetBitmap has a single (async) render path again — the synchronous software-only entry point is gone.
  • The drag visual is hardware-accelerated on GPU-rendered windows, like every other RenderTargetBitmap consumer.
  • The drag visual may be empty for the first frame (~one vsync) until the pixels arrive.

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 ✅

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings July 6, 2026 15:13
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 synchronous DragStarting → DragStarted → DragEnter/DragOver sequencing.
  • Deleted the Skia-only RenderTargetBitmap.RenderSync(...) software-rendering entry point to consolidate rendering behavior around RenderAsync.

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.

Comment thread src/Uno.UI/UI/Xaml/UIElement.Pointers.cs
@unodevops

Copy link
Copy Markdown
Contributor

🤖 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

@ramezgerges

Copy link
Copy Markdown
Contributor Author

CI note: the WebAssembly Skia Runtime Tests 1 failure is Given_AccessibleTextBox.When_Accessibility_Is_Enabled_After_Text_Exists_Then_SemanticTyping_Appends_At_Current_Caret, which is unrelated to this change — the same test fails in master's own CI runs (builds 220794 and 220804, whose WASM failure artifacts contain the identical test). It also failed the same way on the CI runs of #23637.

🤖 Generated with Claude Code

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220851 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • DisplayInformation.png-dark
    • ImageIconPage.png-dark
    • ButtonClippingTestsControl.png-dark
    • Buttons.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
  • skia-windows-screenshots: 2348 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • AppBarButtonWithIconTest.png-dark
    • AppXamlDefinedResources.png
    • ApplicationViewSizing.png
    • AppWindowClosing.png-dark
    • AutoSizedPathCentered.png
    • Attributed_text_Supserscript.png
    • Attributed_text_FontSize_Changing.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • AutoSizedTopLeft.png
    • AutomationPropertiesExtensions_Role.png-dark
    • BasicThemeResources.png-dark
    • BadgeNotificationTests.png-dark
    • AutoSuggestBox_BitmapIcon.png-dark
    • BitmapIcon_Generic.png
    • Basics.png-dark
    • BasicThemeResources.png
    • BorderLeftwithmargins.png
    • BitmapIcon_Generic.png-dark
    • BitmapIcon_Sizing.png-dark
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Uno_Web.Http.CookieManagerTests

@ramezgerges ramezgerges marked this pull request as ready for review July 7, 2026 00:22
@ramezgerges ramezgerges enabled auto-merge July 7, 2026 00:24
@ramezgerges ramezgerges requested a review from MartinZikmund July 7, 2026 00:24
@unodevops

Copy link
Copy Markdown
Contributor

🤖 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

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220975 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Focus_FocusVisual_Properties.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • Buttons.png-dark
    • Buttons.png
    • ImageIconPage.png-dark
    • Image_AnimatedWebP.png-dark
    • Image_AnimatedWebP.png
    • ContextRequested.png-dark
    • ContextRequested.png
  • skia-windows-screenshots: 2348 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBar_KeyBoard.png
    • Accessibility_ScreenReader.png-dark
    • AppBarButtonTest.png
    • AppBarToggleButtonTest.png
    • AppWindowFeatures.png
    • Attributed_text_Simple.png-dark
    • AppWindowClosing.png
    • AppWindowFeatures.png-dark
    • AppWindowTitleBar Properties.png
    • AutoSuggestBoxChosenSuggestion.png-dark
    • AppXamlDefinedResources.png
    • Arrange_Performance01.png
    • AuthenticationBroker_Demo.png-dark
    • BackGesture.png
    • AutoBorderStretchwithleftmargin.png
    • AuthenticationBroker_Demo.png
    • AutomationProperties_AutomationId.png
    • Basics_Automated.png-dark
    • AutoSizedPathCentered.png
    • AutomationProperties_AutomationId.png-dark
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Uno_Web.Http.CookieManagerTests
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

@ramezgerges ramezgerges merged commit 754bd64 into unoplatform:master Jul 7, 2026
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants