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 #ifndef CC_RESOURCES_TILE_H_ | 5 #ifndef CC_RESOURCES_TILE_H_ |
6 #define CC_RESOURCES_TILE_H_ | 6 #define CC_RESOURCES_TILE_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "cc/base/ref_counted_managed.h" | 9 #include "cc/base/ref_counted_managed.h" |
10 #include "cc/resources/managed_tile_state.h" | 10 #include "cc/resources/managed_tile_state.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // TODO(vmpstr): Move this to the iterators. | 59 // TODO(vmpstr): Move this to the iterators. |
60 void set_is_occluded(WhichTree tree, bool is_occluded) { | 60 void set_is_occluded(WhichTree tree, bool is_occluded) { |
61 is_occluded_[tree] = is_occluded; | 61 is_occluded_[tree] = is_occluded; |
62 } | 62 } |
63 | 63 |
64 bool is_occluded(WhichTree tree) const { return is_occluded_[tree]; } | 64 bool is_occluded(WhichTree tree) const { return is_occluded_[tree]; } |
65 | 65 |
66 void set_shared(bool is_shared) { is_shared_ = is_shared; } | 66 void set_shared(bool is_shared) { is_shared_ = is_shared; } |
67 bool is_shared() const { return is_shared_; } | 67 bool is_shared() const { return is_shared_; } |
68 | 68 |
| 69 bool is_active_and_visible_priority() const { |
| 70 return priority(ACTIVE_TREE).distance_to_visible == 0.f; |
| 71 } |
| 72 |
69 bool is_occluded_for_tree_priority(TreePriority tree_priority) const { | 73 bool is_occluded_for_tree_priority(TreePriority tree_priority) const { |
70 switch (tree_priority) { | 74 switch (tree_priority) { |
71 case SMOOTHNESS_TAKES_PRIORITY: | 75 case SMOOTHNESS_TAKES_PRIORITY: |
72 return is_occluded_[ACTIVE_TREE]; | 76 return is_occluded_[ACTIVE_TREE]; |
73 case NEW_CONTENT_TAKES_PRIORITY: | 77 case NEW_CONTENT_TAKES_PRIORITY: |
74 return is_occluded_[PENDING_TREE]; | 78 return is_occluded_[PENDING_TREE]; |
75 case SAME_PRIORITY_FOR_BOTH_TREES: | 79 case SAME_PRIORITY_FOR_BOTH_TREES: |
76 return is_occluded_[ACTIVE_TREE] && is_occluded_[PENDING_TREE]; | 80 return is_occluded_[ACTIVE_TREE] && is_occluded_[PENDING_TREE]; |
77 default: | 81 default: |
78 NOTREACHED(); | 82 NOTREACHED(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 181 |
178 Id id_; | 182 Id id_; |
179 static Id s_next_id_; | 183 static Id s_next_id_; |
180 | 184 |
181 DISALLOW_COPY_AND_ASSIGN(Tile); | 185 DISALLOW_COPY_AND_ASSIGN(Tile); |
182 }; | 186 }; |
183 | 187 |
184 } // namespace cc | 188 } // namespace cc |
185 | 189 |
186 #endif // CC_RESOURCES_TILE_H_ | 190 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |