Index: cc/layer_tree_host_common.cc |
diff --git a/cc/layer_tree_host_common.cc b/cc/layer_tree_host_common.cc |
index 662d5d82098e4a224d060daaa854c9b4ac3cf06b..e64a339aa8c2f3d7afc0848bdd401e50336f015c 100644 |
--- a/cc/layer_tree_host_common.cc |
+++ b/cc/layer_tree_host_common.cc |
@@ -349,15 +349,15 @@ WebTransformationMatrix computeScrollCompensationMatrixForChildren(LayerImpl* la |
} |
// There is no contentsScale on impl thread. |
-static inline void updateLayerContentsScale(LayerImpl*, const WebTransformationMatrix&, float, float) { } |
+static inline void updateLayerContentsScale(LayerImpl*, const WebTransformationMatrix&, float, float, bool) { } |
-static inline void updateLayerContentsScale(Layer* layer, const WebTransformationMatrix& combinedTransform, float deviceScaleFactor, float pageScaleFactor) |
+static inline void updateLayerContentsScale(Layer* layer, const WebTransformationMatrix& combinedTransform, float deviceScaleFactor, float pageScaleFactor, bool animatingTransformToScreen) |
{ |
float rasterScale = layer->rasterScale(); |
if (!rasterScale) { |
rasterScale = 1; |
- if (layer->automaticallyComputeRasterScale()) { |
+ if (!animatingTransformToScreen && layer->automaticallyComputeRasterScale()) { |
gfx::Vector2dF transformScale = MathUtil::computeTransform2dScaleComponents(combinedTransform); |
float combinedScale = std::max(transformScale.x(), transformScale.y()); |
rasterScale = combinedScale / deviceScaleFactor; |
@@ -489,6 +489,13 @@ static void calculateDrawTransformsInternal(LayerType* layer, const WebTransform |
drawOpacityIsAnimating |= layer->parent()->drawOpacityIsAnimating(); |
} |
+ bool animatingTransformToTarget = layer->transformIsAnimating(); |
+ bool animatingTransformToScreen = animatingTransformToTarget; |
+ if (layer->parent()) { |
+ animatingTransformToTarget |= layer->parent()->drawTransformIsAnimating(); |
+ animatingTransformToScreen |= layer->parent()->screenSpaceTransformIsAnimating(); |
+ } |
+ |
gfx::Size bounds = layer->bounds(); |
gfx::PointF anchorPoint = layer->anchorPoint(); |
gfx::PointF position = layer->position() - layer->scrollDelta(); |
@@ -506,7 +513,7 @@ static void calculateDrawTransformsInternal(LayerType* layer, const WebTransform |
// The layer's contentsSize is determined from the combinedTransform, which then informs the |
// layer's drawTransform. |
- updateLayerContentsScale(layer, combinedTransform, deviceScaleFactor, pageScaleFactor); |
+ updateLayerContentsScale(layer, combinedTransform, deviceScaleFactor, pageScaleFactor, animatingTransformToScreen); |
// If there is a tranformation from the impl thread then it should be at the |
// start of the combinedTransform, but we don't want it to affect the contentsScale. |
@@ -535,13 +542,6 @@ static void calculateDrawTransformsInternal(LayerType* layer, const WebTransform |
layerScreenSpaceTransform.multiply(drawTransform); |
layer->setScreenSpaceTransform(layerScreenSpaceTransform); |
- bool animatingTransformToTarget = layer->transformIsAnimating(); |
- bool animatingTransformToScreen = animatingTransformToTarget; |
- if (layer->parent()) { |
- animatingTransformToTarget |= layer->parent()->drawTransformIsAnimating(); |
- animatingTransformToScreen |= layer->parent()->screenSpaceTransformIsAnimating(); |
- } |
- |
gfx::RectF contentRect(gfx::PointF(), layer->contentBounds()); |
// fullHierarchyMatrix is the matrix that transforms objects between screen space (except projection matrix) and the most recent RenderSurfaceImpl's space. |