Index: cc/image_layer.cc |
diff --git a/cc/image_layer.cc b/cc/image_layer.cc |
index e1620073e46a3db9c3e059e697decb0e347797e1..3c1712eeffc280d3af0e5ae3372965442ee9bb33 100644 |
--- a/cc/image_layer.cc |
+++ b/cc/image_layer.cc |
@@ -150,10 +150,18 @@ bool ImageLayer::drawsContent() const |
return !m_bitmap.isNull() && TiledLayer::drawsContent(); |
} |
-bool ImageLayer::needsContentsScale() const |
+float ImageLayer::contentsScaleX() const |
{ |
- // Contents scale is not need for image layer because this can be done in compositor more efficiently. |
- return false; |
+ if (bounds().isEmpty() || contentBounds().isEmpty()) |
+ return 1; |
+ return static_cast<float>(m_bitmap.width()) / bounds().width(); |
+} |
+ |
+float ImageLayer::contentsScaleY() const |
+{ |
+ if (bounds().isEmpty() || contentBounds().isEmpty()) |
+ return 1; |
+ return static_cast<float>(m_bitmap.height()) / bounds().height(); |
} |
} |