WKView does not draw after forced repaint before the first update
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 May 2011 20:41:58 +0000 (20:41 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 May 2011 20:41:58 +0000 (20:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=60845

Reviewed by Alice Liu.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint): Added.
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::waitForBackingStoreUpdateOnNextPaint): Set m_hasReceivedFirstUpdate
to true, ensuring that paint() will wait for an update if needed.
* UIProcess/DrawingAreaProxyImpl.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::forceRepaint): Call DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint().

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/DrawingAreaProxy.h
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
Source/WebKit2/UIProcess/WebPageProxy.cpp

index 5d636848cd24e7514dc8faa16949750573ae2398..ea6b2fa087c2f633b066219504a4834d59874bc3 100644 (file)
@@ -1,3 +1,19 @@
+2011-05-14  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Alice Liu.
+
+        WKView does not draw after forced repaint before the first update
+        https://bugs.webkit.org/show_bug.cgi?id=60845
+
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint): Added.
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        (WebKit::DrawingAreaProxyImpl::waitForBackingStoreUpdateOnNextPaint): Set m_hasReceivedFirstUpdate
+        to true, ensuring that paint() will wait for an update if needed.
+        * UIProcess/DrawingAreaProxyImpl.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::forceRepaint): Call DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint().
+
 2011-05-14  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam Weinig.
index f531750a4e63453ca5392915355eec09007e03aa..8057af849f526a9fd83ff75ea6f1fc8070b44450 100644 (file)
@@ -86,7 +86,9 @@ public:
     // FIXME: These should be pure virtual.
     virtual void visibilityDidChange() { }
     virtual void setBackingStoreIsDiscardable(bool) { }
-    
+
+    virtual void waitForBackingStoreUpdateOnNextPaint() { }
+
     virtual void setPageIsVisible(bool isVisible) = 0;
 
     const WebCore::IntSize& size() const { return m_size; }
index 2195c1135d2121a10c308b9dab69de0956549680..6be616269e0eb64c1066419f0d990cb3d5b28613 100644 (file)
@@ -162,6 +162,11 @@ void DrawingAreaProxyImpl::setBackingStoreIsDiscardable(bool isBackingStoreDisca
         m_discardBackingStoreTimer.stop();
 }
 
+void DrawingAreaProxyImpl::waitForBackingStoreUpdateOnNextPaint()
+{
+    m_hasReceivedFirstUpdate = true;
+}
+
 void DrawingAreaProxyImpl::update(uint64_t backingStoreStateID, const UpdateInfo& updateInfo)
 {
     ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
index 71704b5096034c8549c8631e1c8fcb74a462dc7d..484fad014648811d039ac9954686b71dead35966 100644 (file)
@@ -55,6 +55,7 @@ private:
     virtual void visibilityDidChange();
     virtual void setPageIsVisible(bool);
     virtual void setBackingStoreIsDiscardable(bool);
+    virtual void waitForBackingStoreUpdateOnNextPaint();
 
     // CoreIPC message handlers
     virtual void update(uint64_t backingStoreStateID, const UpdateInfo&);
index b2a20f040e3731cbc42c6c8413be8583918ffbfc..4ba04a7b3eac9c549db0d0ae728cf06e46a40064 100644 (file)
@@ -1305,6 +1305,7 @@ void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
 
     uint64_t callbackID = callback->callbackID();
     m_voidCallbacks.set(callbackID, callback.get());
+    m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
     process()->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID); 
 }