[WinCairo][WebKitTestRunner] pixel image dump outputs blank images
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jun 2019 01:51:09 +0000 (01:51 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jun 2019 01:51:09 +0000 (01:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198820

Reviewed by Ross Kirsling.

WebView window paints nothing because it is moved out of the
screen. Send WM_PRINT with memory DC instead of WM_PAINT as well
as DumpRenderTree does.

* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::windowSnapshotImage): Send WM_PRINT instead of BitBlt.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246418 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp

index 19e56cb..3118e10 100644 (file)
@@ -1,3 +1,17 @@
+2019-06-13  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [WinCairo][WebKitTestRunner] pixel image dump outputs blank images
+        https://bugs.webkit.org/show_bug.cgi?id=198820
+
+        Reviewed by Ross Kirsling.
+
+        WebView window paints nothing because it is moved out of the
+        screen. Send WM_PRINT with memory DC instead of WM_PAINT as well
+        as DumpRenderTree does.
+
+        * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+        (WTR::PlatformWebView::windowSnapshotImage): Send WM_PRINT instead of BitBlt.
+
 2019-06-13  Tim Horton  <timothy_horton@apple.com>
 
         Make it possible for validate-committer-lists to dump a mailmap file
index 3913dba..002f551 100644 (file)
@@ -225,17 +225,8 @@ cairo_surface_t* PlatformWebView::windowSnapshotImage()
     if (!bitmap)
         return nullptr;
 
-    ::InvalidateRect(m_window, nullptr, true);
     ::SelectObject(memoryDC.get(), bitmap.get());
-    ::BitBlt(memoryDC.get(),
-        0,
-        0,
-        width,
-        height,
-        windowDC,
-        0,
-        0,
-        SRCCOPY);
+    ::SendMessage(m_window, WM_PRINT, reinterpret_cast<WPARAM>(memoryDC.get()), PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
 
     BITMAP bitmapTag { };
     GetObject(bitmap.get(), sizeof(bitmapTag), &bitmapTag);