Index: cc/contents_scaling_layer.cc |
diff --git a/cc/contents_scaling_layer.cc b/cc/contents_scaling_layer.cc |
index 454b6e786e0085b8952c8a7d47243a680f47cbcf..3131154dd9e5b8480a8191a476b7484be6160838 100644 |
--- a/cc/contents_scaling_layer.cc |
+++ b/cc/contents_scaling_layer.cc |
@@ -11,30 +11,28 @@ gfx::Size ContentsScalingLayer::computeContentBoundsForScale(float scaleX, float |
return gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scaleX, scaleY)); |
} |
-ContentsScalingLayer::ContentsScalingLayer() |
- : m_contentsScale(1.0) { |
+ContentsScalingLayer::ContentsScalingLayer() { |
} |
ContentsScalingLayer::~ContentsScalingLayer() { |
} |
-gfx::Size ContentsScalingLayer::contentBounds() const { |
- return computeContentBoundsForScale(contentsScaleX(), contentsScaleY()); |
-} |
- |
-float ContentsScalingLayer::contentsScaleX() const { |
- return m_contentsScale; |
-} |
+void ContentsScalingLayer::setIdealContentsScale( |
+ float ideal_contents_scale) { |
+ if (m_drawProperties.ideal_contents_scale == ideal_contents_scale) |
+ return; |
-float ContentsScalingLayer::contentsScaleY() const { |
- return m_contentsScale; |
+ m_drawProperties.ideal_contents_scale = ideal_contents_scale; |
+ m_drawProperties.contents_scale_x = ideal_contents_scale; |
+ m_drawProperties.contents_scale_y = ideal_contents_scale; |
+ didUpdateBounds(); |
+ setNeedsDisplay(); |
} |
-void ContentsScalingLayer::setContentsScale(float contentsScale) { |
- if (m_contentsScale == contentsScale) |
- return; |
- m_contentsScale = contentsScale; |
- setNeedsDisplay(); |
+void ContentsScalingLayer::didUpdateBounds() { |
+ m_drawProperties.content_bounds = computeContentBoundsForScale( |
+ m_drawProperties.ideal_contents_scale, |
+ m_drawProperties.ideal_contents_scale); |
} |
} // namespace cc |