| 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);
|
|
|