Title: [157174] trunk/Source/WebKit/win
Revision
157174
Author
[email protected]
Date
2013-10-09 10:05:39 -0700 (Wed, 09 Oct 2013)

Log Message

[Win] BeginPaint should only be called in response to WM_PAINT.
https://bugs.webkit.org/show_bug.cgi?id=122549

Patch by [email protected] <[email protected]> on 2013-10-09
Reviewed by Brent Fulgham.

According to the documentation, the Win32 api function BeginPaint should only be called in response to a WM_PAINT message.
Currently, the WebView window procedure might call this function (via WebView::paint(0, 0)) for all types of messages.
Also, there is potential for double drawing. If some message is dispatched before WM_PAINT, WebView::paint(0, 0) will be called.
This call does not validate the area drawn, so later the WM_PAINT will arrive, drawing the same area.
This can be fixed by calling the Win32 function UpdateWindow(), which will do a synchronous window update, and validate the area.

* WebView.cpp:
(WebView::WebViewWndProc): Use Win32 function UpdateWindow() to draw invalid area.

Modified Paths

Diff

Modified: trunk/Source/WebKit/win/ChangeLog (157173 => 157174)


--- trunk/Source/WebKit/win/ChangeLog	2013-10-09 17:02:37 UTC (rev 157173)
+++ trunk/Source/WebKit/win/ChangeLog	2013-10-09 17:05:39 UTC (rev 157174)
@@ -1,3 +1,19 @@
+2013-10-09  [email protected]  <[email protected]>
+
+        [Win] BeginPaint should only be called in response to WM_PAINT.
+        https://bugs.webkit.org/show_bug.cgi?id=122549
+
+        Reviewed by Brent Fulgham.
+
+        According to the documentation, the Win32 api function BeginPaint should only be called in response to a WM_PAINT message.
+        Currently, the WebView window procedure might call this function (via WebView::paint(0, 0)) for all types of messages.
+        Also, there is potential for double drawing. If some message is dispatched before WM_PAINT, WebView::paint(0, 0) will be called.
+        This call does not validate the area drawn, so later the WM_PAINT will arrive, drawing the same area.
+        This can be fixed by calling the Win32 function UpdateWindow(), which will do a synchronous window update, and validate the area.
+
+        * WebView.cpp:
+        (WebView::WebViewWndProc): Use Win32 function UpdateWindow() to draw invalid area.
+
 2013-10-07  Sam Weinig  <[email protected]>
 
         Consolidate findString functions

Modified: trunk/Source/WebKit/win/WebView.cpp (157173 => 157174)


--- trunk/Source/WebKit/win/WebView.cpp	2013-10-09 17:02:37 UTC (rev 157173)
+++ trunk/Source/WebKit/win/WebView.cpp	2013-10-09 17:05:39 UTC (rev 157174)
@@ -2463,11 +2463,8 @@
             break;
     }
 
-    if (webView->needsDisplay()) {
-        webView->paint(0, 0);
-        if (webView->usesLayeredWindow())
-            webView->performLayeredWindowUpdate();
-    }
+    if (webView->needsDisplay() && message != WM_PAINT)
+        ::UpdateWindow(hWnd);
 
     if (!handled)
         lResult = DefWindowProc(hWnd, message, wParam, lParam);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to