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

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 1274693004: cc: Declare high res tilings to not have low res content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: waseverlowres: . Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 void PictureLayerImpl::AddTilingsForRasterScale() { 806 void PictureLayerImpl::AddTilingsForRasterScale() {
807 // Reset all resolution enums on tilings, we'll be setting new values in this 807 // Reset all resolution enums on tilings, we'll be setting new values in this
808 // function. 808 // function.
809 tilings_->MarkAllTilingsNonIdeal(); 809 tilings_->MarkAllTilingsNonIdeal();
810 810
811 PictureLayerTiling* high_res = 811 PictureLayerTiling* high_res =
812 tilings_->FindTilingWithScale(raster_contents_scale_); 812 tilings_->FindTilingWithScale(raster_contents_scale_);
813 if (!high_res) { 813 if (!high_res) {
814 // We always need a high res tiling, so create one if it doesn't exist. 814 // We always need a high res tiling, so create one if it doesn't exist.
815 high_res = AddTiling(raster_contents_scale_); 815 high_res = AddTiling(raster_contents_scale_);
816 } else if (high_res->was_ever_low_resolution()) { 816 } else if (high_res->may_contain_low_resolution_tiles()) {
817 // If the tiling we find here was LOW_RESOLUTION previously, it may not be 817 // If the tiling we find here was LOW_RESOLUTION previously, it may not be
818 // fully rastered, so destroy the old tiles. 818 // fully rastered, so destroy the old tiles.
819 high_res->Reset(); 819 high_res->Reset();
820 // Reset the flag now that we'll make it high res, it will have fully
821 // rastered content.
822 high_res->reset_may_contain_low_resolution_tiles();
820 } 823 }
821 high_res->set_resolution(HIGH_RESOLUTION); 824 high_res->set_resolution(HIGH_RESOLUTION);
822 825
823 // If the low res scale is the same as the high res scale, that tiling 826 // If the low res scale is the same as the high res scale, that tiling
824 // will be treated as high res. 827 // will be treated as high res.
825 if (layer_tree_impl()->create_low_res_tiling() && 828 if (layer_tree_impl()->create_low_res_tiling() &&
826 raster_contents_scale_ != low_res_raster_contents_scale_) { 829 raster_contents_scale_ != low_res_raster_contents_scale_) {
827 PictureLayerTiling* low_res = 830 PictureLayerTiling* low_res =
828 tilings_->FindTilingWithScale(low_res_raster_contents_scale_); 831 tilings_->FindTilingWithScale(low_res_raster_contents_scale_);
829 832
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 1228
1226 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1229 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1227 return !layer_tree_impl()->IsRecycleTree(); 1230 return !layer_tree_impl()->IsRecycleTree();
1228 } 1231 }
1229 1232
1230 bool PictureLayerImpl::HasValidTilePriorities() const { 1233 bool PictureLayerImpl::HasValidTilePriorities() const {
1231 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); 1234 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
1232 } 1235 }
1233 1236
1234 } // namespace cc 1237 } // namespace cc
OLDNEW
« 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