| Index: cc/image_layer.cc
|
| diff --git a/cc/image_layer.cc b/cc/image_layer.cc
|
| index f3819faf3dd236f478f694bd9f64f3a8211d4cd6..82ce952f9215a5735f1b15f3cc45b37830dc0016 100644
|
| --- a/cc/image_layer.cc
|
| +++ b/cc/image_layer.cc
|
| @@ -74,9 +74,15 @@ LayerUpdater* ImageLayer::updater() const
|
| return m_updater.get();
|
| }
|
|
|
| -gfx::Size ImageLayer::contentBounds() const
|
| +void ImageLayer::calculateContentsScale(
|
| + float ideal_contents_scale,
|
| + float* contentsScaleX,
|
| + float* contentsScaleY,
|
| + gfx::Size* contentBounds)
|
| {
|
| - return gfx::Size(m_bitmap.width(), m_bitmap.height());
|
| + *contentsScaleX = imageContentsScaleX();
|
| + *contentsScaleY = imageContentsScaleY();
|
| + *contentBounds = gfx::Size(m_bitmap.width(), m_bitmap.height());
|
| }
|
|
|
| bool ImageLayer::drawsContent() const
|
| @@ -84,16 +90,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();
|
| }
|
|
|