Index: cc/image_layer.cc |
diff --git a/cc/image_layer.cc b/cc/image_layer.cc |
index b3477367476817bbfdbe2d2699baef529daf0dae..cbc855ab6978fc4f8e32312c8d4f78e1340c24d8 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()) |
+ return 1; |
+ return static_cast<float>(m_bitmap.width()) / bounds().width(); |
+} |
+ |
+float ImageLayer::contentsScaleY() const |
+{ |
+ if (bounds().isEmpty()) |
+ return 1; |
+ return static_cast<float>(m_bitmap.height()) / bounds().height(); |
} |
} |