Chromium Code Reviews| Index: Source/platform/graphics/GraphicsLayer.cpp |
| diff --git a/Source/platform/graphics/GraphicsLayer.cpp b/Source/platform/graphics/GraphicsLayer.cpp |
| index b3ddef1c12e7254d6e701c409b4cfe3513fe46a9..d47368a91dea87d9176135f02da12d40afe098e8 100644 |
| --- a/Source/platform/graphics/GraphicsLayer.cpp |
| +++ b/Source/platform/graphics/GraphicsLayer.cpp |
| @@ -79,7 +79,7 @@ PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, G |
| GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client) |
| : m_client(client) |
| - , m_anchorPoint(0.5f, 0.5f, 0) |
| + , m_transformOriginSet(false) |
| , m_backgroundColor(Color::transparent) |
| , m_opacity(1) |
| , m_zPosition(0) |
| @@ -450,7 +450,6 @@ void GraphicsLayer::setupContentsLayer(WebLayer* contentsLayer) |
| m_contentsLayer->setWebLayerClient(this); |
| m_contentsLayer->setTransformOrigin(FloatPoint3D()); |
| - m_contentsLayer->setAnchorPoint(FloatPoint(0, 0)); |
| m_contentsLayer->setUseParentBackfaceVisibility(true); |
| // It is necessary to call setDrawsContent as soon as we receive the new contentsLayer, for |
| @@ -564,9 +563,7 @@ void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeFlags fl |
| ts << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")\n"; |
| } |
| - if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) { |
| - writeIndent(ts, indent + 1); |
| - ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")\n"; |
| + if (m_transformOriginSet && m_transformOrigin != FloatPoint3D(m_size.width() * 0.5f, m_size.height() * 0.5f, 0)) { |
|
ojan
2014/06/05 21:53:31
Bikeshed: This soudns like a set of transformOrigi
chrishtr
2014/06/05 22:24:24
Done.
|
| writeIndent(ts, indent + 1); |
| ts << "(transformOrigin " << m_transformOrigin.x() << " " << m_transformOrigin.y() << ")\n"; |
| } |
| @@ -807,13 +804,6 @@ void GraphicsLayer::setPosition(const FloatPoint& point) |
| platformLayer()->setPosition(m_position); |
| } |
| -void GraphicsLayer::setAnchorPoint(const FloatPoint3D& point) |
| -{ |
| - m_anchorPoint = point; |
| - platformLayer()->setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y())); |
| - platformLayer()->setAnchorPointZ(m_anchorPoint.z()); |
| -} |
| - |
| void GraphicsLayer::setSize(const FloatSize& size) |
| { |
| // We are receiving negative sizes here that cause assertions to fail in the compositor. Clamp them to 0 to |
| @@ -840,6 +830,7 @@ void GraphicsLayer::setTransform(const TransformationMatrix& transform) |
| void GraphicsLayer::setTransformOrigin(const FloatPoint3D& transformOrigin) |
| { |
| + m_transformOriginSet = true; |
| m_transformOrigin = transformOrigin; |
| platformLayer()->setTransformOrigin(transformOrigin); |
| } |