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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 699053003: cc: Ensure that raster contents scale doesn't go below min scale. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index c3c7ca021104ba5f2468b233838d45beee16c845..3f0d6231577f8156a6773cc03e60ca39943a1774 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -1087,9 +1087,6 @@ void PictureLayerImpl::RecalculateRasterScales() {
raster_contents_scale_ / raster_device_scale_ / raster_source_scale_;
}
- raster_contents_scale_ =
- std::max(raster_contents_scale_, MinimumContentsScale());
-
// If we're not re-rasterizing during animation, rasterize at the maximum
// scale that will occur during the animation, if the maximum scale is
// known. However we want to avoid excessive memory use. If the scale is
@@ -1121,6 +1118,9 @@ void PictureLayerImpl::RecalculateRasterScales() {
raster_contents_scale_ = 1.f * ideal_page_scale_ * ideal_device_scale_;
}
+ raster_contents_scale_ =
+ std::max(raster_contents_scale_, MinimumContentsScale());
+
// If this layer would create zero or one tiles at this content scale,
// don't create a low res tiling.
gfx::Size raster_bounds = gfx::ToCeiledSize(
@@ -1138,6 +1138,7 @@ void PictureLayerImpl::RecalculateRasterScales() {
low_res_raster_contents_scale_ = std::max(
raster_contents_scale_ * low_res_factor,
MinimumContentsScale());
+ DCHECK_LE(low_res_raster_contents_scale_, raster_contents_scale_);
danakj 2014/11/04 16:45:01 can you DCHECK GE MinContentsScale() for both of t
danakj 2014/11/04 16:45:25 Well, I guess for for low res is enough since this
vmpstr 2014/11/04 17:24:02 Done.
}
void PictureLayerImpl::CleanUpTilingsOnActiveLayer(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698