Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2034)

Unified Diff: cc/LayerChromium.cpp

Issue 10909255: Support high DPI scrollbar on top level web frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only apply page scale factor to layers within and including root scroll layer. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/LayerChromium.cpp
diff --git a/cc/LayerChromium.cpp b/cc/LayerChromium.cpp
index 59a63eff8e0db77d6557992b2e047f6dc01036ba..df5ea66bc9f9bd5f516acbae1c012c26eaad200d 100644
--- a/cc/LayerChromium.cpp
+++ b/cc/LayerChromium.cpp
@@ -116,6 +116,15 @@ void LayerChromium::setNeedsCommit()
m_layerTreeHost->setNeedsCommit();
}
+IntRect LayerChromium::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);
+}
+
void LayerChromium::setParent(LayerChromium* layer)
{
ASSERT(!layer || !layer->hasAncestor(this));
« cc/CCLayerTreeHost.cpp ('K') | « cc/LayerChromium.h ('k') | cc/ScrollbarLayerChromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698