Search code examples
directxwindows-8windows-runtimedirect3ddirect2d

Flickering issue with VirtualSurfaceImageSource


I'm considering using VirtualSurfaceImageSource in my application, and I've implemented something similar to the Direct2D magazine app sample, but I've run into a problem which occurs when the virtual surface is several times larger than the display area.

Basically, I have a horizontally scrolling ScrollViewer which contains an Image. The source of the image is a wide VirtualSurfaceImageSource (at least ~10000 x 500 px). The width of the ScrollViewer is 1280 px.

When I scroll the scroll viewer with touch panning, the image sometimes flicker - a part of the image disappears and then it's redrawn. This usually happens when the inertial scrolling stops. The image is already fully drawn when it scrolls into the view, but for some reason it's cleared and IVirtualSurfaceUpdatesCallbackNative::UpdatesNeeded() is called.

I've uploaded a video which illustrates the problem. Watch what happens when the scrolling stops (at 0:02, 0:17, etc...)

Any ideas why this is happening?

I've also noticed that the flickering doesn't occur if the image width is ~5000 px or less.


If you want to reproduce this, start from the Direct2D magazine app sample and add more text in the Sample.story, under the <text name="butterfly-body"> tag - just copy the existing text 10 times or so. Try scrolling the butterfly page in both directions and with varying speed, and you should see what appears to be the same problem.

I've asked this question in an MSDN forum, but so far I've gotten no answer.


Solution

  • This is no longer an issue in Windows 8 Release Preview, so it was probably just a bug in the Consumer Preview.