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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 323193002: cc: Don't cleanup the pending twin's low res tiling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: scale-collision: . Created 6 years, 6 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 | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | 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 6d37b7f4db2f449caaa7a444ad12b904782c7e22..7d3942a645522c54e250a1a63912e54b2c73f440 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -1221,6 +1221,7 @@ void PictureLayerImpl::CleanUpTilingsOnActiveLayer(
raster_contents_scale_, ideal_contents_scale_);
float max_acceptable_high_res_scale = std::max(
raster_contents_scale_, ideal_contents_scale_);
+ float twin_low_res_scale = 0.f;
PictureLayerImpl* twin = twin_layer_;
if (twin) {
@@ -1230,6 +1231,12 @@ void PictureLayerImpl::CleanUpTilingsOnActiveLayer(
max_acceptable_high_res_scale = std::max(
max_acceptable_high_res_scale,
std::max(twin->raster_contents_scale_, twin->ideal_contents_scale_));
+
+ for (size_t i = 0; i < twin->tilings_->num_tilings(); ++i) {
+ PictureLayerTiling* tiling = twin->tilings_->tiling_at(i);
+ if (tiling->resolution() == LOW_RESOLUTION)
+ twin_low_res_scale = tiling->contents_scale();
+ }
}
std::vector<PictureLayerTiling*> to_remove;
@@ -1243,9 +1250,11 @@ void PictureLayerImpl::CleanUpTilingsOnActiveLayer(
continue;
// Keep low resolution tilings, if the layer should have them.
- if (tiling->resolution() == LOW_RESOLUTION &&
- layer_tree_impl()->create_low_res_tiling())
- continue;
+ if (layer_tree_impl()->create_low_res_tiling()) {
+ if (tiling->resolution() == LOW_RESOLUTION ||
+ tiling->contents_scale() == twin_low_res_scale)
+ continue;
+ }
// Don't remove tilings that are being used (and thus would cause a flash.)
if (std::find(used_tilings.begin(), used_tilings.end(), tiling) !=
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698