Add a typedef for PlatformLayerID on GraphicsLayer, and migrate RemoteLayerTreeTransa...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jan 2014 18:34:02 +0000 (18:34 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jan 2014 18:34:02 +0000 (18:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=126346

Source/WebCore:

Reviewed by Tim Horton.

Remote scrolling tree code is soon going to use RemoteLayerTreeTransaction::LayerID,
so it makes more sense to put this layerID type on GraphicsLayer as
GraphicsLayer::PlatformLayerID.

Also add some type cast macros for PlatformCALayer and subclasses, and use them
where appropriate.

* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setName):
* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::isPlatformCALayerMac):
(WebCore::PlatformCALayer::isPlatformCALayerRemote):
(WebCore::PlatformCALayer::PlatformCALayer):
* platform/graphics/ca/mac/PlatformCALayerMac.h:

Source/WebKit2:

Reviewed by Tim Horton.

Remote scrolling tree code is soon going to use RemoteLayerTreeTransaction::LayerID,
so it makes more sense to put this layerID type on GraphicsLayer as
GraphicsLayer::PlatformLayerID.

Also add some type cast macros for PlatformCALayer and subclasses, and use them
where appropriate.

* Shared/mac/RemoteLayerTreePropertyApplier.h:
* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::rootLayerID):
(WebKit::RemoteLayerTreeTransaction::changedLayers):
(WebKit::RemoteLayerTreeTransaction::destroyedLayers):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::setRootLayerID):
(WebKit::RemoteLayerTreeTransaction::setDestroyedLayerIDs):
(WebKit::RemoteLayerTreeTextStream::operator<<):
(WebKit::dumpChangedLayers):
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::commit):
(WebKit::RemoteLayerTreeHost::getLayer):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::primaryLayerID):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(generateLayerID):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
(WebKit::PlatformCALayerRemote::layerID):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:

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

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h
Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h
Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h

index 5906c70..0d6abfe 100644 (file)
@@ -1,3 +1,26 @@
+2014-01-01  Simon Fraser  <simon.fraser@apple.com>
+
+        Add a typedef for PlatformLayerID on GraphicsLayer, and migrate RemoteLayerTreeTransaction to use it
+        https://bugs.webkit.org/show_bug.cgi?id=126346
+
+        Reviewed by Tim Horton.
+
+        Remote scrolling tree code is soon going to use RemoteLayerTreeTransaction::LayerID,
+        so it makes more sense to put this layerID type on GraphicsLayer as
+        GraphicsLayer::PlatformLayerID.
+        
+        Also add some type cast macros for PlatformCALayer and subclasses, and use them
+        where appropriate.
+
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setName):
+        * platform/graphics/ca/PlatformCALayer.h:
+        (WebCore::PlatformCALayer::isPlatformCALayerMac):
+        (WebCore::PlatformCALayer::isPlatformCALayerRemote):
+        (WebCore::PlatformCALayer::PlatformCALayer):
+        * platform/graphics/ca/mac/PlatformCALayerMac.h:
+
 2013-12-31  Simon Fraser  <simon.fraser@apple.com>
 
         ScrollingStateNodes should have a reference to the ScrollingStateTree
index 6b68145..ff95086 100644 (file)
@@ -226,6 +226,8 @@ class GraphicsLayer {
 public:
     static std::unique_ptr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*);
     
+    typedef uint64_t PlatformLayerID;
+
     virtual ~GraphicsLayer();
 
     virtual void initialize() { }
index c7a8743..6104b5d 100644 (file)
@@ -389,7 +389,7 @@ void GraphicsLayerCA::setName(const String& name)
 {
     String caLayerDescription;
 
-    if (!m_layer->isRemote())
+    if (!m_layer->isPlatformCALayerRemote())
         caLayerDescription = String::format("CALayer(%p) ", m_layer->platformLayer());
 
     String longName = caLayerDescription + String::format("GraphicsLayer(%p) ", this) + name;
index 3751610..3aecdba 100644 (file)
@@ -80,6 +80,9 @@ public:
 
     virtual ~PlatformCALayer();
 
+    virtual bool isPlatformCALayerMac() const { return false; }
+    virtual bool isPlatformCALayerRemote() const { return false; }
+
     // This function passes the layer as a void* rather than a PlatformLayer because PlatformLayer
     // is defined differently for Obj C and C++. This allows callers from both languages.
     static PlatformCALayer* platformCALayer(void* platformLayer);
@@ -98,7 +101,6 @@ public:
     virtual void setContentsChanged() = 0;
 
     LayerType layerType() const { return m_layerType; }
-    virtual bool isRemote() const { return false; }
 
     virtual PlatformCALayer* superlayer() const = 0;
     virtual void removeFromSuperlayer() = 0;
@@ -211,16 +213,17 @@ protected:
     PlatformCALayer(LayerType layerType, PlatformCALayerClient* owner)
         : m_layerType(layerType)
         , m_owner(owner)
-    {
-
-    }
+    { }
 
     LayerType m_layerType;
     RetainPtr<PlatformLayer> m_layer;
     PlatformCALayerClient* m_owner;
 };
 
-}
+#define PLATFORM_CALAYER_TYPE_CASTS(ToValueTypeName, predicate) \
+    TYPE_CASTS_BASE(ToValueTypeName, WebCore::PlatformCALayer, object, object->predicate, object.predicate)
+
+} // namespace WebCore
 
 #endif // USE(ACCELERATED_COMPOSITING)
 
index 78494ed..98ff602 100644 (file)
@@ -148,6 +148,7 @@ public:
 
 private:
     PlatformCALayerMac(LayerType, PlatformLayer*, PlatformCALayerClient* owner);
+    virtual bool isPlatformCALayerMac() const OVERRIDE { return true; }
 
     bool requiresCustomAppearanceUpdateOnBoundsChange() const;
 
@@ -156,6 +157,8 @@ private:
     GraphicsLayer::CustomAppearance m_customAppearance;
 };
 
+PLATFORM_CALAYER_TYPE_CASTS(PlatformCALayerMac, isPlatformCALayerMac())
+
 } // namespace WebCore
 
 #endif // USE(ACCELERATED_COMPOSITING)
index 0c803b2..dc7f6a2 100644 (file)
@@ -1,3 +1,42 @@
+2014-01-01  Simon Fraser  <simon.fraser@apple.com>
+
+        Add a typedef for PlatformLayerID on GraphicsLayer, and migrate RemoteLayerTreeTransaction to use it
+        https://bugs.webkit.org/show_bug.cgi?id=126346
+
+        Reviewed by Tim Horton.
+        
+        Remote scrolling tree code is soon going to use RemoteLayerTreeTransaction::LayerID,
+        so it makes more sense to put this layerID type on GraphicsLayer as
+        GraphicsLayer::PlatformLayerID.
+        
+        Also add some type cast macros for PlatformCALayer and subclasses, and use them
+        where appropriate.
+
+        * Shared/mac/RemoteLayerTreePropertyApplier.h:
+        * Shared/mac/RemoteLayerTreeTransaction.h:
+        (WebKit::RemoteLayerTreeTransaction::rootLayerID):
+        (WebKit::RemoteLayerTreeTransaction::changedLayers):
+        (WebKit::RemoteLayerTreeTransaction::destroyedLayers):
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::decode):
+        (WebKit::RemoteLayerTreeTransaction::setRootLayerID):
+        (WebKit::RemoteLayerTreeTransaction::setDestroyedLayerIDs):
+        (WebKit::RemoteLayerTreeTextStream::operator<<):
+        (WebKit::dumpChangedLayers):
+        (WebKit::RemoteLayerTreeTransaction::description):
+        * UIProcess/mac/RemoteLayerTreeHost.h:
+        * UIProcess/mac/RemoteLayerTreeHost.mm:
+        (WebKit::RemoteLayerTreeHost::commit):
+        (WebKit::RemoteLayerTreeHost::getLayer):
+        * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
+        (WebKit::GraphicsLayerCARemote::primaryLayerID):
+        * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (generateLayerID):
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+        (WebKit::PlatformCALayerRemote::layerID):
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
+
 2014-01-01  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK] [CMake] Fix the WEBKIT_SRC_DIR define when building the WebKit2 GObject API unit tests
index 5804dca..6aa022b 100644 (file)
@@ -33,7 +33,7 @@ namespace WebKit {
 
 class RemoteLayerTreePropertyApplier {
 public:
-    typedef HashMap<RemoteLayerTreeTransaction::LayerID, CALayer *> RelatedLayerMap;
+    typedef HashMap<WebCore::GraphicsLayer::PlatformLayerID, CALayer *> RelatedLayerMap;
     static void applyPropertiesToLayer(CALayer *, RemoteLayerTreeTransaction::LayerProperties, RelatedLayerMap);
     static void disableActionsForLayer(CALayer *);
 };
index 2523274..eb34a4f 100644 (file)
@@ -47,8 +47,6 @@ class PlatformCALayerRemote;
 
 class RemoteLayerTreeTransaction {
 public:
-    typedef uint64_t LayerID;
-
     enum LayerChange {
         NoChange = 0,
         NameChanged = 1 << 1,
@@ -86,7 +84,7 @@ public:
         void encode(IPC::ArgumentEncoder&) const;
         static bool decode(IPC::ArgumentDecoder&, LayerCreationProperties&);
 
-        LayerID layerID;
+        WebCore::GraphicsLayer::PlatformLayerID layerID;
         WebCore::PlatformCALayer::LayerType type;
 
         uint32_t hostingContextID;
@@ -108,7 +106,7 @@ public:
         LayerChange everChangedProperties;
 
         String name;
-        Vector<LayerID> children;
+        Vector<WebCore::GraphicsLayer::PlatformLayerID> children;
         WebCore::FloatPoint3D position;
         WebCore::FloatSize size;
         WebCore::Color backgroundColor;
@@ -123,7 +121,7 @@ public:
         bool doubleSided;
         bool masksToBounds;
         bool opaque;
-        LayerID maskLayerID;
+        WebCore::GraphicsLayer::PlatformLayerID maskLayerID;
         WebCore::FloatRect contentsRect;
         float contentsScale;
         WebCore::PlatformCALayer::FilterType minificationFilter;
@@ -142,11 +140,11 @@ public:
     void encode(IPC::ArgumentEncoder&) const;
     static bool decode(IPC::ArgumentDecoder&, RemoteLayerTreeTransaction&);
 
-    LayerID rootLayerID() const { return m_rootLayerID; }
-    void setRootLayerID(LayerID rootLayerID);
+    WebCore::GraphicsLayer::PlatformLayerID rootLayerID() const { return m_rootLayerID; }
+    void setRootLayerID(WebCore::GraphicsLayer::PlatformLayerID);
     void layerPropertiesChanged(PlatformCALayerRemote*, LayerProperties&);
     void setCreatedLayers(Vector<LayerCreationProperties>);
-    void setDestroyedLayerIDs(Vector<LayerID>);
+    void setDestroyedLayerIDs(Vector<WebCore::GraphicsLayer::PlatformLayerID>);
 
 #if !defined(NDEBUG) || !LOG_DISABLED
     WTF::CString description() const;
@@ -154,14 +152,14 @@ public:
 #endif
 
     Vector<LayerCreationProperties> createdLayers() const { return m_createdLayers; }
-    HashMap<LayerID, LayerProperties> changedLayers() const { return m_changedLayerProperties; }
-    Vector<LayerID> destroyedLayers() const { return m_destroyedLayerIDs; }
+    HashMap<WebCore::GraphicsLayer::PlatformLayerID, LayerProperties> changedLayers() const { return m_changedLayerProperties; }
+    Vector<WebCore::GraphicsLayer::PlatformLayerID> destroyedLayers() const { return m_destroyedLayerIDs; }
 
 private:
-    LayerID m_rootLayerID;
-    HashMap<LayerID, LayerProperties> m_changedLayerProperties;
+    WebCore::GraphicsLayer::PlatformLayerID m_rootLayerID;
+    HashMap<WebCore::GraphicsLayer::PlatformLayerID, LayerProperties> m_changedLayerProperties;
     Vector<LayerCreationProperties> m_createdLayers;
-    Vector<LayerID> m_destroyedLayerIDs;
+    Vector<WebCore::GraphicsLayer::PlatformLayerID> m_destroyedLayerIDs;
 };
 
 } // namespace WebKit
index dfb7200..d993ed0 100644 (file)
@@ -359,7 +359,8 @@ bool RemoteLayerTreeTransaction::decode(IPC::ArgumentDecoder& decoder, RemoteLay
 
     if (!decoder.decode(result.m_destroyedLayerIDs))
         return false;
-    for (LayerID layerID : result.m_destroyedLayerIDs) {
+
+    for (auto layerID : result.m_destroyedLayerIDs) {
         if (!layerID)
             return false;
     }
@@ -367,7 +368,7 @@ bool RemoteLayerTreeTransaction::decode(IPC::ArgumentDecoder& decoder, RemoteLay
     return true;
 }
 
-void RemoteLayerTreeTransaction::setRootLayerID(LayerID rootLayerID)
+void RemoteLayerTreeTransaction::setRootLayerID(GraphicsLayer::PlatformLayerID rootLayerID)
 {
     ASSERT_ARG(rootLayerID, rootLayerID);
 
@@ -384,7 +385,7 @@ void RemoteLayerTreeTransaction::setCreatedLayers(Vector<LayerCreationProperties
     m_createdLayers = std::move(createdLayers);
 }
 
-void RemoteLayerTreeTransaction::setDestroyedLayerIDs(Vector<LayerID> destroyedLayerIDs)
+void RemoteLayerTreeTransaction::setDestroyedLayerIDs(Vector<GraphicsLayer::PlatformLayerID> destroyedLayerIDs)
 {
     m_destroyedLayerIDs = std::move(destroyedLayerIDs);
 }
@@ -406,7 +407,7 @@ public:
     RemoteLayerTreeTextStream& operator<<(FloatPoint3D);
     RemoteLayerTreeTextStream& operator<<(Color);
     RemoteLayerTreeTextStream& operator<<(FloatRect);
-    RemoteLayerTreeTextStream& operator<<(const Vector<RemoteLayerTreeTransaction::LayerID>& layers);
+    RemoteLayerTreeTextStream& operator<<(const Vector<WebCore::GraphicsLayer::PlatformLayerID>& layers);
     RemoteLayerTreeTextStream& operator<<(const FilterOperations&);
 
     void increaseIndent() { ++m_indent; }
@@ -537,7 +538,7 @@ RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(FloatRect rect)
     return ts;
 }
 
-RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const Vector<RemoteLayerTreeTransaction::LayerID>& layers)
+RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const Vector<GraphicsLayer::PlatformLayerID>& layers)
 {
     RemoteLayerTreeTextStream& ts = *this;
 
@@ -567,7 +568,7 @@ static void dumpProperty(RemoteLayerTreeTextStream& ts, String name, T value)
     ts.decreaseIndent();
 }
 
-static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const HashMap<RemoteLayerTreeTransaction::LayerID, RemoteLayerTreeTransaction::LayerProperties>& changedLayerProperties)
+static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const HashMap<GraphicsLayer::PlatformLayerID, RemoteLayerTreeTransaction::LayerProperties>& changedLayerProperties)
 {
     if (changedLayerProperties.isEmpty())
         return;
@@ -577,7 +578,7 @@ static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const HashMap<Remot
     ts << "(changed-layers";
 
     // Dump the layer properties sorted by layer ID.
-    Vector<RemoteLayerTreeTransaction::LayerID> layerIDs;
+    Vector<GraphicsLayer::PlatformLayerID> layerIDs;
     copyKeysToVector(changedLayerProperties, layerIDs);
     std::sort(layerIDs.begin(), layerIDs.end());
 
@@ -593,7 +594,7 @@ static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const HashMap<Remot
             dumpProperty<String>(ts, "name", layerProperties.name);
 
         if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged)
-            dumpProperty<Vector<RemoteLayerTreeTransaction::LayerID>>(ts, "children", layerProperties.children);
+            dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>(ts, "children", layerProperties.children);
 
         if (layerProperties.changedProperties & RemoteLayerTreeTransaction::PositionChanged)
             dumpProperty<FloatPoint3D>(ts, "position", layerProperties.position);
@@ -638,7 +639,7 @@ static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const HashMap<Remot
             dumpProperty<bool>(ts, "opaque", layerProperties.opaque);
 
         if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged)
-            dumpProperty<RemoteLayerTreeTransaction::LayerID>(ts, "maskLayer", layerProperties.maskLayerID);
+            dumpProperty<GraphicsLayer::PlatformLayerID>(ts, "maskLayer", layerProperties.maskLayerID);
 
         if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ContentsRectChanged)
             dumpProperty<FloatRect>(ts, "contentsRect", layerProperties.contentsRect);
@@ -741,7 +742,7 @@ CString RemoteLayerTreeTransaction::description() const
     dumpChangedLayers(ts, m_changedLayerProperties);
 
     if (!m_destroyedLayerIDs.isEmpty())
-        dumpProperty<Vector<RemoteLayerTreeTransaction::LayerID>>(ts, "destroyed-layers", m_destroyedLayerIDs);
+        dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>(ts, "destroyed-layers", m_destroyedLayerIDs);
 
     ts << ")\n";
 
index b51608d..a479018 100644 (file)
@@ -50,13 +50,13 @@ private:
     // Message handlers.
     void commit(const RemoteLayerTreeTransaction&);
 
-    CALayer *getLayer(RemoteLayerTreeTransaction::LayerID);
+    CALayer *getLayer(WebCore::GraphicsLayer::PlatformLayerID) const;
     CALayer *createLayer(RemoteLayerTreeTransaction::LayerCreationProperties);
 
     WebPageProxy* m_webPageProxy;
 
     CALayer *m_rootLayer;
-    HashMap<RemoteLayerTreeTransaction::LayerID, RetainPtr<CALayer>> m_layers;
+    HashMap<WebCore::GraphicsLayer::PlatformLayerID, RetainPtr<CALayer>> m_layers;
 };
 
 } // namespace WebKit
index 56bda00..876e1bc 100644 (file)
@@ -68,7 +68,7 @@ void RemoteLayerTreeHost::commit(const RemoteLayerTreeTransaction& transaction)
     }
 
     for (auto changedLayer : transaction.changedLayers()) {
-        RemoteLayerTreeTransaction::LayerID layerID = changedLayer.key;
+        auto layerID = changedLayer.key;
         const auto& properties = changedLayer.value;
 
         CALayer *layer = getLayer(layerID);
@@ -90,7 +90,7 @@ void RemoteLayerTreeHost::commit(const RemoteLayerTreeTransaction& transaction)
         m_layers.remove(destroyedLayer);
 }
 
-CALayer *RemoteLayerTreeHost::getLayer(RemoteLayerTreeTransaction::LayerID layerID)
+CALayer *RemoteLayerTreeHost::getLayer(GraphicsLayer::PlatformLayerID layerID) const
 {
     return m_layers.get(layerID).get();
 }
index 0d81f17..2896873 100644 (file)
@@ -38,6 +38,11 @@ GraphicsLayerCARemote::~GraphicsLayerCARemote()
 {
 }
 
+GraphicsLayer::PlatformLayerID GraphicsLayerCARemote::primaryLayerID() const
+{
+    return toPlatformCALayerRemote(platformCALayer())->layerID();
+}
+
 #if ENABLE(CSS_FILTERS)
 bool GraphicsLayerCARemote::filtersCanBeComposited(const FilterOperations& filters)
 {
index fecc01f..aa6c46d 100644 (file)
@@ -44,6 +44,8 @@ public:
     }
 
     virtual ~GraphicsLayerCARemote();
+    
+    PlatformLayerID primaryLayerID() const;
 
 #if ENABLE(CSS_FILTERS)
     virtual bool filtersCanBeComposited(const WebCore::FilterOperations& filters) OVERRIDE;
index a7b3f41..73c91e9 100644 (file)
 using namespace WebCore;
 using namespace WebKit;
 
-static RemoteLayerTreeTransaction::LayerID generateLayerID()
+static WebCore::GraphicsLayer::PlatformLayerID generateLayerID()
 {
-    static RemoteLayerTreeTransaction::LayerID layerID;
+    static WebCore::GraphicsLayer::PlatformLayerID layerID;
     return ++layerID;
 }
 
-static PlatformCALayerRemote* toPlatformCALayerRemote(PlatformCALayer* layer)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!layer || layer->isRemote());
-    return static_cast<PlatformCALayerRemote*>(layer);
-}
-
 PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemote::create(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext* context)
 {
     RefPtr<PlatformCALayerRemote> layer;
index af393be..3544b50 100644 (file)
@@ -44,9 +44,7 @@ public:
 
     virtual ~PlatformCALayerRemote();
 
-    RemoteLayerTreeTransaction::LayerID layerID() { return m_layerID; }
-
-    virtual bool isRemote() const OVERRIDE { return true; }
+    WebCore::GraphicsLayer::PlatformLayerID layerID() { return m_layerID; }
 
     virtual bool usesTiledBackingLayer() const OVERRIDE { return layerType() == LayerTypePageTiledBackingLayer || layerType() == LayerTypeTiledBackingLayer; }
 
@@ -157,12 +155,13 @@ protected:
     PlatformCALayerRemote(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext* context);
 
 private:
+    virtual bool isPlatformCALayerRemote() const OVERRIDE { return false; }
     void ensureBackingStore();
     void removeSublayer(PlatformCALayerRemote*);
 
     bool requiresCustomAppearanceUpdateOnBoundsChange() const;
 
-    RemoteLayerTreeTransaction::LayerID m_layerID;
+    const WebCore::GraphicsLayer::PlatformLayerID m_layerID;
     RemoteLayerTreeTransaction::LayerProperties m_properties;
     WebCore::PlatformCALayerList m_children;
     PlatformCALayerRemote* m_superlayer;
@@ -172,6 +171,8 @@ private:
     RemoteLayerTreeContext* m_context;
 };
 
+PLATFORM_CALAYER_TYPE_CASTS(PlatformCALayerRemote, isPlatformCALayerRemote())
+
 } // namespace WebKit
 
 #endif // USE(ACCELERATED_COMPOSITING)
index 3e5e2cc..c91ccb5 100644 (file)
@@ -74,7 +74,7 @@ private:
     Vector<WebCore::GraphicsLayer*> m_outOfTreeLayers;
 
     Vector<RemoteLayerTreeTransaction::LayerCreationProperties> m_createdLayers;
-    Vector<RemoteLayerTreeTransaction::LayerID> m_destroyedLayers;
+    Vector<WebCore::GraphicsLayer::PlatformLayerID> m_destroyedLayers;
 
     bool m_isFlushingSuspended;
     bool m_hasDeferredFlush;