Index: cc/layer.cc |
diff --git a/cc/layer.cc b/cc/layer.cc |
index 4c3912608c2448bb932ce16349d403e67dc7fc49..a079ed7699c44a10481e4345efa0b9d404ba1e1b 100644 |
--- a/cc/layer.cc |
+++ b/cc/layer.cc |
@@ -64,7 +64,6 @@ Layer::Layer() |
, m_renderTarget(0) |
, m_drawTransformIsAnimating(false) |
, m_screenSpaceTransformIsAnimating(false) |
- , m_contentsScale(1.0) |
, m_rasterScale(1.0) |
, m_automaticallyComputeRasterScale(false) |
, m_boundsContainPageScale(false) |
@@ -122,10 +121,8 @@ void Layer::setNeedsCommit() |
IntRect Layer::layerRectToContentRect(const WebKit::WebRect& layerRect) |
{ |
- float widthScale = static_cast<float>(contentBounds().width()) / bounds().width(); |
- float heightScale = static_cast<float>(contentBounds().height()) / bounds().height(); |
FloatRect contentRect(layerRect.x, layerRect.y, layerRect.width, layerRect.height); |
- contentRect.scale(widthScale, heightScale); |
+ contentRect.scale(contentsScaleX(), contentsScaleY()); |
return enclosingIntRect(contentRect); |
danakj
2012/10/29 20:06:51
Since this conversion is not exactly right for ima
wangxianzhu
2012/10/30 02:14:21
Done.
|
} |
@@ -556,7 +553,7 @@ void Layer::pushPropertiesTo(LayerImpl* layer) |
layer->setAnchorPointZ(m_anchorPointZ); |
layer->setBackgroundColor(m_backgroundColor); |
layer->setBounds(m_bounds); |
- layer->setContentBounds(contentBounds()); |
+ layer->setContentsScale(contentsScaleX(), contentsScaleY()); |
layer->setDebugBorderColor(m_debugBorderColor); |
layer->setDebugBorderWidth(m_debugBorderWidth); |
layer->setDebugName(m_debugName); |
@@ -630,11 +627,6 @@ bool Layer::needMoreUpdates() |
return false; |
} |
-bool Layer::needsContentsScale() const |
-{ |
- return false; |
-} |
- |
void Layer::setDebugBorderColor(SkColor color) |
{ |
m_debugBorderColor = color; |
@@ -653,15 +645,6 @@ void Layer::setDebugName(const std::string& debugName) |
setNeedsCommit(); |
} |
-void Layer::setContentsScale(float contentsScale) |
-{ |
- if (!needsContentsScale() || m_contentsScale == contentsScale) |
- return; |
- m_contentsScale = contentsScale; |
- |
- setNeedsDisplay(); |
-} |
- |
void Layer::setRasterScale(float scale) |
{ |
if (m_rasterScale == scale) |