Title: [141952] trunk/Source/WebKit2
Revision
141952
Author
[email protected]
Date
2013-02-05 17:32:17 -0800 (Tue, 05 Feb 2013)

Log Message

[wk2] TiledCoreAnimationDrawingArea has one more layer in its CAContext when we're in the background
https://bugs.webkit.org/show_bug.cgi?id=108992
<rdar://problem/13087365>

Reviewed by Anders Carlsson.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
(TiledCoreAnimationDrawingArea): Add storage for m_isInWindow.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateLayerHostingContext): Only set the root layer on our layer
hosting context if we're in the window when swapping out contexts.
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer): Update m_isInWindow, and set the root layer
of the layer hosting context (or unset it if we're out of the window).

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (141951 => 141952)


--- trunk/Source/WebKit2/ChangeLog	2013-02-06 01:06:55 UTC (rev 141951)
+++ trunk/Source/WebKit2/ChangeLog	2013-02-06 01:32:17 UTC (rev 141952)
@@ -1,3 +1,19 @@
+2013-02-05  Tim Horton  <[email protected]>
+
+        [wk2] TiledCoreAnimationDrawingArea has one more layer in its CAContext when we're in the background
+        https://bugs.webkit.org/show_bug.cgi?id=108992
+        <rdar://problem/13087365>
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        (TiledCoreAnimationDrawingArea): Add storage for m_isInWindow.
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::updateLayerHostingContext): Only set the root layer on our layer
+        hosting context if we're in the window when swapping out contexts.
+        (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer): Update m_isInWindow, and set the root layer
+        of the layer hosting context (or unset it if we're out of the window).
+
 2013-02-05  Anders Carlsson  <[email protected]>
 
         WebKit clients should be able to override loading of blocked plug-ins

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (141951 => 141952)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2013-02-06 01:06:55 UTC (rev 141951)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2013-02-06 01:32:17 UTC (rev 141952)
@@ -117,6 +117,7 @@
     mutable RetainPtr<CALayer> m_pageOverlayPlatformLayer;
 
     bool m_isPaintingSuspended;
+    bool m_hasRootCompositingLayer;
 
     WebCore::IntRect m_exposedRect;
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (141951 => 141952)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2013-02-06 01:06:55 UTC (rev 141951)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2013-02-06 01:32:17 UTC (rev 141952)
@@ -446,7 +446,9 @@
 #endif
     }
 
-    m_layerHostingContext->setRootLayer(m_rootLayer.get());
+    if (m_hasRootCompositingLayer)
+        m_layerHostingContext->setRootLayer(m_rootLayer.get());
+
     if (colorSpace)
         m_layerHostingContext->setColorSpace(colorSpace.get());
 }
@@ -455,11 +457,17 @@
 {
     ASSERT(!m_layerTreeStateIsFrozen);
 
+    bool hadRootCompositingLayer = m_hasRootCompositingLayer;
+    m_hasRootCompositingLayer = !!layer;
+
     [CATransaction begin];
     [CATransaction setDisableActions:YES];
 
-    m_rootLayer.get().sublayers = layer ? [NSArray arrayWithObject:layer] : [NSArray array];
+    m_rootLayer.get().sublayers = m_hasRootCompositingLayer ? [NSArray arrayWithObject:layer] : [NSArray array];
 
+    if (hadRootCompositingLayer != m_hasRootCompositingLayer)
+        m_layerHostingContext->setRootLayer(m_hasRootCompositingLayer ? m_rootLayer.get() : 0);
+
     if (m_pageOverlayLayer)
         [m_rootLayer.get() addSublayer:m_pageOverlayLayer->platformLayer()];
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to