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

Unified Diff: cc/resources/picture_layer_tiling_set.cc

Issue 294463002: cc: Reset raster scale if we didn't sync high res tiling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more comments Created 6 years, 7 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 | « cc/resources/picture_layer_tiling_set.h ('k') | cc/test/fake_picture_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_layer_tiling_set.cc
diff --git a/cc/resources/picture_layer_tiling_set.cc b/cc/resources/picture_layer_tiling_set.cc
index 47d393f19202e54d0f5c9a5a765b07eac52f1e47..d292d83fab2a53d05ba39d7ca579e3db11c2c0cc 100644
--- a/cc/resources/picture_layer_tiling_set.cc
+++ b/cc/resources/picture_layer_tiling_set.cc
@@ -36,15 +36,14 @@ void PictureLayerTilingSet::SetClient(PictureLayerTilingClient* client) {
tilings_[i]->SetClient(client_);
}
-void PictureLayerTilingSet::SyncTilings(
- const PictureLayerTilingSet& other,
- const gfx::Size& new_layer_bounds,
- const Region& layer_invalidation,
- float minimum_contents_scale) {
+bool PictureLayerTilingSet::SyncTilings(const PictureLayerTilingSet& other,
+ const gfx::Size& new_layer_bounds,
+ const Region& layer_invalidation,
+ float minimum_contents_scale) {
if (new_layer_bounds.IsEmpty()) {
RemoveAllTilings();
layer_bounds_ = new_layer_bounds;
- return;
+ return false;
}
tilings_.reserve(other.tilings_.size());
@@ -60,6 +59,8 @@ void PictureLayerTilingSet::SyncTilings(
--i;
}
+ bool have_high_res_tiling = false;
+
// Add any missing tilings from |other| that meet the minimum.
for (size_t i = 0; i < other.tilings_.size(); ++i) {
float contents_scale = other.tilings_[i]->contents_scale();
@@ -75,6 +76,8 @@ void PictureLayerTilingSet::SyncTilings(
this_tiling->UpdateTilesToCurrentPile();
this_tiling->CreateMissingTilesInLiveTilesRect();
+ if (this_tiling->resolution() == HIGH_RESOLUTION)
+ have_high_res_tiling = true;
DCHECK(this_tiling->tile_size() ==
client_->CalculateTileSize(this_tiling->TilingRect().size()));
@@ -85,11 +88,14 @@ void PictureLayerTilingSet::SyncTilings(
new_layer_bounds,
client_);
new_tiling->set_resolution(other.tilings_[i]->resolution());
+ if (new_tiling->resolution() == HIGH_RESOLUTION)
+ have_high_res_tiling = true;
tilings_.push_back(new_tiling.Pass());
}
tilings_.sort(LargestToSmallestScaleFunctor());
layer_bounds_ = new_layer_bounds;
+ return have_high_res_tiling;
}
void PictureLayerTilingSet::RemoveTilesInRegion(const Region& region) {
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/test/fake_picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698