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

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: Fix. 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
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.cpp ('k') | Source/platform/graphics/GraphicsLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index ad00c2156c123ed1f12f876d85be01ba27d71bb3..ec4acc193eb93af55cd86079384cd0a8b9d48f73 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -339,6 +339,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);
@@ -823,21 +824,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));
}
}
@@ -1368,7 +1360,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)
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.cpp ('k') | Source/platform/graphics/GraphicsLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698