Index: cc/CCLayerImpl.cpp |
diff --git a/cc/CCLayerImpl.cpp b/cc/CCLayerImpl.cpp |
index 9068d31aaa6f76dab4e4af38643c0b6ec9595b77..c08b8604b0bb4d6a2fb36071238d317b311a4cb6 100644 |
--- a/cc/CCLayerImpl.cpp |
+++ b/cc/CCLayerImpl.cpp |
@@ -209,6 +209,15 @@ CCInputHandlerClient::ScrollStatus CCLayerImpl::tryScroll(const IntPoint& viewpo |
return CCInputHandlerClient::ScrollStarted; |
} |
+IntRect CCLayerImpl::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); |
+ return enclosingIntRect(contentRect); |
+} |
+ |
std::string CCLayerImpl::indentString(int indent) |
{ |
std::string str; |