- Revision
- 125822
- Author
- [email protected]
- Date
- 2012-08-16 16:11:00 -0700 (Thu, 16 Aug 2012)
Log Message
[chromium] Remove unnecessary tree hierarchy inspection APIs from WebLayer
https://bugs.webkit.org/show_bug.cgi?id=94229
Reviewed by Adrienne Walker.
Source/Platform:
As it turns out, these APIs are needed. Without them, there is no way to re-wrap an existing layer so we can
know that when all WebLayer wrappers of a given layer go away that layer will never be exposed to the public API
again and run appropriate cleanup code.
* chromium/public/WebLayer.h:
(WebLayer):
Source/WebCore:
Tweak updateLayerPreserves3D() logic to use the existing GraphicsLayer tree hierarchy instead of pulling the
hierarchy off of WebLayer.
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
Source/WebKit/chromium:
Remove dead WebLayer function implementations and tests of same.
* src/WebLayer.cpp:
* tests/WebLayerTest.cpp:
Modified Paths
Diff
Modified: trunk/Source/Platform/ChangeLog (125821 => 125822)
--- trunk/Source/Platform/ChangeLog 2012-08-16 23:07:56 UTC (rev 125821)
+++ trunk/Source/Platform/ChangeLog 2012-08-16 23:11:00 UTC (rev 125822)
@@ -1,5 +1,19 @@
2012-08-16 James Robinson <[email protected]>
+ [chromium] Remove unnecessary tree hierarchy inspection APIs from WebLayer
+ https://bugs.webkit.org/show_bug.cgi?id=94229
+
+ Reviewed by Adrienne Walker.
+
+ As it turns out, these APIs are needed. Without them, there is no way to re-wrap an existing layer so we can
+ know that when all WebLayer wrappers of a given layer go away that layer will never be exposed to the public API
+ again and run appropriate cleanup code.
+
+ * chromium/public/WebLayer.h:
+ (WebLayer):
+
+2012-08-16 James Robinson <[email protected]>
+
[chromium] Remove alwaysReserveTextures code - it doesn't do anything
https://bugs.webkit.org/show_bug.cgi?id=94183
Modified: trunk/Source/Platform/chromium/public/WebLayer.h (125821 => 125822)
--- trunk/Source/Platform/chromium/public/WebLayer.h 2012-08-16 23:07:56 UTC (rev 125821)
+++ trunk/Source/Platform/chromium/public/WebLayer.h 2012-08-16 23:11:00 UTC (rev 125822)
@@ -67,11 +67,6 @@
// Sets the entire layer as invalid, i.e. needs to update its content.
WEBKIT_EXPORT void invalidate();
- WEBKIT_EXPORT WebLayer rootLayer() const;
- WEBKIT_EXPORT WebLayer parent() const;
- WEBKIT_EXPORT size_t numberOfChildren() const;
- WEBKIT_EXPORT WebLayer childAt(size_t) const;
-
WEBKIT_EXPORT void addChild(const WebLayer&);
WEBKIT_EXPORT void insertChild(const WebLayer&, size_t index);
WEBKIT_EXPORT void replaceChild(const WebLayer& reference, const WebLayer& newLayer);
@@ -92,8 +87,6 @@
WEBKIT_EXPORT bool masksToBounds() const;
WEBKIT_EXPORT void setMaskLayer(const WebLayer&);
- WEBKIT_EXPORT WebLayer maskLayer() const;
-
WEBKIT_EXPORT void setReplicaLayer(const WebLayer&);
WEBKIT_EXPORT void setOpacity(float);
Modified: trunk/Source/WebCore/ChangeLog (125821 => 125822)
--- trunk/Source/WebCore/ChangeLog 2012-08-16 23:07:56 UTC (rev 125821)
+++ trunk/Source/WebCore/ChangeLog 2012-08-16 23:11:00 UTC (rev 125822)
@@ -1,3 +1,16 @@
+2012-08-16 James Robinson <[email protected]>
+
+ [chromium] Remove unnecessary tree hierarchy inspection APIs from WebLayer
+ https://bugs.webkit.org/show_bug.cgi?id=94229
+
+ Reviewed by Adrienne Walker.
+
+ Tweak updateLayerPreserves3D() logic to use the existing GraphicsLayer tree hierarchy instead of pulling the
+ hierarchy off of WebLayer.
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
+
2012-08-16 Ryosuke Niwa <[email protected]>
Let XCode have its own way.
Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp (125821 => 125822)
--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2012-08-16 23:07:56 UTC (rev 125821)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2012-08-16 23:11:00 UTC (rev 125822)
@@ -741,16 +741,16 @@
m_layer.setContentsScale(contentsScale());
// Move this layer to be a child of the transform layer.
- if (!m_layer.parent().isNull())
- m_layer.parent().replaceChild(m_layer, m_transformLayer);
+ if (parent())
+ parent()->platformLayer()->replaceChild(m_layer, m_transformLayer);
m_transformLayer.addChild(m_layer);
updateChildList();
} else if (!m_preserves3D && !m_transformLayer.isNull()) {
// Relace the transformLayer in the parent with this layer.
m_layer.removeFromParent();
- if (!m_transformLayer.parent().isNull())
- m_transformLayer.parent().replaceChild(m_transformLayer, m_layer);
+ if (parent())
+ parent()->platformLayer()->replaceChild(m_transformLayer, m_layer);
m_layer.setAnimationDelegate(this);
m_transformLayer.transferAnimationsTo(&m_layer);
Modified: trunk/Source/WebKit/chromium/ChangeLog (125821 => 125822)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-08-16 23:07:56 UTC (rev 125821)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-08-16 23:11:00 UTC (rev 125822)
@@ -1,3 +1,15 @@
+2012-08-16 James Robinson <[email protected]>
+
+ [chromium] Remove unnecessary tree hierarchy inspection APIs from WebLayer
+ https://bugs.webkit.org/show_bug.cgi?id=94229
+
+ Reviewed by Adrienne Walker.
+
+ Remove dead WebLayer function implementations and tests of same.
+
+ * src/WebLayer.cpp:
+ * tests/WebLayerTest.cpp:
+
2012-08-16 David Reveman <[email protected]>
[Chromium] Avoid aliasing global symbol monotonicallyIncreasingTime().
Modified: trunk/Source/WebKit/chromium/src/WebLayer.cpp (125821 => 125822)
--- trunk/Source/WebKit/chromium/src/WebLayer.cpp 2012-08-16 23:07:56 UTC (rev 125821)
+++ trunk/Source/WebKit/chromium/src/WebLayer.cpp 2012-08-16 23:11:00 UTC (rev 125822)
@@ -107,26 +107,6 @@
m_private->setNeedsDisplay();
}
-WebLayer WebLayer::rootLayer() const
-{
- return WebLayer(const_cast<LayerChromium*>(m_private->rootLayer()));
-}
-
-WebLayer WebLayer::parent() const
-{
- return WebLayer(const_cast<LayerChromium*>(m_private->parent()));
-}
-
-size_t WebLayer::numberOfChildren() const
-{
- return m_private->children().size();
-}
-
-WebLayer WebLayer::childAt(size_t index) const
-{
- return WebLayer(m_private->children()[index]);
-}
-
void WebLayer::addChild(const WebLayer& child)
{
m_private->addChild(child);
@@ -207,11 +187,6 @@
m_private->setMaskLayer(ref.unwrap<LayerChromium>());
}
-WebLayer WebLayer::maskLayer() const
-{
- return WebLayer(m_private->maskLayer());
-}
-
void WebLayer::setReplicaLayer(const WebLayer& replicaLayer)
{
WebLayer ref = replicaLayer;
Modified: trunk/Source/WebKit/chromium/tests/WebLayerTest.cpp (125821 => 125822)
--- trunk/Source/WebKit/chromium/tests/WebLayerTest.cpp 2012-08-16 23:07:56 UTC (rev 125821)
+++ trunk/Source/WebKit/chromium/tests/WebLayerTest.cpp 2012-08-16 23:11:00 UTC (rev 125822)
@@ -137,7 +137,6 @@
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
layer.setMaskLayer(otherLayer);
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_EQ(otherLayer, layer.maskLayer());
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
float opacity = 0.123f;
@@ -189,42 +188,4 @@
EXPECT_FALSE(contentLayer.drawsContent());
}
-TEST_F(WebLayerTest, Hierarchy)
-{
- EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- WebLayer layer1 = WebLayer::create();
- WebLayer layer2 = WebLayer::create();
-
- EXPECT_TRUE(layer1.parent().isNull());
- EXPECT_TRUE(layer2.parent().isNull());
-
- layer1.addChild(layer2);
- EXPECT_TRUE(layer1.parent().isNull());
- EXPECT_EQ(layer1, layer2.parent());
-
- layer2.removeFromParent();
- EXPECT_TRUE(layer2.parent().isNull());
-
- layer1.addChild(layer2);
- EXPECT_EQ(layer1, layer2.parent());
- layer1.removeAllChildren();
- EXPECT_TRUE(layer2.parent().isNull());
-
- MockWebContentLayerClient contentClient;
- EXPECT_CALL(contentClient, paintContents(_, _, _)).Times(AnyNumber());
- WebContentLayer contentLayer = WebContentLayer::create(&contentClient);
- WebExternalTextureLayer textureLayer = WebExternalTextureLayer::create();
-
- textureLayer.addChild(contentLayer);
- contentLayer.addChild(layer1);
- layer1.addChild(layer2);
-
- // Release reference on all layers, checking that destruction (which may
- // generate calls to the client) doesn't crash.
- layer2.reset();
- layer1.reset();
- contentLayer.reset();
- textureLayer.reset();
}
-
-}