diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-20 01:09:20 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-20 01:09:20 +0000 |
commit | 80aae3ab1c069e4e2dad6d9e323fcf783fa3b598 (patch) | |
tree | f07cecb0988f5303b52378179d928840d490fa70 /cc/resources | |
parent | 91edf189d3a6e3cb5d2560ddfadfe36ec19440be (diff) | |
download | chromium_src-80aae3ab1c069e4e2dad6d9e323fcf783fa3b598.zip chromium_src-80aae3ab1c069e4e2dad6d9e323fcf783fa3b598.tar.gz chromium_src-80aae3ab1c069e4e2dad6d9e323fcf783fa3b598.tar.bz2 |
cc: Reset raster scale if we didn't sync high res tiling.
When we sync tilings, we always expect to sync the high res
tiling. However, in situations where our minimum contents scale
prevents us from syncing the high res tiling, we should instead
reset the raster contents scale, since those would be invalid
as well. This also ensures that we will create a new high res
tiling when we call ManageTilings.
BUG=374143
R=enne
Review URL: https://codereview.chromium.org/294463002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources')
-rw-r--r-- | cc/resources/picture_layer_tiling_set.cc | 18 | ||||
-rw-r--r-- | cc/resources/picture_layer_tiling_set.h | 10 |
2 files changed, 17 insertions, 11 deletions
diff --git a/cc/resources/picture_layer_tiling_set.cc b/cc/resources/picture_layer_tiling_set.cc index 47d393f..d292d83 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) { diff --git a/cc/resources/picture_layer_tiling_set.h b/cc/resources/picture_layer_tiling_set.h index 9d07eb3..db1e4ef 100644 --- a/cc/resources/picture_layer_tiling_set.h +++ b/cc/resources/picture_layer_tiling_set.h @@ -25,11 +25,11 @@ class CC_EXPORT PictureLayerTilingSet { // Delete any tilings that don't meet |minimum_contents_scale|. Recreate // any tiles that intersect |layer_invalidation|. Update the size of all // tilings to |new_layer_bounds|. - void SyncTilings( - const PictureLayerTilingSet& other, - const gfx::Size& new_layer_bounds, - const Region& layer_invalidation, - float minimum_contents_scale); + // Returns true if we had at least one high res tiling synced. + bool SyncTilings(const PictureLayerTilingSet& other, + const gfx::Size& new_layer_bounds, + const Region& layer_invalidation, + float minimum_contents_scale); void RemoveTilesInRegion(const Region& region); |