| Index: cc/image_layer.cc
|
| diff --git a/cc/image_layer.cc b/cc/image_layer.cc
|
| index f3819faf3dd236f478f694bd9f64f3a8211d4cd6..695def5c347ad344020dd6e2d3e419aaab483486 100644
|
| --- a/cc/image_layer.cc
|
| +++ b/cc/image_layer.cc
|
| @@ -74,9 +74,11 @@ LayerUpdater* ImageLayer::updater() const
|
| return m_updater.get();
|
| }
|
|
|
| -gfx::Size ImageLayer::contentBounds() const
|
| +void ImageLayer::updateContentsScale(float ideal_contents_scale)
|
| {
|
| - return gfx::Size(m_bitmap.width(), m_bitmap.height());
|
| + m_drawProperties.contents_scale_x = imageContentsScaleX();
|
| + m_drawProperties.contents_scale_y = imageContentsScaleY();
|
| + m_drawProperties.content_bounds = gfx::Size(m_bitmap.width(), m_bitmap.height());
|
| }
|
|
|
| bool ImageLayer::drawsContent() const
|
| @@ -84,16 +86,16 @@ bool ImageLayer::drawsContent() const
|
| return !m_bitmap.isNull() && TiledLayer::drawsContent();
|
| }
|
|
|
| -float ImageLayer::contentsScaleX() const
|
| +float ImageLayer::imageContentsScaleX() const
|
| {
|
| - if (bounds().IsEmpty() || contentBounds().IsEmpty())
|
| + if (bounds().IsEmpty() || m_bitmap.width() == 0)
|
| return 1;
|
| return static_cast<float>(m_bitmap.width()) / bounds().width();
|
| }
|
|
|
| -float ImageLayer::contentsScaleY() const
|
| +float ImageLayer::imageContentsScaleY() const
|
| {
|
| - if (bounds().IsEmpty() || contentBounds().IsEmpty())
|
| + if (bounds().IsEmpty() || m_bitmap.height() == 0)
|
| return 1;
|
| return static_cast<float>(m_bitmap.height()) / bounds().height();
|
| }
|
|
|