Tiled page overlay layers don't create tiles until the first flush after they switch...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 07:52:58 +0000 (07:52 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 07:52:58 +0000 (07:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112860
<rdar://problem/13468400>

Reviewed by Simon Fraser.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
(TiledCoreAnimationDrawingArea): Add storage for m_clipsToExposedRect.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
The page overlay layer will never have children, so we can use flushCompositingState instead of the ForThisLayerOnly variant.
Pass the visible rect of the page overlay layer (computed by intersecting its bounds with the exposed
rect that comes from the WKView) to flushCompositingState; don't bother setting the visible rect manually.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameScrollabilityChanged):
Store m_clipsToExposedRect so we can use it in flushLayers.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index 02c9cf3..dece3af 100644 (file)
@@ -1,3 +1,21 @@
+2013-03-21  Tim Horton  <timothy_horton@apple.com>
+
+        Tiled page overlay layers don't create tiles until the first flush after they switch to being tiled
+        https://bugs.webkit.org/show_bug.cgi?id=112860
+        <rdar://problem/13468400>
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        (TiledCoreAnimationDrawingArea): Add storage for m_clipsToExposedRect.
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+        The page overlay layer will never have children, so we can use flushCompositingState instead of the ForThisLayerOnly variant.
+        Pass the visible rect of the page overlay layer (computed by intersecting its bounds with the exposed
+        rect that comes from the WKView) to flushCompositingState; don't bother setting the visible rect manually.
+        (WebKit::TiledCoreAnimationDrawingArea::mainFrameScrollabilityChanged):
+        Store m_clipsToExposedRect so we can use it in flushLayers.
+
 2013-03-20  Benjamin Poulain  <bpoulain@apple.com>
 
         [WK2] Remove VIEW_MODE_CSS_MEDIA from WebKit2
index b72eb24..c42a307 100644 (file)
@@ -124,6 +124,7 @@ private:
     bool m_hasRootCompositingLayer;
 
     WebCore::FloatRect m_exposedRect;
+    bool m_clipsToExposedRect;
 
     WebCore::IntSize m_lastSentIntrinsicContentSize;
     bool m_inUpdateGeometry;
index 6e2f68d..ad0bf0f 100644 (file)
@@ -70,6 +70,7 @@ TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea(WebPage* webPage, c
     , m_layerTreeStateIsFrozen(false)
     , m_layerFlushScheduler(this)
     , m_isPaintingSuspended(!parameters.isVisible)
+    , m_clipsToExposedRect(false)
 {
     Page* page = m_webPage->corePage();
 
@@ -319,12 +320,13 @@ bool TiledCoreAnimationDrawingArea::flushLayers()
     }
 
     PageOverlayLayerMap::iterator end = m_pageOverlayLayers.end();
+    IntRect visibleRect = enclosingIntRect(m_rootLayer.get().frame);
+    if (m_clipsToExposedRect)
+        visibleRect.intersect(enclosingIntRect(m_exposedRect));
     for (PageOverlayLayerMap::iterator it = m_pageOverlayLayers.begin(); it != end; ++it) {
         GraphicsLayer* layer = it->value.get();
         layer->setNeedsDisplay();
-        if (TiledBacking* overlayTiledBacking = layer->tiledBacking())
-            overlayTiledBacking->setVisibleRect(enclosingIntRect(m_rootLayer.get().frame));
-        layer->flushCompositingStateForThisLayerOnly();
+        layer->flushCompositingState(visibleRect);
     }
 
     bool returnValue = m_webPage->corePage()->mainFrame()->view()->flushCompositingStateIncludingSubframes();
@@ -375,6 +377,7 @@ void TiledCoreAnimationDrawingArea::setExposedRect(const FloatRect& exposedRect)
 
 void TiledCoreAnimationDrawingArea::mainFrameScrollabilityChanged(bool isScrollable)
 {
+    m_clipsToExposedRect = !isScrollable;
     mainFrameTiledBacking()->setClipsToExposedRect(!isScrollable);
 
     PageOverlayLayerMap::iterator end = m_pageOverlayLayers.end();