microsoft / Win2D

Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering with GPU acceleration. It is available to C#, C++ and VB developers writing apps for the Windows Universal Platform (UWP). It utilizes the power of Direct2D, and integrates seamlessly with XAML and CoreWindow.
http://microsoft.github.io/Win2D
Other
1.78k stars 285 forks source link

CanvasSwapChainPanel redraw position issue in WinUI3 desktop app #847

Open DHancock opened 2 years ago

DHancock commented 2 years ago

I'm using a CanvasSwapChainPanel control to make animations smother (worked perfectly). The trouble is that if I resize the window containing the control, the backing store isn't always drawn to the window in the correct position. It's sometimes offset from the origin. It's a bit variable and seem dependent on the size of the window, the smaller the window the more likely it is to go wrong. See the screen capture below.

I've written a minimal repro project:

SwapChainRedrawIssue.zip

It uses nuget packages:

I'm running windows 21H1 (19043.1165) I doubt its a graphics card issue but it's integrated graphics i7-7500U

The repro project simply updates the swap chain on every resize event:

capture

DHancock commented 2 years ago

Appears this is a generic swapchain issue and not part of Win2D. See:

microsoft/microsoft-ui-xaml#5888