Use is<>() / downcast<>() for GraphicsLayer subclasses
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Oct 2014 17:51:01 +0000 (17:51 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Oct 2014 17:51:01 +0000 (17:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137595

Reviewed by Darin Adler.

Use is<>() / downcast<>() for GraphicsLayer subclasses and clean up the
surrounding code.

Source/WebCore:

No new tests, no behavior change.

* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::Highlight):
(WebCore::ServicesOverlayController::Highlight::fadeIn):
(WebCore::ServicesOverlayController::Highlight::fadeOut):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::removeFromParent):
(WebCore::GraphicsLayerCA::setMaskLayer):
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::updateSublayerList):
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::updateMaskLayer):
(WebCore::GraphicsLayerCA::replicatedLayerRoot):
(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
(WebCore::GraphicsLayerCA::propagateLayerChangeToReplicas):
(WebCore::GraphicsLayerCA::fetchCloneLayers):
* platform/graphics/ca/GraphicsLayerCA.h:

Source/WebKit2:

* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::layerForTransientZoom):
(WebKit::TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom):

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

Source/WebCore/ChangeLog
Source/WebCore/page/mac/ServicesOverlayController.mm
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index f88e480..3ed8167 100644 (file)
@@ -1,5 +1,36 @@
 2014-10-10  Chris Dumez  <cdumez@apple.com>
 
+        Use is<>() / downcast<>() for GraphicsLayer subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=137595
+
+        Reviewed by Darin Adler.
+
+        Use is<>() / downcast<>() for GraphicsLayer subclasses and clean up the
+        surrounding code.
+
+        No new tests, no behavior change.
+
+        * page/mac/ServicesOverlayController.mm:
+        (WebCore::ServicesOverlayController::Highlight::Highlight):
+        (WebCore::ServicesOverlayController::Highlight::fadeIn):
+        (WebCore::ServicesOverlayController::Highlight::fadeOut):
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::removeFromParent):
+        (WebCore::GraphicsLayerCA::setMaskLayer):
+        (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush):
+        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
+        (WebCore::GraphicsLayerCA::updateSublayerList):
+        (WebCore::GraphicsLayerCA::ensureStructuralLayer):
+        (WebCore::GraphicsLayerCA::updateMaskLayer):
+        (WebCore::GraphicsLayerCA::replicatedLayerRoot):
+        (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
+        (WebCore::GraphicsLayerCA::propagateLayerChangeToReplicas):
+        (WebCore::GraphicsLayerCA::fetchCloneLayers):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+
+2014-10-10  Chris Dumez  <cdumez@apple.com>
+
         Use is<>() / downcast<>() for RenderBoxModelObject
         https://bugs.webkit.org/show_bug.cgi?id=137587
 
index c8aa0c6..0fc33a4 100644 (file)
@@ -100,7 +100,7 @@ ServicesOverlayController::Highlight::Highlight(ServicesOverlayController& contr
 
     // Set directly on the PlatformCALayer so that when we leave the 'from' value implicit
     // in our animations, we get the right initial value regardless of flush timing.
-    toGraphicsLayerCA(layer())->platformCALayer()->setOpacity(0);
+    downcast<GraphicsLayerCA>(*layer()).platformCALayer()->setOpacity(0);
 
     controller.didCreateHighlight(this);
 }
@@ -178,7 +178,7 @@ void ServicesOverlayController::Highlight::fadeIn()
     [animation setToValue:@1];
 
     RefPtr<PlatformCAAnimation> platformAnimation = PlatformCAAnimationMac::create(animation.get());
-    toGraphicsLayerCA(layer())->platformCALayer()->addAnimationForKey("FadeHighlightIn", platformAnimation.get());
+    downcast<GraphicsLayerCA>(*layer()).platformCALayer()->addAnimationForKey("FadeHighlightIn", platformAnimation.get());
 }
 
 void ServicesOverlayController::Highlight::fadeOut()
@@ -196,7 +196,7 @@ void ServicesOverlayController::Highlight::fadeOut()
     }];
 
     RefPtr<PlatformCAAnimation> platformAnimation = PlatformCAAnimationMac::create(animation.get());
-    toGraphicsLayerCA(layer())->platformCALayer()->addAnimationForKey("FadeHighlightOut", platformAnimation.get());
+    downcast<GraphicsLayerCA>(*layer()).platformCALayer()->addAnimationForKey("FadeHighlightOut", platformAnimation.get());
     [CATransaction commit];
 }
 
index d88db27..1e74cae 100644 (file)
@@ -39,6 +39,7 @@
 #include "TransformOperations.h"
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
+#include <wtf/TypeCasts.h>
 
 #if ENABLE(CSS_COMPOSITING)
 #include "GraphicsTypes.h"
@@ -604,11 +605,13 @@ protected:
     CustomBehavior m_customBehavior;
 };
 
-#define GRAPHICSLAYER_TYPE_CASTS(ToValueTypeName, predicate) \
-    TYPE_CASTS_BASE(ToValueTypeName, WebCore::GraphicsLayer, value, value->predicate, value.predicate)
-
 } // namespace WebCore
 
+#define SPECIALIZE_TYPE_TRAITS_GRAPHICSLAYER(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(ToValueTypeName) \
+    static bool isType(const WebCore::GraphicsLayer& layer) { return layer.predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()
+
 #ifndef NDEBUG
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer);
index e439f50..5465973 100644 (file)
@@ -449,7 +449,7 @@ bool GraphicsLayerCA::replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newCh
 void GraphicsLayerCA::removeFromParent()
 {
     if (m_parent)
-        toGraphicsLayerCA(m_parent)->noteSublayersChanged();
+        downcast<GraphicsLayerCA>(*m_parent).noteSublayersChanged();
     GraphicsLayer::removeFromParent();
 }
 
@@ -464,7 +464,7 @@ void GraphicsLayerCA::setMaskLayer(GraphicsLayer* layer)
     propagateLayerChangeToReplicas();
     
     if (m_replicatedLayer)
-        toGraphicsLayerCA(m_replicatedLayer)->propagateLayerChangeToReplicas();
+        downcast<GraphicsLayerCA>(*m_replicatedLayer).propagateLayerChangeToReplicas();
 }
 
 void GraphicsLayerCA::setReplicatedLayer(GraphicsLayer* layer)
@@ -1015,8 +1015,8 @@ bool GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush(const TransformSta
     }
 
     if (m_maskLayer) {
-        GraphicsLayerCA* maskLayerCA = toGraphicsLayerCA(m_maskLayer);
-        if (maskLayerCA->recursiveVisibleRectChangeRequiresFlush(localState))
+        GraphicsLayerCA& maskLayerCA = downcast<GraphicsLayerCA>(*m_maskLayer);
+        if (maskLayerCA.recursiveVisibleRectChangeRequiresFlush(localState))
             return true;
     }
 
@@ -1024,13 +1024,13 @@ bool GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush(const TransformSta
     size_t numChildren = childLayers.size();
     
     for (size_t i = 0; i < numChildren; ++i) {
-        GraphicsLayerCA* curChild = toGraphicsLayerCA(childLayers[i]);
-        if (curChild->recursiveVisibleRectChangeRequiresFlush(localState))
+        GraphicsLayerCA& currentChild = downcast<GraphicsLayerCA>(*childLayers[i]);
+        if (currentChild.recursiveVisibleRectChangeRequiresFlush(localState))
             return true;
     }
 
     if (m_replicaLayer)
-        if (toGraphicsLayerCA(m_replicaLayer)->recursiveVisibleRectChangeRequiresFlush(localState))
+        if (downcast<GraphicsLayerCA>(*m_replicaLayer).recursiveVisibleRectChangeRequiresFlush(localState))
             return true;
     
     return false;
@@ -1131,7 +1131,7 @@ void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, con
         m_uncommittedChanges |= VisibleRectChanged;
         m_visibleRect = visibleRect;
         
-        if (GraphicsLayerCA* maskLayer = toGraphicsLayerCA(m_maskLayer)) {
+        if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer)) {
             // FIXME: this assumes that the mask layer has the same geometry as this layer (which is currently always true).
             maskLayer->m_uncommittedChanges |= VisibleRectChanged;
             maskLayer->m_visibleRect = visibleRect;
@@ -1180,21 +1180,21 @@ void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, con
         affectedByTransformAnimation = true;
     }
 
-    if (GraphicsLayerCA* maskLayer = toGraphicsLayerCA(m_maskLayer))
+    if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer))
         maskLayer->commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition, oldVisibleRect);
 
     const Vector<GraphicsLayer*>& childLayers = children();
     size_t numChildren = childLayers.size();
     
     for (size_t i = 0; i < numChildren; ++i) {
-        GraphicsLayerCA* curChild = toGraphicsLayerCA(childLayers[i]);
-        curChild->recursiveCommitChanges(childCommitState, localState, pageScaleFactor, baseRelativePosition, affectedByPageScale);
+        GraphicsLayerCA& currentChild = downcast<GraphicsLayerCA>(*childLayers[i]);
+        currentChild.recursiveCommitChanges(childCommitState, localState, pageScaleFactor, baseRelativePosition, affectedByPageScale);
     }
 
-    if (GraphicsLayerCA* replicaLayer = toGraphicsLayerCA(m_replicaLayer))
+    if (GraphicsLayerCA* replicaLayer = downcast<GraphicsLayerCA>(m_replicaLayer))
         replicaLayer->recursiveCommitChanges(childCommitState, localState, pageScaleFactor, baseRelativePosition, affectedByPageScale);
 
-    if (GraphicsLayerCA* maskLayer = toGraphicsLayerCA(m_maskLayer))
+    if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer))
         maskLayer->commitLayerChangesAfterSublayers(childCommitState);
 
     commitLayerChangesAfterSublayers(childCommitState);
@@ -1425,7 +1425,7 @@ void GraphicsLayerCA::updateSublayerList(bool maxLayerDepthReached)
 
     if (m_structuralLayer) {
         if (m_replicaLayer)
-            structuralLayerChildren.append(toGraphicsLayerCA(m_replicaLayer)->primaryLayer());
+            structuralLayerChildren.append(downcast<GraphicsLayerCA>(*m_replicaLayer).primaryLayer());
     
         structuralLayerChildren.append(m_layer);
     }
@@ -1440,8 +1440,8 @@ void GraphicsLayerCA::updateSublayerList(bool maxLayerDepthReached)
     const Vector<GraphicsLayer*>& childLayers = children();
     size_t numChildren = childLayers.size();
     for (size_t i = 0; i < numChildren; ++i) {
-        GraphicsLayerCA* curChild = toGraphicsLayerCA(childLayers[i]);
-        PlatformCALayer* childLayer = curChild->layerForSuperlayer();
+        GraphicsLayerCA& currentChild = downcast<GraphicsLayerCA>(*childLayers[i]);
+        PlatformCALayer* childLayer = currentChild.layerForSuperlayer();
         childListForSublayers.append(childLayer);
     }
 
@@ -1696,7 +1696,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)
     
     if (purpose == StructuralLayerForPreserves3D) {
         if (m_structuralLayer && m_structuralLayer->layerType() != PlatformCALayer::LayerTypeTransformLayer)
-            m_structuralLayer = 0;
+            m_structuralLayer = nullptr;
         
         if (!m_structuralLayer) {
             m_structuralLayer = createPlatformCALayer(PlatformCALayer::LayerTypeTransformLayer, this);
@@ -1704,7 +1704,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)
         }
     } else {
         if (m_structuralLayer && m_structuralLayer->layerType() != PlatformCALayer::LayerTypeLayer)
-            m_structuralLayer = 0;
+            m_structuralLayer = nullptr;
 
         if (!m_structuralLayer) {
             m_structuralLayer = createPlatformCALayer(PlatformCALayer::LayerTypeLayer, this);
@@ -1719,7 +1719,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)
 
     // We've changed the layer that our parent added to its sublayer list, so tell it to update
     // sublayers again in its commitLayerChangesAfterSublayers().
-    toGraphicsLayerCA(parent())->noteSublayersChanged(DontScheduleFlush);
+    downcast<GraphicsLayerCA>(*parent()).noteSublayersChanged(DontScheduleFlush);
 
     // Set properties of m_layer to their default values, since these are expressed on on the structural layer.
     FloatPoint point(m_size.width() / 2.0f, m_size.height() / 2.0f);
@@ -2006,15 +2006,15 @@ void GraphicsLayerCA::updateContentsRects()
 
 void GraphicsLayerCA::updateMaskLayer()
 {
-    PlatformCALayer* maskCALayer = m_maskLayer ? toGraphicsLayerCA(m_maskLayer)->primaryLayer() : 0;
+    PlatformCALayer* maskCALayer = m_maskLayer ? downcast<GraphicsLayerCA>(*m_maskLayer).primaryLayer() : nullptr;
     m_layer->setMask(maskCALayer);
 
-    LayerMap* maskLayerCloneMap = m_maskLayer ? toGraphicsLayerCA(m_maskLayer)->primaryLayerClones() : 0;
+    LayerMap* maskLayerCloneMap = m_maskLayer ? downcast<GraphicsLayerCA>(*m_maskLayer).primaryLayerClones() : nullptr;
     
     if (LayerMap* layerCloneMap = m_layerClones.get()) {
         LayerMap::const_iterator end = layerCloneMap->end();
         for (LayerMap::const_iterator it = layerCloneMap->begin(); it != end; ++it) {            
-            PlatformCALayer* maskClone = maskLayerCloneMap ? maskLayerCloneMap->get(it->key) : 0;
+            PlatformCALayer* maskClone = maskLayerCloneMap ? maskLayerCloneMap->get(it->key) : nullptr;
             it->value->setMask(maskClone);
         }
     }
@@ -2060,12 +2060,12 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::replicatedLayerRoot(ReplicaState& r
 {
     // Limit replica nesting, to avoid 2^N explosion of replica layers.
     if (!m_replicatedLayer || replicaState.replicaDepth() == ReplicaState::maxReplicaDepth)
-        return 0;
+        return nullptr;
 
-    GraphicsLayerCA* replicatedLayer = toGraphicsLayerCA(m_replicatedLayer);
+    GraphicsLayerCA& replicatedLayer = downcast<GraphicsLayerCA>(*m_replicatedLayer);
     
-    RefPtr<PlatformCALayer> clonedLayerRoot = replicatedLayer->fetchCloneLayers(this, replicaState, RootCloneLevel);
-    FloatPoint cloneRootPosition = replicatedLayer->positionForCloneRootLayer();
+    RefPtr<PlatformCALayer> clonedLayerRoot = replicatedLayer.fetchCloneLayers(this, replicaState, RootCloneLevel);
+    FloatPoint cloneRootPosition = replicatedLayer.positionForCloneRootLayer();
 
     // Replica root has no offset or transform
     clonedLayerRoot->setPosition(cloneRootPosition);
@@ -2980,7 +2980,7 @@ void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer)
         // A mask layer's superlayer is the layer that it masks. Set the MaskLayerChanged dirty bit
         // so that the parent will fix up the platform layers in commitLayerChangesAfterSublayers().
         if (GraphicsLayer* parentLayer = parent())
-            toGraphicsLayerCA(parentLayer)->noteLayerPropertyChanged(MaskLayerChanged);
+            downcast<GraphicsLayerCA>(*parentLayer).noteLayerPropertyChanged(MaskLayerChanged);
     } else if (oldLayer->superlayer()) {
         // Skip this step if we don't have a superlayer. This is probably a benign
         // case that happens while restructuring the layer tree, and also occurs with
@@ -3119,13 +3119,13 @@ FloatPoint GraphicsLayerCA::positionForCloneRootLayer() const
 
 void GraphicsLayerCA::propagateLayerChangeToReplicas()
 {
-    for (GraphicsLayer* currLayer = this; currLayer; currLayer = currLayer->parent()) {
-        GraphicsLayerCA* currLayerCA = toGraphicsLayerCA(currLayer);
-        if (!currLayerCA->hasCloneLayers())
+    for (GraphicsLayer* currentLayer = this; currentLayer; currentLayer = currentLayer->parent()) {
+        GraphicsLayerCA& currentLayerCA = downcast<GraphicsLayerCA>(*currentLayer);
+        if (!currentLayerCA.hasCloneLayers())
             break;
 
-        if (currLayerCA->replicaLayer())
-            toGraphicsLayerCA(currLayerCA->replicaLayer())->noteLayerPropertyChanged(ReplicatedLayerChanged);
+        if (currentLayerCA.replicaLayer())
+            downcast<GraphicsLayerCA>(*currentLayerCA.replicaLayer()).noteLayerPropertyChanged(ReplicatedLayerChanged);
     }
 }
 
@@ -3138,7 +3138,7 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::fetchCloneLayers(GraphicsLayer* rep
     ensureCloneLayers(replicaState.cloneID(), primaryLayer, structuralLayer, contentsLayer, contentsClippingLayer, cloneLevel);
 
     if (m_maskLayer) {
-        RefPtr<PlatformCALayer> maskClone = toGraphicsLayerCA(m_maskLayer)->fetchCloneLayers(replicaRoot, replicaState, IntermediateCloneLevel);
+        RefPtr<PlatformCALayer> maskClone = downcast<GraphicsLayerCA>(*m_maskLayer).fetchCloneLayers(replicaRoot, replicaState, IntermediateCloneLevel);
         primaryLayer->setMask(maskClone.get());
     }
 
@@ -3146,7 +3146,7 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::fetchCloneLayers(GraphicsLayer* rep
         // We are a replica being asked for clones of our layers.
         RefPtr<PlatformCALayer> replicaRoot = replicatedLayerRoot(replicaState);
         if (!replicaRoot)
-            return 0;
+            return nullptr;
 
         if (structuralLayer) {
             structuralLayer->insertSublayer(replicaRoot.get(), 0);
@@ -3165,7 +3165,7 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::fetchCloneLayers(GraphicsLayer* rep
     if (m_replicaLayer && m_replicaLayer != replicaRoot) {
         // We have nested replicas. Ask the replica layer for a clone of its contents.
         replicaState.setBranchType(ReplicaState::ReplicaBranch);
-        replicaLayer = toGraphicsLayerCA(m_replicaLayer)->fetchCloneLayers(replicaRoot, replicaState, RootCloneLevel);
+        replicaLayer = downcast<GraphicsLayerCA>(*m_replicaLayer).fetchCloneLayers(replicaRoot, replicaState, RootCloneLevel);
         replicaState.setBranchType(ReplicaState::ChildBranch);
     }
 
@@ -3196,13 +3196,10 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::fetchCloneLayers(GraphicsLayer* rep
         
         replicaState.push(ReplicaState::ChildBranch);
 
-        size_t numChildren = childLayers.size();
-        for (size_t i = 0; i < numChildren; ++i) {
-            GraphicsLayerCA* curChild = toGraphicsLayerCA(childLayers[i]);
-
-            RefPtr<PlatformCALayer> childLayer = curChild->fetchCloneLayers(replicaRoot, replicaState, IntermediateCloneLevel);
-            if (childLayer)
-                clonalSublayers.append(childLayer);
+        for (auto* childLayer : childLayers) {
+            GraphicsLayerCA& childLayerCA = downcast<GraphicsLayerCA>(*childLayer);
+            if (RefPtr<PlatformCALayer> platformLayer = childLayerCA.fetchCloneLayers(replicaRoot, replicaState, IntermediateCloneLevel))
+                clonalSublayers.append(platformLayer.release());
         }
 
         replicaState.pop();
index 660bea4..dfc7e8a 100644 (file)
@@ -516,8 +516,8 @@ private:
     bool m_isCommittingChanges;
 };
 
-GRAPHICSLAYER_TYPE_CASTS(GraphicsLayerCA, isGraphicsLayerCA());
-
 } // namespace WebCore
 
+SPECIALIZE_TYPE_TRAITS_GRAPHICSLAYER(WebCore::GraphicsLayerCA, isGraphicsLayerCA())
+
 #endif // GraphicsLayerCA_h
index 22bc7cd..c7f49e6 100644 (file)
@@ -1,3 +1,20 @@
+2014-10-10  Chris Dumez  <cdumez@apple.com>
+
+        Use is<>() / downcast<>() for GraphicsLayer subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=137595
+
+        Reviewed by Darin Adler.
+
+        Use is<>() / downcast<>() for GraphicsLayer subclasses and clean up the
+        surrounding code.
+
+        * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::layerForTransientZoom):
+        (WebKit::TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom):
+
 2014-10-10  Pascal Jacquemart  <p.jacquemart@samsung.com>
 
         Fix debug build on EFL after r174584
index 8a73f8c..32e6bd1 100644 (file)
@@ -58,8 +58,8 @@ private:
     RemoteLayerTreeContext& m_context;
 };
 
-GRAPHICSLAYER_TYPE_CASTS(GraphicsLayerCARemote, isGraphicsLayerCARemote());
-
 } // namespace WebKit
 
+SPECIALIZE_TYPE_TRAITS_GRAPHICSLAYER(WebKit::GraphicsLayerCARemote, isGraphicsLayerCARemote())
+
 #endif // GraphicsLayerCARemote_h
index 92fd603..1a1e3f2 100644 (file)
@@ -351,7 +351,7 @@ void RemoteLayerTreeDrawingArea::flushLayers()
     RemoteLayerTreeTransaction layerTransaction;
     layerTransaction.setTransactionID(takeNextTransactionID());
     layerTransaction.setCallbackIDs(WTF::move(m_pendingCallbackIDs));
-    m_remoteLayerTreeContext->buildTransaction(layerTransaction, *toGraphicsLayerCARemote(m_rootLayer.get())->platformCALayer());
+    m_remoteLayerTreeContext->buildTransaction(layerTransaction, *downcast<GraphicsLayerCARemote>(*m_rootLayer).platformCALayer());
     backingStoreCollection.willCommitLayerTree(layerTransaction);
     m_webPage.willCommitLayerTree(layerTransaction);
 
index d634d2c..1941aaa 100644 (file)
@@ -537,9 +537,9 @@ PlatformCALayer* TiledCoreAnimationDrawingArea::layerForTransientZoom() const
     RenderLayerBacking* renderViewBacking = m_webPage.mainFrameView()->renderView()->layer()->backing();
 
     if (GraphicsLayer* contentsContainmentLayer = renderViewBacking->contentsContainmentLayer())
-        return toGraphicsLayerCA(contentsContainmentLayer)->platformCALayer();
+        return downcast<GraphicsLayerCA>(*contentsContainmentLayer).platformCALayer();
 
-    return toGraphicsLayerCA(renderViewBacking->graphicsLayer())->platformCALayer();
+    return downcast<GraphicsLayerCA>(*renderViewBacking->graphicsLayer()).platformCALayer();
 }
 
 PlatformCALayer* TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom() const
@@ -547,7 +547,7 @@ PlatformCALayer* TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom() co
     RenderLayerCompositor& renderLayerCompositor = m_webPage.mainFrameView()->renderView()->compositor();
 
     if (GraphicsLayer* shadowGraphicsLayer = renderLayerCompositor.layerForContentShadow())
-        return toGraphicsLayerCA(shadowGraphicsLayer)->platformCALayer();
+        return downcast<GraphicsLayerCA>(*shadowGraphicsLayer).platformCALayer();
 
     return nullptr;
 }