Index: cc/layer_tree_host_common.cc |
diff --git a/cc/layer_tree_host_common.cc b/cc/layer_tree_host_common.cc |
index 4af5717b71987c790e4fba3a16999fbd1841d134..57a3e1065a726e83ec308cb1f127cb7f4b8356ea 100644 |
--- a/cc/layer_tree_host_common.cc |
+++ b/cc/layer_tree_host_common.cc |
@@ -364,8 +364,20 @@ gfx::Transform computeScrollCompensationMatrixForChildren(LayerImpl* layer, cons |
return nextScrollCompensationMatrix; |
} |
-// There is no contentsScale on impl thread. |
-static inline void updateLayerContentsScale(LayerImpl*, const gfx::Transform&, float, float, bool) { } |
+static inline void updateLayerContentsScale(LayerImpl* layer, const gfx::Transform& combinedTransform, float deviceScaleFactor, float pageScaleFactor, bool animatingTransformToScreen) |
shawnsingh
2012/12/11 21:54:05
"update" was actually a word that really made me f
enne (OOO)
2012/12/11 23:23:44
Sure, I can rename this. Why is the word update p
|
+{ |
+ gfx::Vector2dF transformScale = MathUtil::computeTransform2dScaleComponents(combinedTransform); |
+ float contentsScale = std::max(transformScale.x(), transformScale.y()); |
+ layer->setIdealContentsScale(contentsScale); |
+ |
+ LayerImpl* maskLayer = layer->maskLayer(); |
+ if (maskLayer) |
+ maskLayer->setIdealContentsScale(contentsScale); |
+ |
+ LayerImpl* replicaMaskLayer = layer->replicaLayer() ? layer->replicaLayer()->maskLayer() : 0; |
+ if (replicaMaskLayer) |
+ replicaMaskLayer->setIdealContentsScale(contentsScale); |
+} |
static inline void updateLayerContentsScale(Layer* layer, const gfx::Transform& combinedTransform, float deviceScaleFactor, float pageScaleFactor, bool animatingTransformToScreen) |
{ |
@@ -390,15 +402,15 @@ static inline void updateLayerContentsScale(Layer* layer, const gfx::Transform& |
float contentsScale = rasterScale * deviceScaleFactor; |
if (!layer->boundsContainPageScale()) |
contentsScale *= pageScaleFactor; |
- layer->setContentsScale(contentsScale); |
+ layer->setIdealContentsScale(contentsScale); |
Layer* maskLayer = layer->maskLayer(); |
if (maskLayer) |
- maskLayer->setContentsScale(contentsScale); |
+ maskLayer->setIdealContentsScale(contentsScale); |
Layer* replicaMaskLayer = layer->replicaLayer() ? layer->replicaLayer()->maskLayer() : 0; |
if (replicaMaskLayer) |
- replicaMaskLayer->setContentsScale(contentsScale); |
+ replicaMaskLayer->setIdealContentsScale(contentsScale); |
} |
// Recursively walks the layer tree starting at the given node and computes all the |