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

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: Rebased 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
« no previous file with comments | « cc/layer_tree_host_common_unittest.cc ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 581377e2b3397ef5f3c4eea7e8502b62b7626621..1add8df3ff2c2417a8c7122228d397c1004f8f5d 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -1102,12 +1102,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);
« no previous file with comments | « cc/layer_tree_host_common_unittest.cc ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698