Title: [103103] trunk/Source/WebCore
Revision
103103
Author
simon.fra...@apple.com
Date
2011-12-16 13:49:33 -0800 (Fri, 16 Dec 2011)

Log Message

Allow a PlatformCALayer to own its own sublayers
https://bugs.webkit.org/show_bug.cgi?id=74744

Reviewed by Anders Carlsson.

GraphicsLayerCA rebuilds the sublayer list of CALayers, which would
blow away any custom layers that a PlatformCALayer wants to maintain
as children.

Make it possible for a PlatformLayerCA to indicate that it wants
a specific list of sublayers to be maintained as the first layers
in the child list.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateSublayerList):
* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::customSublayers):
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayer::PlatformCALayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (103102 => 103103)


--- trunk/Source/WebCore/ChangeLog	2011-12-16 21:44:45 UTC (rev 103102)
+++ trunk/Source/WebCore/ChangeLog	2011-12-16 21:49:33 UTC (rev 103103)
@@ -1,3 +1,25 @@
+2011-12-16  Simon Fraser  <simon.fra...@apple.com>
+
+        Allow a PlatformCALayer to own its own sublayers
+        https://bugs.webkit.org/show_bug.cgi?id=74744
+
+        Reviewed by Anders Carlsson.
+
+        GraphicsLayerCA rebuilds the sublayer list of CALayers, which would
+        blow away any custom layers that a PlatformCALayer wants to maintain
+        as children.
+        
+        Make it possible for a PlatformLayerCA to indicate that it wants
+        a specific list of sublayers to be maintained as the first layers
+        in the child list.
+        
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::updateSublayerList):
+        * platform/graphics/ca/PlatformCALayer.h:
+        (WebCore::PlatformCALayer::customSublayers):
+        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+        (PlatformCALayer::PlatformCALayer):
+
 2011-12-16  Adam Barth  <aba...@webkit.org>
 
         <!DOCTYPE html><pre>&#x0a;&#x0a;A</pre> doesn't parse correctly

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (103102 => 103103)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2011-12-16 21:44:45 UTC (rev 103102)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2011-12-16 21:49:33 UTC (rev 103103)
@@ -1018,6 +1018,9 @@
     PlatformCALayerList newSublayers;
     const Vector<GraphicsLayer*>& childLayers = children();
 
+    if (const PlatformCALayerList* customSublayers = m_layer->customSublayers())
+        newSublayers.appendRange(customSublayers->begin(), customSublayers->end());
+    
     if (m_structuralLayer || m_contentsLayer || childLayers.size() > 0) {
         if (m_structuralLayer) {
             // Add the replica layer first.

Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (103102 => 103103)


--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2011-12-16 21:44:45 UTC (rev 103102)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2011-12-16 21:49:33 UTC (rev 103103)
@@ -81,6 +81,9 @@
 
     PlatformCALayer* rootLayer() const;
     
+    // A list of sublayers that GraphicsLayerCA should maintain as the first sublayers.
+    const PlatformCALayerList* customSublayers() const { return m_customSublayers.get(); }
+    
     static bool isValueFunctionSupported();
     
     PlatformCALayerClient* owner() const { return m_owner; }
@@ -214,6 +217,7 @@
     PlatformCALayerClient* m_owner;
     LayerType m_layerType;
     
+    OwnPtr<PlatformCALayerList> m_customSublayers;
 #if PLATFORM(MAC) || PLATFORM(WIN)
     RetainPtr<PlatformLayer> m_layer;
 #endif

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (103102 => 103103)


--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm	2011-12-16 21:44:45 UTC (rev 103102)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm	2011-12-16 21:49:33 UTC (rev 103103)
@@ -216,6 +216,13 @@
         [tiledLayer setContentsGravity:@"bottomLeft"];
     }
     
+    if (m_layerType == LayerTypeTileCacheLayer) {
+        // FIXME: hook this up to the tile cache.
+//        m_customSublayers = adoptPtr(new PlatformCALayerList(1));
+//        CALayer* tileCacheTileContainerLayer = [static_cast<WebTileCacheLayer *>(m_layer.get()) tileContainerLayer];
+//        m_customSublayers->append(PlatformCALayer::create(tileCacheTileContainerLayer, 0));
+    }
+    
     END_BLOCK_OBJC_EXCEPTIONS
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to