RESOLVED FIXED 121329
[Windows] Rendering stops when mouse is moving for some types of animations
https://bugs.webkit.org/show_bug.cgi?id=121329
Summary [Windows] Rendering stops when mouse is moving for some types of animations
Brent Fulgham
Reported 2013-09-13 15:35:16 PDT
The "Canvas Performance Test" (http://www.smashcat.org/av/canvas_test/) exposes a bug on Windows (and WinCairo) rendering. If you view the website, and move the mouse while the animation plays, you will see that painting of the animation stops while the mouse is in motion. Once the mouse movement stops, the animation snaps to the proper state for the current time-slice. Interestingly, this problem does not appear when using CSS animation effects, or the requestAnimationFrame infrastructure. For example, this test does not show a problem: http://www.html5canvastutorials.com/demos/advanced/html5-canvas-linear-motion-animation/index.php
Attachments
Patch (4.83 KB, patch)
2013-09-16 14:27 PDT, Brent Fulgham
andersca: review+
Radar WebKit Bug Importer
Comment 1 2013-09-13 15:36:24 PDT
Brent Fulgham
Comment 2 2013-09-13 15:39:56 PDT
This animation also does not exhibit the problem: http://jsfiddle.net/XQpzU/4358/light/
Brent Fulgham
Comment 3 2013-09-14 21:49:18 PDT
If I put printf statements at the point where I BitBlt, and at the start of the base WebView::paint method, the two are hit the same number of times. So we are not having a problem where the paint message is getting received, but we are not blitting to the screen. If I print a counter of each time these calls are hit, I stop seeing a counter update when the screen animation stops. This makes me think that the WM_PAINT messages are not getting generated for some reason.
Brent Fulgham
Comment 4 2013-09-15 15:59:25 PDT
This appears to be expected behavior. On Windows, user input always takes precedence over WM_TIMER and WM_PAINT messages. See http://support.microsoft.com/kb/96006?wa=wsignin1.0 for details.
Brent Fulgham
Comment 5 2013-09-15 16:12:55 PDT
One possible solution would be to make a call to webView->paint(0, 0); at the end of the mouse-move message handler. But this will cause the backing store to be blitted into the WebView more often than it would have been.
Adam Roben (:aroben)
Comment 6 2013-09-15 18:30:45 PDT
It looks like Chrome's generic HWND code schedules a repaint after every message is processed by the message loop: https://code.google.com/p/chromium/codesearch#chromium/src/ui/views/win/hwnd_message_handler.cc&q=WM_PAINT&sq=package:chromium&l=923&dr=C And it looks like RenderWidgetHostViewWin repaints immediately every time new bits are received from the web process: https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/renderer_host/render_widget_host_view_win.cc&q=Redraw%5C(%5C)&sq=package:chromium&l=794&dr=C (It's definitely possible I'm misinterpreting some of this code.) I don't know whether or how Chrome avoids repainting the same region of the window multiple times within a single frame. But it certainly looks like they aren't just counting on WM_PAINT to be delivered reliably (since obviously you can't).
Brent Fulgham
Comment 7 2013-09-16 14:27:56 PDT
Brent Fulgham
Comment 8 2013-09-16 14:29:33 PDT
Note You need to log in before you can comment on or make changes to this bug.