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

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: dcheck 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..a5c4e08bd169ebbdfb1e25bab4ff0bcf53ca31c3 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,8 @@ 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_);
+ DCHECK_GE(low_res_raster_contents_scale_, MinimumContentsScale());
}
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