OLD | NEW |
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 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 ~TileEvictionOrder() {} | 26 ~TileEvictionOrder() {} |
27 | 27 |
28 bool operator()(const Tile* a, const Tile* b) { | 28 bool operator()(const Tile* a, const Tile* b) { |
29 const TilePriority& a_priority = a->priority(tree_); | 29 const TilePriority& a_priority = a->priority(tree_); |
30 const TilePriority& b_priority = b->priority(tree_); | 30 const TilePriority& b_priority = b->priority(tree_); |
31 | 31 |
32 if (a_priority.priority_bin == b_priority.priority_bin && | 32 if (a_priority.priority_bin == b_priority.priority_bin && |
33 a->required_for_activation() != b->required_for_activation()) { | 33 a->required_for_activation() != b->required_for_activation()) { |
34 return b->required_for_activation(); | 34 return b->required_for_activation(); |
35 } | 35 } |
36 return a_priority.IsHigherPriorityThan(b_priority); | 36 return b_priority.IsHigherPriorityThan(a_priority); |
37 } | 37 } |
38 | 38 |
39 private: | 39 private: |
40 WhichTree tree_; | 40 WhichTree tree_; |
41 }; | 41 }; |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 scoped_ptr<PictureLayerTiling> PictureLayerTiling::Create( | 44 scoped_ptr<PictureLayerTiling> PictureLayerTiling::Create( |
45 float contents_scale, | 45 float contents_scale, |
46 const gfx::Size& layer_bounds, | 46 const gfx::Size& layer_bounds, |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 tiling_->UpdateEvictionCacheIfNeeded(tree_); | 925 tiling_->UpdateEvictionCacheIfNeeded(tree_); |
926 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); | 926 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); |
927 is_valid_ = true; | 927 is_valid_ = true; |
928 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && | 928 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && |
929 !(*tile_iterator_)->HasResources()) { | 929 !(*tile_iterator_)->HasResources()) { |
930 ++(*this); | 930 ++(*this); |
931 } | 931 } |
932 } | 932 } |
933 | 933 |
934 } // namespace cc | 934 } // namespace cc |
OLD | NEW |