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: http://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 5d63684..ea6b2fa 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 f531750..8057af8 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 2195c11..6be6162 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 71704b5..484fad0 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 b2a20f0..4ba04a7 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); 
 }