Coordinated Graphics: Rename m_CoordinatedGraphicsLayerClient to m_coordinator
authornoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2012 21:56:19 +0000 (21:56 +0000)
committernoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2012 21:56:19 +0000 (21:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=102133

Renamed m_CoordinatedGraphicsLayerClient to m_coordinator.
Also, there is no need for calling setCoordinator every time the tree changes,
since we can call it once when the layer is created, now that LayerTreeCoordinator
is the GraphicsLayerFactory.

Reviewed by Kenneth Rohde Christiansen

No change in functionality.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::setChildren):
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setContentsToImage):
(WebCore::CoordinatedGraphicsLayer::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
(WebCore::CoordinatedGraphicsLayer::flushCompositingState):
(WebCore::CoordinatedGraphicsLayer::syncChildren):
(WebCore::CoordinatedGraphicsLayer::syncFilters):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::syncAnimations):
(WebCore::CoordinatedGraphicsLayer::syncCanvas):
(WebCore::CoordinatedGraphicsLayer::ensureImageBackingStore):
(WebCore::CoordinatedGraphicsLayer::tiledBackingStoreUpdatesAllowed):
(WebCore::CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect):
(WebCore::CoordinatedGraphicsLayer::beginContentUpdate):
(WebCore::CoordinatedGraphicsLayer::createTile):
(WebCore::CoordinatedGraphicsLayer::updateTile):
(WebCore::CoordinatedGraphicsLayer::removeTile):
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
(WebCore::CoordinatedGraphicsLayer::setCoordinator):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayer):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::~LayerTreeCoordinator):
(WebKit::LayerTreeCoordinator::LayerTreeCoordinator):
(WebKit::LayerTreeCoordinator::paintContents):

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h

index 1971854..9b19a7b 100644 (file)
@@ -1,3 +1,51 @@
+2012-11-14  No'am Rosenthal  <noam.rosenthal@nokia.com>
+
+        Coordinated Graphics: Rename m_CoordinatedGraphicsLayerClient to m_coordinator
+        https://bugs.webkit.org/show_bug.cgi?id=102133
+
+        Renamed m_CoordinatedGraphicsLayerClient to m_coordinator.
+        Also, there is no need for calling setCoordinator every time the tree changes,
+        since we can call it once when the layer is created, now that LayerTreeCoordinator
+        is the GraphicsLayerFactory.
+
+        Reviewed by Kenneth Rohde Christiansen
+
+        No change in functionality.
+
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
+        (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
+        (WebCore::CoordinatedGraphicsLayer::setChildren):
+        (WebCore::CoordinatedGraphicsLayer::addChild):
+        (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
+        (WebCore::CoordinatedGraphicsLayer::addChildAbove):
+        (WebCore::CoordinatedGraphicsLayer::addChildBelow):
+        (WebCore::CoordinatedGraphicsLayer::replaceChild):
+        (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
+        (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
+        (WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
+        (WebCore::CoordinatedGraphicsLayer::flushCompositingState):
+        (WebCore::CoordinatedGraphicsLayer::syncChildren):
+        (WebCore::CoordinatedGraphicsLayer::syncFilters):
+        (WebCore::CoordinatedGraphicsLayer::syncLayerState):
+        (WebCore::CoordinatedGraphicsLayer::syncAnimations):
+        (WebCore::CoordinatedGraphicsLayer::syncCanvas):
+        (WebCore::CoordinatedGraphicsLayer::ensureImageBackingStore):
+        (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreUpdatesAllowed):
+        (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect):
+        (WebCore::CoordinatedGraphicsLayer::beginContentUpdate):
+        (WebCore::CoordinatedGraphicsLayer::createTile):
+        (WebCore::CoordinatedGraphicsLayer::updateTile):
+        (WebCore::CoordinatedGraphicsLayer::removeTile):
+        (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
+        (WebCore::CoordinatedGraphicsLayer::setCoordinator):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
+        (CoordinatedGraphicsLayer):
+        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
+        (WebKit::LayerTreeCoordinator::~LayerTreeCoordinator):
+        (WebKit::LayerTreeCoordinator::LayerTreeCoordinator):
+        (WebKit::LayerTreeCoordinator::paintContents):
+
 2012-11-14  Anders Carlsson  <andersca@apple.com>
 
         More steps towards actually hosting layers in the UI process
index 6eb2fa4..5a50f68 100644 (file)
@@ -116,7 +116,7 @@ CoordinatedGraphicsLayer::CoordinatedGraphicsLayer(GraphicsLayerClient* client)
     , m_shouldSyncAnimations(true)
     , m_fixedToViewport(false)
     , m_canvasNeedsDisplay(false)
-    , m_CoordinatedGraphicsLayerClient(0)
+    , m_coordinator(0)
     , m_contentsScale(1)
     , m_compositedNativeImagePtr(0)
     , m_canvasPlatformLayer(0)
@@ -131,9 +131,9 @@ CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer()
 {
     layerByIDMap().remove(id());
 
-    if (m_CoordinatedGraphicsLayerClient) {
+    if (m_coordinator) {
         purgeBackingStores();
-        m_CoordinatedGraphicsLayerClient->detachLayer(this);
+        m_coordinator->detachLayer(this);
     }
     willBeDestroyed();
 }
@@ -145,7 +145,6 @@ bool CoordinatedGraphicsLayer::setChildren(const Vector<GraphicsLayer*>& childre
         return false;
     for (unsigned i = 0; i < children.size(); ++i) {
         CoordinatedGraphicsLayer* child = toCoordinatedGraphicsLayer(children[i]);
-        child->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
         child->didChangeLayerState();
     }
     didChangeChildren();
@@ -155,7 +154,6 @@ bool CoordinatedGraphicsLayer::setChildren(const Vector<GraphicsLayer*>& childre
 void CoordinatedGraphicsLayer::addChild(GraphicsLayer* layer)
 {
     GraphicsLayer::addChild(layer);
-    toCoordinatedGraphicsLayer(layer)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
     toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
     didChangeChildren();
 }
@@ -163,7 +161,6 @@ void CoordinatedGraphicsLayer::addChild(GraphicsLayer* layer)
 void CoordinatedGraphicsLayer::addChildAtIndex(GraphicsLayer* layer, int index)
 {
     GraphicsLayer::addChildAtIndex(layer, index);
-    toCoordinatedGraphicsLayer(layer)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
     toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
     didChangeChildren();
 }
@@ -171,7 +168,6 @@ void CoordinatedGraphicsLayer::addChildAtIndex(GraphicsLayer* layer, int index)
 void CoordinatedGraphicsLayer::addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling)
 {
     GraphicsLayer::addChildAbove(layer, sibling);
-    toCoordinatedGraphicsLayer(layer)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
     toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
     didChangeChildren();
 }
@@ -179,7 +175,6 @@ void CoordinatedGraphicsLayer::addChildAbove(GraphicsLayer* layer, GraphicsLayer
 void CoordinatedGraphicsLayer::addChildBelow(GraphicsLayer* layer, GraphicsLayer* sibling)
 {
     GraphicsLayer::addChildBelow(layer, sibling);
-    toCoordinatedGraphicsLayer(layer)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
     toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
     didChangeChildren();
 }
@@ -191,7 +186,6 @@ bool CoordinatedGraphicsLayer::replaceChild(GraphicsLayer* oldChild, GraphicsLay
         return false;
     didChangeChildren();
     toCoordinatedGraphicsLayer(oldChild)->didChangeLayerState();
-    toCoordinatedGraphicsLayer(newChild)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
     toCoordinatedGraphicsLayer(newChild)->didChangeLayerState();
     return true;
 }
@@ -386,7 +380,6 @@ void CoordinatedGraphicsLayer::setMaskLayer(GraphicsLayer* layer)
 
     layer->setSize(size());
     CoordinatedGraphicsLayer* CoordinatedGraphicsLayer = toCoordinatedGraphicsLayer(layer);
-    CoordinatedGraphicsLayer->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
     CoordinatedGraphicsLayer->setMaskTarget(this);
     CoordinatedGraphicsLayer->didChangeLayerState();
     didChangeLayerState();
@@ -410,9 +403,6 @@ void CoordinatedGraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer)
     if (layer == replicaLayer())
         return;
 
-    if (layer)
-        toCoordinatedGraphicsLayer(layer)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
-
     GraphicsLayer::setReplicatedByLayer(layer);
     didChangeLayerState();
 }
@@ -442,7 +432,7 @@ void CoordinatedGraphicsLayer::flushCompositingState(const FloatRect& rect)
     if (CoordinatedGraphicsLayer* replica = toCoordinatedGraphicsLayer(replicaLayer()))
         replica->flushCompositingStateForThisLayerOnly();
 
-    m_CoordinatedGraphicsLayerClient->syncFixedLayers();
+    m_coordinator->syncFixedLayers();
 
     flushCompositingStateForThisLayerOnly();
 
@@ -464,7 +454,7 @@ void CoordinatedGraphicsLayer::syncChildren()
     for (size_t i = 0; i < children().size(); ++i)
         childIDs.append(toWebLayerID(children()[i]));
 
-    m_CoordinatedGraphicsLayerClient->syncLayerChildren(m_id, childIDs);
+    m_coordinator->syncLayerChildren(m_id, childIDs);
 }
 
 #if ENABLE(CSS_FILTERS)
@@ -473,7 +463,7 @@ void CoordinatedGraphicsLayer::syncFilters()
     if (!m_shouldSyncFilters)
         return;
     m_shouldSyncFilters = false;
-    m_CoordinatedGraphicsLayerClient->syncLayerFilters(m_id, filters());
+    m_coordinator->syncLayerFilters(m_id, filters());
 }
 #endif
 
@@ -489,7 +479,7 @@ void CoordinatedGraphicsLayer::syncImageBacking()
         ASSERT(!m_mainBackingStore);
         ASSERT(m_compositedImage);
 
-        m_layerInfo.imageBackingStoreID = m_CoordinatedGraphicsLayerClient->adoptImageBackingStore(m_compositedImage.get());
+        m_layerInfo.imageBackingStoreID = m_coordinator->adoptImageBackingStore(m_compositedImage.get());
     }
 
     // This method changes m_layerInfo.imageBackingStoreID.
@@ -518,7 +508,7 @@ void CoordinatedGraphicsLayer::syncLayerState()
     m_layerInfo.replica = toWebLayerID(replicaLayer());
     m_layerInfo.size = size();
     m_layerInfo.transform = transform();
-    m_CoordinatedGraphicsLayerClient->syncLayerState(m_id, m_layerInfo);
+    m_coordinator->syncLayerState(m_id, m_layerInfo);
 }
 
 void CoordinatedGraphicsLayer::syncAnimations()
@@ -528,7 +518,7 @@ void CoordinatedGraphicsLayer::syncAnimations()
 
     m_shouldSyncAnimations = false;
 
-    m_CoordinatedGraphicsLayerClient->setLayerAnimations(m_id, m_animations);
+    m_coordinator->setLayerAnimations(m_id, m_animations);
 }
 
 void CoordinatedGraphicsLayer::syncCanvas()
@@ -543,7 +533,7 @@ void CoordinatedGraphicsLayer::syncCanvas()
     uint32_t frontBuffer = m_canvasPlatformLayer->copyToGraphicsSurface();
     GraphicsSurfaceToken token = m_canvasPlatformLayer->graphicsSurfaceToken();
 
-    m_CoordinatedGraphicsLayerClient->syncCanvas(m_id, IntSize(size().width(), size().height()), token, frontBuffer);
+    m_coordinator->syncCanvas(m_id, IntSize(size().width(), size().height()), token, frontBuffer);
 #endif
     m_canvasNeedsDisplay = false;
 }
@@ -567,8 +557,8 @@ void CoordinatedGraphicsLayer::releaseImageBackingIfNeeded()
     if (!m_layerInfo.imageBackingStoreID)
         return;
 
-    ASSERT(m_CoordinatedGraphicsLayerClient);
-    m_CoordinatedGraphicsLayerClient->releaseImageBackingStore(m_layerInfo.imageBackingStoreID);
+    ASSERT(m_coordinator);
+    m_coordinator->releaseImageBackingStore(m_layerInfo.imageBackingStoreID);
     m_layerInfo.imageBackingStoreID = 0;
 }
 
@@ -641,7 +631,7 @@ bool CoordinatedGraphicsLayer::tiledBackingStoreUpdatesAllowed() const
 {
     if (!m_inUpdateMode)
         return false;
-    return m_CoordinatedGraphicsLayerClient->layerTreeTileUpdatesAllowed();
+    return m_coordinator->layerTreeTileUpdatesAllowed();
 }
 
 IntRect CoordinatedGraphicsLayer::tiledBackingStoreContentsRect()
@@ -666,7 +656,7 @@ IntRect CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect()
     // Return a projection of the visible rect (surface coordinates) onto the layer's plane (layer coordinates).
     // The resulting quad might be squewed and the visible rect is the bounding box of this quad,
     // so it might spread further than the real visible area (and then even more amplified by the cover rect multiplier).
-    return enclosingIntRect(m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(FloatRect(m_CoordinatedGraphicsLayerClient->visibleContentsRect()))));
+    return enclosingIntRect(m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(FloatRect(m_coordinator->visibleContentsRect()))));
 }
 
 Color CoordinatedGraphicsLayer::tiledBackingStoreBackgroundColor() const
@@ -676,22 +666,28 @@ Color CoordinatedGraphicsLayer::tiledBackingStoreBackgroundColor() const
 
 PassOwnPtr<WebCore::GraphicsContext> CoordinatedGraphicsLayer::beginContentUpdate(const WebCore::IntSize& size, int& atlas, WebCore::IntPoint& offset)
 {
-    return m_CoordinatedGraphicsLayerClient->beginContentUpdate(size, contentsOpaque() ? 0 : ShareableBitmap::SupportsAlpha, atlas, offset);
+    if (!m_coordinator)
+        return PassOwnPtr<WebCore::GraphicsContext>();
+
+    return m_coordinator->beginContentUpdate(size, contentsOpaque() ? 0 : ShareableBitmap::SupportsAlpha, atlas, offset);
 }
 
 void CoordinatedGraphicsLayer::createTile(int tileID, const SurfaceUpdateInfo& updateInfo, const WebCore::IntRect& tileRect)
 {
-    m_CoordinatedGraphicsLayerClient->createTile(id(), tileID, updateInfo, tileRect);
+    if (m_coordinator)
+        m_coordinator->createTile(id(), tileID, updateInfo, tileRect);
 }
 
 void CoordinatedGraphicsLayer::updateTile(int tileID, const SurfaceUpdateInfo& updateInfo, const IntRect& tileRect)
 {
-    m_CoordinatedGraphicsLayerClient->updateTile(id(), tileID, updateInfo, tileRect);
+    if (m_coordinator)
+        m_coordinator->updateTile(id(), tileID, updateInfo, tileRect);
 }
 
 void CoordinatedGraphicsLayer::removeTile(int tileID)
 {
-    m_CoordinatedGraphicsLayerClient->removeTile(id(), tileID);
+    if (m_coordinator)
+        m_coordinator->removeTile(id(), tileID);
 }
 
 void CoordinatedGraphicsLayer::updateContentBuffers()
@@ -728,28 +724,9 @@ void CoordinatedGraphicsLayer::purgeBackingStores()
     didChangeChildren();
 }
 
-void CoordinatedGraphicsLayer::setCoordinatedGraphicsLayerClient(WebKit::CoordinatedGraphicsLayerClient* client)
+void CoordinatedGraphicsLayer::setCoordinator(WebKit::CoordinatedGraphicsLayerClient* coordinator)
 {
-    if (m_CoordinatedGraphicsLayerClient == client)
-        return;
-
-    if (CoordinatedGraphicsLayer* replica = toCoordinatedGraphicsLayer(replicaLayer()))
-        replica->setCoordinatedGraphicsLayerClient(client);
-    if (CoordinatedGraphicsLayer* mask = toCoordinatedGraphicsLayer(maskLayer()))
-        mask->setCoordinatedGraphicsLayerClient(client);
-    for (size_t i = 0; i < children().size(); ++i) {
-        CoordinatedGraphicsLayer* layer = toCoordinatedGraphicsLayer(this->children()[i]);
-        layer->setCoordinatedGraphicsLayerClient(client);
-    }
-
-    // We have to release resources on the UI process here if the remote client has changed or is removed.
-    if (m_CoordinatedGraphicsLayerClient) {
-        purgeBackingStores();
-        m_CoordinatedGraphicsLayerClient->detachLayer(this);
-    }
-    m_CoordinatedGraphicsLayerClient = client;
-    if (client)
-        client->attachLayer(this);
+    m_coordinator = coordinator;
 }
 
 void CoordinatedGraphicsLayer::adjustVisibleRect()
index a46f277..51c33fc 100644 (file)
@@ -69,7 +69,6 @@ public:
 
     virtual void setLayerAnimations(WebLayerID, const WebCore::GraphicsLayerAnimations&) = 0;
 
-    virtual void attachLayer(WebCore::CoordinatedGraphicsLayer*) = 0;
     virtual void detachLayer(WebCore::CoordinatedGraphicsLayer*) = 0;
     virtual void syncFixedLayers() = 0;
     virtual PassOwnPtr<WebCore::GraphicsContext> beginContentUpdate(const WebCore::IntSize&, ShareableBitmap::Flags, int& atlasID, WebCore::IntPoint&) = 0;
@@ -151,7 +150,7 @@ public:
     virtual void removeTile(int tileID) OVERRIDE;
     virtual PassOwnPtr<GraphicsContext> beginContentUpdate(const IntSize&, int& atlasID, IntPoint&) OVERRIDE;
 
-    void setCoordinatedGraphicsLayerClient(WebKit::CoordinatedGraphicsLayerClient*);
+    void setCoordinator(WebKit::CoordinatedGraphicsLayerClient*);
 
     void adjustVisibleRect();
     void purgeBackingStores();
@@ -213,7 +212,7 @@ private:
     float m_effectiveOpacity;
     TransformationMatrix m_effectiveTransform;
 
-    WebKit::CoordinatedGraphicsLayerClient* m_CoordinatedGraphicsLayerClient;
+    WebKit::CoordinatedGraphicsLayerClient* m_coordinator;
     OwnPtr<TiledBackingStore> m_mainBackingStore;
     OwnPtr<TiledBackingStore> m_previousBackingStore;
     float m_contentsScale;
index 2fc4c7a..bb9eb3b 100644 (file)
@@ -66,7 +66,7 @@ LayerTreeCoordinator::~LayerTreeCoordinator()
 
     HashSet<WebCore::CoordinatedGraphicsLayer*>::iterator end = registeredLayers.end();
     for (HashSet<WebCore::CoordinatedGraphicsLayer*>::iterator it = registeredLayers.begin(); it != end; ++it)
-        (*it)->setCoordinatedGraphicsLayerClient(0);
+        (*it)->setCoordinator(0);
 }
 
 LayerTreeCoordinator::LayerTreeCoordinator(WebPage* webPage)
@@ -98,7 +98,6 @@ LayerTreeCoordinator::LayerTreeCoordinator(WebPage* webPage)
     m_layerTreeContext.webLayerID = toCoordinatedGraphicsLayer(webRootLayer)->id();
 
     m_nonCompositedContentLayer = GraphicsLayer::create(this, this);
-    toCoordinatedGraphicsLayer(m_rootLayer.get())->setCoordinatedGraphicsLayerClient(this);
 #ifndef NDEBUG
     m_nonCompositedContentLayer->setName("LayerTreeCoordinator non-composited content");
 #endif
@@ -328,15 +327,6 @@ void LayerTreeCoordinator::syncLayerFilters(WebLayerID id, const FilterOperation
 }
 #endif
 
-void LayerTreeCoordinator::attachLayer(CoordinatedGraphicsLayer* layer)
-{
-    ASSERT(!m_registeredLayers.contains(layer));
-    m_registeredLayers.add(layer);
-
-    layer->setContentsScale(m_contentsScale);
-    layer->adjustVisibleRect();
-}
-
 void LayerTreeCoordinator::detachLayer(CoordinatedGraphicsLayer* layer)
 {
     m_registeredLayers.remove(layer);
@@ -584,9 +574,12 @@ void LayerTreeCoordinator::paintContents(const WebCore::GraphicsLayer* graphicsL
 
 PassOwnPtr<GraphicsLayer> LayerTreeCoordinator::createGraphicsLayer(GraphicsLayerClient* client)
 {
-    CoordinatedGraphicsLayer* newLayer = new CoordinatedGraphicsLayer(client);
-    newLayer->setCoordinatedGraphicsLayerClient(this);
-    return adoptPtr(newLayer);
+    CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(client);
+    layer->setCoordinator(this);
+    m_registeredLayers.add(layer);
+    layer->setContentsScale(m_contentsScale);
+    layer->adjustVisibleRect();
+    return adoptPtr(layer);
 }
 
 bool LayerTreeHost::supportsAcceleratedCompositing()
index 4017e1f..1a9e179 100644 (file)
@@ -90,7 +90,6 @@ public:
 #if USE(GRAPHICS_SURFACE)
     virtual void syncCanvas(WebLayerID, const WebCore::IntSize& canvasSize, const WebCore::GraphicsSurfaceToken&, uint32_t frontBuffer) OVERRIDE;
 #endif
-    virtual void attachLayer(WebCore::CoordinatedGraphicsLayer*);
     virtual void detachLayer(WebCore::CoordinatedGraphicsLayer*);
     virtual void syncFixedLayers();