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

Unified Diff: cc/layer_tree_host_common.cc

Issue 11377088: cc: Prevent small scale factors (below 1) from being used or saved as the layer's rasterScale. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: smallpsf Created 8 years, 1 month 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 | « no previous file | cc/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_common.cc
diff --git a/cc/layer_tree_host_common.cc b/cc/layer_tree_host_common.cc
index e64a339aa8c2f3d7afc0848bdd401e50336f015c..a7dd4c8a24ee17f95a3bbdaf09e57df47f66520a 100644
--- a/cc/layer_tree_host_common.cc
+++ b/cc/layer_tree_host_common.cc
@@ -363,7 +363,11 @@ static inline void updateLayerContentsScale(Layer* layer, const WebTransformatio
rasterScale = combinedScale / deviceScaleFactor;
if (!layer->boundsContainPageScale())
rasterScale /= pageScaleFactor;
- layer->setRasterScale(rasterScale);
+ // Prevent scale factors below 1 from being used or saved.
+ if (rasterScale < 1)
+ rasterScale = 1;
+ else
+ layer->setRasterScale(rasterScale);
}
}
« no previous file with comments | « no previous file | cc/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698