diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-09 05:51:20 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-09 05:51:20 +0000 |
commit | 918317774a92ea92265dc0820212c61426742dd2 (patch) | |
tree | aecc585e8bf7c84b0122031c9d2515766fca68f4 /cc/resources/picture_layer_tiling_set.cc | |
parent | 3e2990726f720024766ae98dd7f3e377f8f0d4db (diff) | |
download | chromium_src-918317774a92ea92265dc0820212c61426742dd2.zip chromium_src-918317774a92ea92265dc0820212c61426742dd2.tar.gz chromium_src-918317774a92ea92265dc0820212c61426742dd2.tar.bz2 |
cc: Ensure resolution is copied during tiling set copy
When copying tiling (adding to match resolution), we
have to copy the resolution information from the source
tiling. Otherwise, all of the resolution ends up being
NONIDEAL, since ManageTilings isn't called.
BUG=237915
Review URL: https://chromiumcodereview.appspot.com/14964006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199137 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/picture_layer_tiling_set.cc')
-rw-r--r-- | cc/resources/picture_layer_tiling_set.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cc/resources/picture_layer_tiling_set.cc b/cc/resources/picture_layer_tiling_set.cc index 8e543ba..d27a9114 100644 --- a/cc/resources/picture_layer_tiling_set.cc +++ b/cc/resources/picture_layer_tiling_set.cc @@ -45,9 +45,15 @@ void PictureLayerTilingSet::AddTilingsToMatchScales( float contents_scale = other.tilings_[i]->contents_scale(); if (contents_scale < minimum_contents_scale) continue; - tilings_.push_back(PictureLayerTiling::Create(contents_scale, - layer_bounds_, - client_)); + scoped_ptr<PictureLayerTiling> new_tiling = PictureLayerTiling::Create( + contents_scale, + layer_bounds_, + client_); + // We need to copy the resolution to ensure that the information is not + // lost on this tiling. This is safe, since we know the current set begins + // empty (ie we will not end up with multiple HIGH RES tilings). + new_tiling->set_resolution(other.tilings_[i]->resolution()); + tilings_.push_back(new_tiling.Pass()); } tilings_.sort(LargestToSmallestScaleFunctor()); } |