[wk2] All intrinsic content size changes should go through the 0-delay timer
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jun 2013 00:01:54 +0000 (00:01 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jun 2013 00:01:54 +0000 (00:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117058
<rdar://problem/13935042>

Reviewed by Anders Carlsson.

In r146913, I added a 0-delay timer so that we'd coalesce intrinsic
content size changes. However, didUpdateGeometry was still immediately
invalidating the intrinsic content size without coalescing.

Move that update to the WebProcess to share the timer.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::didUpdateGeometry):
* UIProcess/DrawingAreaProxy.messages.in:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
Remove the newIntrinsicContentSize argument, and don't invalidate intrinsic
content size inside didUpdateGeometry.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
Start the intrinsic content size update timer when we finish updateGeometry.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/DrawingAreaProxy.h
Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in
Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h
Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index 381c20d..e9a2add 100644 (file)
@@ -1,3 +1,30 @@
+2013-05-31  Tim Horton  <timothy_horton@apple.com>
+
+        [wk2] All intrinsic content size changes should go through the 0-delay timer
+        https://bugs.webkit.org/show_bug.cgi?id=117058
+        <rdar://problem/13935042>
+
+        Reviewed by Anders Carlsson.
+
+        In r146913, I added a 0-delay timer so that we'd coalesce intrinsic
+        content size changes. However, didUpdateGeometry was still immediately
+        invalidating the intrinsic content size without coalescing.
+
+        Move that update to the WebProcess to share the timer.
+
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::didUpdateGeometry):
+        * UIProcess/DrawingAreaProxy.messages.in:
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
+        Remove the newIntrinsicContentSize argument, and don't invalidate intrinsic
+        content size inside didUpdateGeometry.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
+        Start the intrinsic content size update timer when we finish updateGeometry.
+
 2013-05-31  Alexey Proskuryakov  <ap@apple.com>
 
         Sandbox violations when trying to access fonts in non-standard locations
index fee2317..9f35b3d 100644 (file)
@@ -112,7 +112,7 @@ private:
     virtual void updateAcceleratedCompositingMode(uint64_t /* backingStoreStateID */, const LayerTreeContext&) { }
 #endif
 #if PLATFORM(MAC)
-    virtual void didUpdateGeometry(const WebCore::IntSize& newIntrinsicContentSize) { }
+    virtual void didUpdateGeometry() { }
     virtual void intrinsicContentSizeDidChange(const WebCore::IntSize& newIntrinsicContentSize) { }
 #endif
 };
index b3f02af..a272cb5 100644 (file)
@@ -31,7 +31,7 @@ messages -> DrawingAreaProxy {
 
 #if PLATFORM(MAC)
     // Used by TiledCoreAnimationDrawingAreaProxy.
-    DidUpdateGeometry(WebCore::IntSize newIntrinsicContentSize)
+    DidUpdateGeometry()
     IntrinsicContentSizeDidChange(WebCore::IntSize newIntrinsicContentSize)
 #endif
 }
index 6e74b64..5018bbe 100644 (file)
@@ -55,7 +55,7 @@ private:
     virtual void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) OVERRIDE;
 
     // Message handlers.
-    virtual void didUpdateGeometry(const WebCore::IntSize& newIntrinsicContentSize) OVERRIDE;
+    virtual void didUpdateGeometry() OVERRIDE;
     virtual void intrinsicContentSizeDidChange(const WebCore::IntSize& newIntrinsicContentSize) OVERRIDE;
 
     void sendUpdateGeometry();
index 0d154e4..e3b57bf 100644 (file)
@@ -131,7 +131,7 @@ void TiledCoreAnimationDrawingAreaProxy::updateAcceleratedCompositingMode(uint64
     m_webPageProxy->updateAcceleratedCompositingMode(layerTreeContext);
 }
 
-void TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry(const IntSize& newIntrinsicContentSize)
+void TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry()
 {
     ASSERT(m_isWaitingForDidUpdateGeometry);
 
@@ -143,9 +143,6 @@ void TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry(const IntSize& newInt
     // we need to resend the new size here.
     if (m_lastSentSize != m_size || m_lastSentLayerPosition != m_layerPosition || m_lastSentMinimumLayoutWidth != minimumLayoutWidth)
         sendUpdateGeometry();
-
-    if (minimumLayoutWidth > 0)
-        m_webPageProxy->intrinsicContentSizeDidChange(newIntrinsicContentSize);
 }
 
 void TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange(const IntSize& newIntrinsicContentSize)
index 775c5d7..5af9c9a 100644 (file)
@@ -455,8 +455,10 @@ void TiledCoreAnimationDrawingArea::updateGeometry(const IntSize& viewSize, cons
     [CATransaction flush];
     [CATransaction synchronize];
 
-    m_lastSentIntrinsicContentSize = contentSize;
-    m_webPage->send(Messages::DrawingAreaProxy::DidUpdateGeometry(contentSize));
+    m_webPage->send(Messages::DrawingAreaProxy::DidUpdateGeometry());
+
+    if (m_webPage->minimumLayoutWidth() && !m_updateIntrinsicContentSizeTimer.isActive())
+        m_updateIntrinsicContentSizeTimer.startOneShot(0);
 
     m_inUpdateGeometry = false;
 }