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

Unified Diff: cc/layer_tree_host_impl.cc

Issue 11276060: Pass accurate contentsScale to LayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index eca5aa203d8de2a25d5f1ddb881dc5e600ccf115..7c00d3189e418986a915228bb256ced88d1ceca1 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -1103,12 +1103,8 @@ static FloatSize scrollLayerWithViewportSpaceDelta(PinchZoomViewport* viewport,
return FloatSize();
// localStartPoint and localEndPoint are in content space but we want to move them to layer space for scrolling.
- float widthScale = 1;
- float heightScale = 1;
- if (!layerImpl.contentBounds().isEmpty() && !layerImpl.bounds().isEmpty()) {
- widthScale = layerImpl.bounds().width() / static_cast<float>(layerImpl.contentBounds().width());
- heightScale = layerImpl.bounds().height() / static_cast<float>(layerImpl.contentBounds().height());
- }
+ float widthScale = 1.0 / layerImpl.contentsScaleX();
+ float heightScale = 1.0 / layerImpl.contentsScaleY();
localStartPoint.scale(widthScale, heightScale);
localEndPoint.scale(widthScale, heightScale);

Powered by Google App Engine
This is Rietveld 408576698