Keep animation running while moving the mouse in viewer (on Windows)

Animated slides (like addarc) would appear to pause while dragging the
mouse around. This was because the message queue was never empty - we
would just alternate handling WM_MOUSEMOVE and WM_PAINT messages. Forcing
an onIdle before each onPaint appears to fix the problem.

Bug: skia:
Change-Id: I1d19f83c2cf480f327420a2682a074213847d062
Reviewed-on: https://skia-review.googlesource.com/80620
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tools/sk_app/win/main_win.cpp b/tools/sk_app/win/main_win.cpp
index 4765442..4913587 100644
--- a/tools/sk_app/win/main_win.cpp
+++ b/tools/sk_app/win/main_win.cpp
@@ -65,13 +65,25 @@
     MSG msg;
     memset(&msg, 0, sizeof(msg));
 
+    bool idled = false;
+
     // Main message loop
     while (WM_QUIT != msg.message) {
         if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {
             TranslateMessage(&msg);
+
+            if (WM_PAINT == msg.message) {
+                // Ensure that call onIdle at least once per WM_PAINT, or mouse events can
+                // overwhelm the message processing loop, and prevent animation from running.
+                if (!idled) {
+                    app->onIdle();
+                }
+                idled = false;
+            }
             DispatchMessage(&msg);
         } else {
             app->onIdle();
+            idled = true;
         }
     }