Title: [158160] trunk/Source
Revision
158160
Author
[email protected]
Date
2013-10-28 19:45:08 -0700 (Mon, 28 Oct 2013)

Log Message

Make TileController create the appropriate PlatformCALayer subclasses
https://bugs.webkit.org/show_bug.cgi?id=123418

Reviewed by Simon Fraser.

Add PlatformCALayer::createCompatibleLayer, which is overridden in
each of the subclasses to create a PlatformCALayer instance of the same
subclass. This is used in TileController to make bare PlatformCALayers
of the correct type (Mac, Win, or Remote).

* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::createCompatibleLayer):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::createCompatibleLayer):
* platform/graphics/ca/win/PlatformCALayerWin.h:
Add createCompatibleLayer and implement it in the subclasses.

* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::TileController):
(WebCore::TileController::tiledScrollingIndicatorLayer):
(WebCore::TileController::createTileLayer):
Make use of createCompatibleLayer when creating PlatformCALayers.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::createCompatibleLayer):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
Add createCompatibleLayer and implement it in the subclasses.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (158159 => 158160)


--- trunk/Source/WebCore/ChangeLog	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebCore/ChangeLog	2013-10-29 02:45:08 UTC (rev 158160)
@@ -1,3 +1,30 @@
+2013-10-28  Tim Horton  <[email protected]>
+
+        Make TileController create the appropriate PlatformCALayer subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=123418
+
+        Reviewed by Simon Fraser.
+
+        Add PlatformCALayer::createCompatibleLayer, which is overridden in
+        each of the subclasses to create a PlatformCALayer instance of the same
+        subclass. This is used in TileController to make bare PlatformCALayers
+        of the correct type (Mac, Win, or Remote).
+
+        * platform/graphics/ca/PlatformCALayer.h:
+        * platform/graphics/ca/mac/PlatformCALayerMac.h:
+        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+        (PlatformCALayerMac::createCompatibleLayer):
+        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+        (PlatformCALayerWin::createCompatibleLayer):
+        * platform/graphics/ca/win/PlatformCALayerWin.h:
+        Add createCompatibleLayer and implement it in the subclasses.
+
+        * platform/graphics/ca/mac/TileController.mm:
+        (WebCore::TileController::TileController):
+        (WebCore::TileController::tiledScrollingIndicatorLayer):
+        (WebCore::TileController::createTileLayer):
+        Make use of createCompatibleLayer when creating PlatformCALayers.
+
 2013-10-28  Alexandru Chiculita  <[email protected]>
 
         Web Inspector: CSS Regions: Add protocol API to expose content nodes addition/removal

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


--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2013-10-29 02:45:08 UTC (rev 158160)
@@ -198,6 +198,8 @@
 #endif // NDEBUG
 #endif // PLATFORM(WIN)
 
+    virtual PassRefPtr<PlatformCALayer> createCompatibleLayer(LayerType, PlatformCALayerClient*) const = 0;
+
 protected:
     PlatformCALayer(LayerType layerType, PlatformCALayerClient* owner)
         : m_layerType(layerType)

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (158159 => 158160)


--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h	2013-10-29 02:45:08 UTC (rev 158160)
@@ -139,6 +139,8 @@
 
     virtual PassRefPtr<PlatformCALayer> clone(PlatformCALayerClient* owner) const OVERRIDE;
 
+    virtual PassRefPtr<PlatformCALayer> createCompatibleLayer(PlatformCALayer::LayerType, PlatformCALayerClient*) const OVERRIDE;
+
 private:
     PlatformCALayerMac(LayerType, PlatformLayer*, PlatformCALayerClient* owner);
 

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


--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm	2013-10-29 02:45:08 UTC (rev 158160)
@@ -729,4 +729,9 @@
     return (AVPlayerLayer *)m_layer.get();
 }
 
+PassRefPtr<PlatformCALayer> PlatformCALayerMac::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
+{
+    return PlatformCALayerMac::create(layerType, client);
+}
+
 #endif // USE(ACCELERATED_COMPOSITING)

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm (158159 => 158160)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm	2013-10-29 02:45:08 UTC (rev 158160)
@@ -28,7 +28,6 @@
 
 #import "IntRect.h"
 #import "PlatformCALayer.h"
-#import "PlatformCALayerMac.h"
 #import "Region.h"
 #import "LayerPool.h"
 #import "WebLayer.h"
@@ -70,7 +69,7 @@
     , m_tileDebugBorderWidth(0)
     , m_indicatorMode(ThreadedScrollingIndication)
 {
-    m_tileContainerLayer = PlatformCALayerMac::create(PlatformCALayer::LayerTypeLayer, nullptr);
+    m_tileContainerLayer = m_tileCacheLayer->createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr);
 #ifndef NDEBUG
     m_tileContainerLayer->setName("TileController Container Layer");
 #endif
@@ -894,14 +893,14 @@
 PlatformCALayer* TileController::tiledScrollingIndicatorLayer()
 {
     if (!m_tiledScrollingIndicatorLayer) {
-        m_tiledScrollingIndicatorLayer = PlatformCALayerMac::create(PlatformCALayer::LayerTypeSimpleLayer, this);
+        m_tiledScrollingIndicatorLayer = m_tileCacheLayer->createCompatibleLayer(PlatformCALayer::LayerTypeSimpleLayer, this);
         m_tiledScrollingIndicatorLayer->setOpacity(0.75);
         m_tiledScrollingIndicatorLayer->setAnchorPoint(FloatPoint3D());
         m_tiledScrollingIndicatorLayer->setBorderColor(Color::black);
         m_tiledScrollingIndicatorLayer->setBorderWidth(1);
         m_tiledScrollingIndicatorLayer->setPosition(FloatPoint(2, 2));
 
-        m_visibleRectIndicatorLayer = PlatformCALayerMac::create(PlatformCALayer::LayerTypeLayer, nullptr);
+        m_visibleRectIndicatorLayer = m_tileCacheLayer->createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr);
         m_visibleRectIndicatorLayer->setBorderWidth(2);
         m_visibleRectIndicatorLayer->setAnchorPoint(FloatPoint3D());
         m_visibleRectIndicatorLayer->setBorderColor(Color(255, 0, 0));
@@ -933,7 +932,7 @@
         m_tileRepaintCounts.remove(layer.get());
         layer->setOwner(this);
     } else
-        layer = PlatformCALayerMac::create(PlatformCALayer::LayerTypeTiledBackingTileLayer, this);
+        layer = m_tileCacheLayer->createCompatibleLayer(PlatformCALayer::LayerTypeTiledBackingTileLayer, this);
 
     layer->setAnchorPoint(FloatPoint3D());
     layer->setBounds(FloatRect(FloatPoint(), tileRect.size()));

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp (158159 => 158160)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp	2013-10-29 02:45:08 UTC (rev 158160)
@@ -670,4 +670,9 @@
 }
 #endif // #ifndef NDEBUG
 
+PassRefPtr<PlatformCALayer> PlatformCALayerWin::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
+{
+    return PlatformCALayerWin::create(layerType, client);
+}
+
 #endif // USE(ACCELERATED_COMPOSITING)

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h (158159 => 158160)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h	2013-10-29 02:45:08 UTC (rev 158160)
@@ -140,6 +140,8 @@
 
     virtual PassRefPtr<PlatformCALayer> clone(PlatformCALayerClient* owner) const OVERRIDE;
 
+    virtual PassRefPtr<PlatformCALayer> createCompatibleLayer(PlatformCALayer::LayerType, PlatformCALayerClient*) const OVERRIDE;
+
 private:
     PlatformCALayerWin(LayerType, PlatformLayer*, PlatformCALayerClient* owner);
 

Modified: trunk/Source/WebKit2/ChangeLog (158159 => 158160)


--- trunk/Source/WebKit2/ChangeLog	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebKit2/ChangeLog	2013-10-29 02:45:08 UTC (rev 158160)
@@ -1,3 +1,15 @@
+2013-10-28  Tim Horton  <[email protected]>
+
+        Make TileController create the appropriate PlatformCALayer subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=123418
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (PlatformCALayerRemote::createCompatibleLayer):
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+        Add createCompatibleLayer and implement it in the subclasses.
+
 2013-10-28  Benjamin Poulain  <[email protected]>
 
         Rename applyPageScaleFactorInCompositor to delegatesPageScaling

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (158159 => 158160)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp	2013-10-29 02:45:08 UTC (rev 158160)
@@ -477,4 +477,9 @@
     return nullptr;
 }
 
+PassRefPtr<PlatformCALayer> PlatformCALayerRemote::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
+{
+    return PlatformCALayerRemote::create(layerType, client, m_context);
+}
+
 #endif // USE(ACCELERATED_COMPOSITING)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (158159 => 158160)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h	2013-10-29 02:38:09 UTC (rev 158159)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h	2013-10-29 02:45:08 UTC (rev 158160)
@@ -143,6 +143,8 @@
 
     virtual PassRefPtr<WebCore::PlatformCALayer> clone(WebCore::PlatformCALayerClient* owner) const OVERRIDE;
 
+    virtual PassRefPtr<PlatformCALayer> createCompatibleLayer(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient*) const OVERRIDE;
+
 private:
     PlatformCALayerRemote(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext* context);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to