diff --git a/src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.skia.cs b/src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.skia.cs index dcde8e4377d5..c06acfcd6225 100644 --- a/src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.skia.cs +++ b/src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.skia.cs @@ -83,21 +83,6 @@ private static ImageData Open(UnmanagedArrayOfBytes buffer, int bufferLength, in } } - /// - /// Renders synchronously on the UI thread using the software rasterizer. For internal - /// callers that cannot yield to the dispatcher — e.g. the drag visual must be captured - /// within the DragStarting sequence so DragEnter/DragOver still fire synchronously right - /// after it, matching WinUI. Must not be called while a RenderAsync is in flight on the - /// same instance. - /// - internal void RenderSync(UIElement element, int scaledWidth, int scaledHeight) - { - (_bufferSize, PixelWidth, PixelHeight) = PrepareRender(element, new Size(scaledWidth, scaledHeight)) is { } render - ? RenderSoftware(element.Visual, render) - : (0, 0, 0); - InvalidateSource(); - } - /// /// Computes the render dimensions and sizes the pixel buffer accordingly; null when the /// element has nothing to render. diff --git a/src/Uno.UI/UI/Xaml/UIElement.Pointers.cs b/src/Uno.UI/UI/Xaml/UIElement.Pointers.cs index 9f7307104d46..c3bede317cd6 100644 --- a/src/Uno.UI/UI/Xaml/UIElement.Pointers.cs +++ b/src/Uno.UI/UI/Xaml/UIElement.Pointers.cs @@ -969,14 +969,11 @@ private async Task StartDragAsyncCore(PointerPoint pointer // so we provide the ActualSize to request the image to be scaled back in logical pixels. var target = new RenderTargetBitmap(); -#if __SKIA__ - // RenderAsync completes during a later render pass; the drag visual must instead be - // captured without yielding so DragStarted/DragEnter below still fire synchronously - // within the DragStarting sequence (matching WinUI). - target.RenderSync(this, (int)ActualSize.X, (int)ActualSize.Y); -#else - await target.RenderAsync(this, (int)ActualSize.X, (int)ActualSize.Y); -#endif + // Deliberately not awaited: on Skia the render completes during a later render pass, + // and yielding here would break the synchronous DragStarting → DragStarted → + // DragEnter/DragOver sequence (matching WinUI). The drag view redraws itself when + // the bitmap's pixels arrive (InvalidateSource). + _ = target.RenderAsync(this, (int)ActualSize.X, (int)ActualSize.Y); routedArgs.DragUI.Content = target; routedArgs.DragUI.Anchor = -ptPosition;