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

Unified Diff: cc/layer_tree_host_common.cc

Issue 12278010: Merge 181957 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/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
===================================================================
--- cc/layer_tree_host_common.cc (revision 182807)
+++ cc/layer_tree_host_common.cc (working copy)
@@ -169,6 +169,7 @@
static inline bool transformToParentIsKnown(Layer* layer)
{
+
return !layer->transformIsAnimating();
}
@@ -570,16 +571,13 @@
// Tr[origin2anchor] is the translation from the layer's origin to its anchor point
// Tr[origin2center] is the translation from the layer's origin to its center
// M[layer] is the layer's matrix (applied at the anchor point)
- // M[sublayer] is the layer's sublayer transform (applied at the layer's center)
+ // M[sublayer] is the layer's sublayer transform (also applied at the layer's anchor point)
// S[layer2content] is the ratio of a layer's contentBounds() to its bounds().
//
// Some composite transforms can help in understanding the sequence of transforms:
// compositeLayerTransform = Tr[origin2anchor] * M[layer] * Tr[origin2anchor].inverse()
- // compositeSublayerTransform = Tr[origin2center] * M[sublayer] * Tr[origin2center].inverse()
+ // compositeSublayerTransform = Tr[origin2anchor] * M[sublayer] * Tr[origin2anchor].inverse()
//
- // In words, the layer transform is applied about the anchor point, and the sublayer transform is
- // applied about the center of the layer.
- //
// 4. When a layer (or render surface) is drawn, it is drawn into a "target render surface". Therefore the draw
// transform does not necessarily transform from screen space to local layer space. Instead, the draw transform
// is the transform between the "target render surface space" and local layer space. Note that render surfaces,
@@ -754,7 +752,7 @@
layerDrawProperties.target_space_transform.Scale(renderSurfaceSublayerScale.x() / layer->contentsScaleX(), renderSurfaceSublayerScale.y() / layer->contentsScaleY());
// Inside the surface's subtree, we scale everything to the owning layer's scale.
- // The sublayer matrix transforms centered layer rects into target
+ // The sublayer matrix transforms layer rects into target
// surface content space.
DCHECK(sublayerMatrix.IsIdentity());
sublayerMatrix.Scale(renderSurfaceSublayerScale.x(), renderSurfaceSublayerScale.y());
@@ -867,11 +865,11 @@
if (!layer->preserves3D())
sublayerMatrix.FlattenTo2d();
- // Apply the sublayer transform at the center of the layer.
+ // Apply the sublayer transform at the anchor point of the layer.
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