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

Side by Side Diff: cc/resources/picture_layer_tiling.cc

Issue 690063002: cc: Do not ignore layers without valid priorities during eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase: CreateWith{Pile => RasterSource} Created 6 years, 1 month 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 | « cc/resources/picture_layer_tiling.h ('k') | cc/resources/tile_manager_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/resources/picture_layer_tiling.h" 5 #include "cc/resources/picture_layer_tiling.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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 return; 774 return;
775 } 775 }
776 776
777 twin_tiling->UpdateTilePriority(tile); 777 twin_tiling->UpdateTilePriority(tile);
778 } 778 }
779 779
780 void PictureLayerTiling::UpdateTilePriority(Tile* tile) const { 780 void PictureLayerTiling::UpdateTilePriority(Tile* tile) const {
781 // TODO(vmpstr): This code should return the priority instead of setting it on 781 // TODO(vmpstr): This code should return the priority instead of setting it on
782 // the tile. This should be a part of the change to move tile priority from 782 // the tile. This should be a part of the change to move tile priority from
783 // tiles into iterators. 783 // tiles into iterators.
784 TilePriority::PriorityBin max_tile_priority_bin =
785 client_->GetMaxTilePriorityBin();
784 WhichTree tree = client_->GetTree(); 786 WhichTree tree = client_->GetTree();
785 787
786 DCHECK_EQ(TileAt(tile->tiling_i_index(), tile->tiling_j_index()), tile); 788 DCHECK_EQ(TileAt(tile->tiling_i_index(), tile->tiling_j_index()), tile);
787 gfx::Rect tile_bounds = 789 gfx::Rect tile_bounds =
788 tiling_data_.TileBounds(tile->tiling_i_index(), tile->tiling_j_index()); 790 tiling_data_.TileBounds(tile->tiling_i_index(), tile->tiling_j_index());
789 791
790 if (current_visible_rect_.Intersects(tile_bounds)) { 792 if (max_tile_priority_bin <= TilePriority::NOW &&
793 current_visible_rect_.Intersects(tile_bounds)) {
791 tile->SetPriority(tree, TilePriority(resolution_, TilePriority::NOW, 0)); 794 tile->SetPriority(tree, TilePriority(resolution_, TilePriority::NOW, 0));
792 if (tree == PENDING_TREE) { 795 if (tree == PENDING_TREE) {
793 tile->set_required_for_activation( 796 tile->set_required_for_activation(
794 IsTileRequiredForActivationIfVisible(tile)); 797 IsTileRequiredForActivationIfVisible(tile));
795 } else { 798 } else {
796 tile->set_required_for_draw(IsTileRequiredForDrawIfVisible(tile)); 799 tile->set_required_for_draw(IsTileRequiredForDrawIfVisible(tile));
797 } 800 }
798 tile->set_is_occluded(tree, IsTileOccluded(tile)); 801 tile->set_is_occluded(tree, IsTileOccluded(tile));
799 return; 802 return;
800 } 803 }
801 804
802 if (tree == PENDING_TREE) 805 if (tree == PENDING_TREE)
803 tile->set_required_for_activation(false); 806 tile->set_required_for_activation(false);
804 else 807 else
805 tile->set_required_for_draw(false); 808 tile->set_required_for_draw(false);
806 tile->set_is_occluded(tree, false); 809 tile->set_is_occluded(tree, false);
807 810
808 DCHECK_GT(content_to_screen_scale_, 0.f); 811 DCHECK_GT(content_to_screen_scale_, 0.f);
809 float distance_to_visible = 812 float distance_to_visible =
810 current_visible_rect_.ManhattanInternalDistance(tile_bounds) * 813 current_visible_rect_.ManhattanInternalDistance(tile_bounds) *
811 content_to_screen_scale_; 814 content_to_screen_scale_;
812 815
813 if (current_soon_border_rect_.Intersects(tile_bounds) || 816 if (max_tile_priority_bin <= TilePriority::SOON &&
814 current_skewport_rect_.Intersects(tile_bounds)) { 817 (current_soon_border_rect_.Intersects(tile_bounds) ||
818 current_skewport_rect_.Intersects(tile_bounds))) {
815 tile->SetPriority( 819 tile->SetPriority(
816 tree, 820 tree,
817 TilePriority(resolution_, TilePriority::SOON, distance_to_visible)); 821 TilePriority(resolution_, TilePriority::SOON, distance_to_visible));
818 return; 822 return;
819 } 823 }
820 824
821 tile->SetPriority( 825 tile->SetPriority(
822 tree, 826 tree,
823 TilePriority(resolution_, TilePriority::EVENTUALLY, distance_to_visible)); 827 TilePriority(resolution_, TilePriority::EVENTUALLY, distance_to_visible));
824 } 828 }
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 DCHECK(*this); 1259 DCHECK(*this);
1256 do { 1260 do {
1257 ++current_eviction_tiles_index_; 1261 ++current_eviction_tiles_index_;
1258 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && 1262 } while (current_eviction_tiles_index_ != eviction_tiles_->size() &&
1259 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); 1263 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources());
1260 1264
1261 return *this; 1265 return *this;
1262 } 1266 }
1263 1267
1264 } // namespace cc 1268 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling.h ('k') | cc/resources/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698