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

Unified Diff: cc/layer_tree_host_common.cc

Issue 12224113: [cc] Apply sublayer transform about anchor instead of about layer center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « no previous file | cc/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_common.cc
diff --git a/cc/layer_tree_host_common.cc b/cc/layer_tree_host_common.cc
index e316c370fad9a7c6f3423e0b97c60f7764cd2398..4606dff975fa323c1b43e01bee7cc224fc7f136e 100644
--- a/cc/layer_tree_host_common.cc
+++ b/cc/layer_tree_host_common.cc
@@ -869,9 +869,9 @@ static void calculateDrawPropertiesInternal(LayerType* layer, const gfx::Transfo
// Apply the sublayer transform at the center of the layer.
danakj 2013/02/12 00:58:23 This comment is wrong now.
if (!layer->sublayerTransform().IsIdentity()) {
- sublayerMatrix.Translate(0.5 * bounds.width(), 0.5 * bounds.height());
+ sublayerMatrix.Translate(layer->anchorPoint().x() * bounds.width(), layer->anchorPoint().y() * bounds.height());
sublayerMatrix.PreconcatTransform(layer->sublayerTransform());
- sublayerMatrix.Translate(-0.5 * bounds.width(), -0.5 * bounds.height());
+ sublayerMatrix.Translate(-layer->anchorPoint().x() * bounds.width(), -layer->anchorPoint().y() * bounds.height());
}
LayerList& descendants = (layer->renderSurface() ? layer->renderSurface()->layerList() : layerList);
« no previous file with comments | « no previous file | cc/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698