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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 328383002: Merge 276305 "cc: Don't cleanup the pending twin's low res tiling." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1985/src/
Patch Set: 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/resources/picture_layer_tiling_set.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
===================================================================
--- cc/layers/picture_layer_impl.cc (revision 276694)
+++ cc/layers/picture_layer_impl.cc (working copy)
@@ -1174,6 +1174,7 @@
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) {
@@ -1183,6 +1184,12 @@
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;
@@ -1196,8 +1203,11 @@
continue;
// Keep low resolution tilings, if the layer should have them.
- if (tiling->resolution() == LOW_RESOLUTION && ShouldHaveLowResTiling())
- continue;
+ if (ShouldHaveLowResTiling()) {
+ 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/resources/picture_layer_tiling_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698