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):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index dfb9615..fb382a5 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,51 @@
+2012-11-13 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-13 Brady Eidson <beidson@apple.com>
REGRESSION(r134328) - ASSERT(isMainThread()) when subresources redirect in the NetworkProcessPass through
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp
index 6eb2fa4..c4a20a3 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp
@@ -116,7 +116,7 @@
, 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 @@
{
layerByIDMap().remove(id());
- if (m_CoordinatedGraphicsLayerClient) {
+ if (m_coordinator) {
purgeBackingStores();
- m_CoordinatedGraphicsLayerClient->detachLayer(this);
+ m_coordinator->detachLayer(this);
}
willBeDestroyed();
}
@@ -145,7 +145,6 @@
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 @@
void CoordinatedGraphicsLayer::addChild(GraphicsLayer* layer)
{
GraphicsLayer::addChild(layer);
- toCoordinatedGraphicsLayer(layer)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
didChangeChildren();
}
@@ -163,7 +161,6 @@
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::addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling)
{
GraphicsLayer::addChildAbove(layer, sibling);
- toCoordinatedGraphicsLayer(layer)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
didChangeChildren();
}
@@ -179,7 +175,6 @@
void CoordinatedGraphicsLayer::addChildBelow(GraphicsLayer* layer, GraphicsLayer* sibling)
{
GraphicsLayer::addChildBelow(layer, sibling);
- toCoordinatedGraphicsLayer(layer)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
didChangeChildren();
}
@@ -191,7 +186,6 @@
return false;
didChangeChildren();
toCoordinatedGraphicsLayer(oldChild)->didChangeLayerState();
- toCoordinatedGraphicsLayer(newChild)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
toCoordinatedGraphicsLayer(newChild)->didChangeLayerState();
return true;
}
@@ -386,7 +380,6 @@
layer->setSize(size());
CoordinatedGraphicsLayer* CoordinatedGraphicsLayer = toCoordinatedGraphicsLayer(layer);
- CoordinatedGraphicsLayer->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
CoordinatedGraphicsLayer->setMaskTarget(this);
CoordinatedGraphicsLayer->didChangeLayerState();
didChangeLayerState();
@@ -410,9 +403,6 @@
if (layer == replicaLayer())
return;
- if (layer)
- toCoordinatedGraphicsLayer(layer)->setCoordinatedGraphicsLayerClient(m_CoordinatedGraphicsLayerClient);
-
GraphicsLayer::setReplicatedByLayer(layer);
didChangeLayerState();
}
@@ -442,7 +432,7 @@
if (CoordinatedGraphicsLayer* replica = toCoordinatedGraphicsLayer(replicaLayer()))
replica->flushCompositingStateForThisLayerOnly();
- m_CoordinatedGraphicsLayerClient->syncFixedLayers();
+ m_coordinator->syncFixedLayers();
flushCompositingStateForThisLayerOnly();
@@ -464,7 +454,7 @@
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 @@
if (!m_shouldSyncFilters)
return;
m_shouldSyncFilters = false;
- m_CoordinatedGraphicsLayerClient->syncLayerFilters(m_id, filters());
+ m_coordinator->syncLayerFilters(m_id, filters());
}
#endif
@@ -489,7 +479,7 @@
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 @@
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 @@
m_shouldSyncAnimations = false;
- m_CoordinatedGraphicsLayerClient->setLayerAnimations(m_id, m_animations);
+ m_coordinator->setLayerAnimations(m_id, m_animations);
}
void CoordinatedGraphicsLayer::syncCanvas()
@@ -543,7 +533,7 @@
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 @@
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 @@
{
if (!m_inUpdateMode)
return false;
- return m_CoordinatedGraphicsLayerClient->layerTreeTileUpdatesAllowed();
+ return m_coordinator->layerTreeTileUpdatesAllowed();
}
IntRect CoordinatedGraphicsLayer::tiledBackingStoreContentsRect()
@@ -666,7 +656,7 @@
// 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,22 @@
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);
+ 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);
+ 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);
+ m_coordinator->updateTile(id(), tileID, updateInfo, tileRect);
}
void CoordinatedGraphicsLayer::removeTile(int tileID)
{
- m_CoordinatedGraphicsLayerClient->removeTile(id(), tileID);
+ m_coordinator->removeTile(id(), tileID);
}
void CoordinatedGraphicsLayer::updateContentBuffers()
@@ -728,28 +718,9 @@
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()
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h
index a46f277..e78f3b0 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h
@@ -151,7 +151,7 @@
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 +213,7 @@
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;
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
index 2fc4c7a..57cec11 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
@@ -66,7 +66,7 @@
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 @@
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
@@ -585,7 +584,8 @@
PassOwnPtr<GraphicsLayer> LayerTreeCoordinator::createGraphicsLayer(GraphicsLayerClient* client)
{
CoordinatedGraphicsLayer* newLayer = new CoordinatedGraphicsLayer(client);
- newLayer->setCoordinatedGraphicsLayerClient(this);
+ newLayer->setCoordinator(this);
+ attachLayer(newLayer);
return adoptPtr(newLayer);
}