Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Unified Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 311273008: Remove anchorPoint from WebLayer and GraphicsLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index 8f63184303482ada56d28a7ef616b994e2ee7867..3858a4ce49b6ef7fefcf19c28fb9019a9fa01556 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -345,6 +345,7 @@ void CompositedLayerMapping::updateCompositedBounds(GraphicsLayerUpdater::Update
// If the element has a transform-origin that has fixed lengths, and the renderer has zero size,
// then we need to ensure that the compositing layer has non-zero size so that we can apply
// the transform-origin via the GraphicsLayer anchorPoint (which is expressed as a fractional value).
+ // FIXME: this code is no longer necessary, remove.
if (layerBounds.isEmpty() && hasNonZeroTransformOrigin(renderer())) {
layerBounds.setWidth(1);
layerBounds.setHeight(1);
@@ -829,21 +830,12 @@ void CompositedLayerMapping::updateTransformGeometry(const IntPoint& snappedOffs
layerBounds.y() - relativeCompositingBounds.y() + transformOrigin.y(),
transformOrigin.z());
m_graphicsLayer->setTransformOrigin(compositedTransformOrigin);
-
- // Compute the anchor point, which is in the center of the renderer box unless transform-origin is set.
- // FIXME: get rid of anchor once transformOrigin is plumbed.
- FloatPoint3D anchor(
- relativeCompositingBounds.width() ? compositedTransformOrigin.x() / relativeCompositingBounds.width() : 0.5f,
- relativeCompositingBounds.height() ? compositedTransformOrigin.y() / relativeCompositingBounds.height() : 0.5f,
- transformOrigin.z());
- m_graphicsLayer->setAnchorPoint(anchor);
} else {
FloatPoint3D compositedTransformOrigin(
relativeCompositingBounds.width() * 0.5f,
relativeCompositingBounds.height() * 0.5f,
0.f);
m_graphicsLayer->setTransformOrigin(compositedTransformOrigin);
- m_graphicsLayer->setAnchorPoint(FloatPoint3D(0.5f, 0.5f, 0));
}
}
@@ -1374,7 +1366,6 @@ bool CompositedLayerMapping::updateBackgroundLayer(bool needsBackgroundLayer)
if (!m_backgroundLayer) {
m_backgroundLayer = createGraphicsLayer(CompositingReasonLayerForBackground);
m_backgroundLayer->setDrawsContent(true);
- m_backgroundLayer->setAnchorPoint(FloatPoint3D());
m_backgroundLayer->setTransformOrigin(FloatPoint3D());
m_backgroundLayer->setPaintingPhase(GraphicsLayerPaintBackground);
#if !OS(ANDROID)

Powered by Google App Engine
This is Rietveld 408576698