Index: cc/resources/tile.h |
diff --git a/cc/resources/tile.h b/cc/resources/tile.h |
index b6d87b0c5d042fb20e066624f68d89d15ff7d3fb..9aeabfa190ae9b85b7ab1f6f1e595a361d9d9c62 100644 |
--- a/cc/resources/tile.h |
+++ b/cc/resources/tile.h |
@@ -48,9 +48,10 @@ class CC_EXPORT Tile : public RefCountedManaged<Tile> { |
return priority_[PENDING_TREE]; |
case SAME_PRIORITY_FOR_BOTH_TREES: |
return combined_priority(); |
+ default: |
+ NOTREACHED(); |
+ return TilePriority(); |
} |
- NOTREACHED(); |
- return TilePriority(); |
} |
TilePriority combined_priority() const { |
@@ -60,6 +61,26 @@ class CC_EXPORT Tile : public RefCountedManaged<Tile> { |
void SetPriority(WhichTree tree, const TilePriority& priority); |
+ void set_is_occluded(WhichTree tree, bool is_occluded) { |
+ is_occluded_[tree] = is_occluded; |
+ } |
+ |
+ bool is_occluded(WhichTree tree) const { return is_occluded_[tree]; } |
+ |
+ bool is_occluded_for_tree_priority(TreePriority tree_priority) const { |
+ switch (tree_priority) { |
+ case SMOOTHNESS_TAKES_PRIORITY: |
+ return is_occluded_[ACTIVE_TREE]; |
+ case NEW_CONTENT_TAKES_PRIORITY: |
+ return is_occluded_[PENDING_TREE]; |
+ case SAME_PRIORITY_FOR_BOTH_TREES: |
+ return is_occluded_[ACTIVE_TREE] && is_occluded_[PENDING_TREE]; |
+ default: |
+ NOTREACHED(); |
+ return false; |
+ } |
+ } |
+ |
void MarkRequiredForActivation(); |
bool required_for_activation() const { |
@@ -130,12 +151,6 @@ class CC_EXPORT Tile : public RefCountedManaged<Tile> { |
return managed_state_.tile_versions[mode]; |
} |
- void set_is_occluded(WhichTree tree, bool is_occluded) { |
- is_occluded_[tree] = is_occluded; |
- } |
- |
- bool is_occluded(WhichTree tree) const { return is_occluded_[tree]; } |
- |
private: |
friend class TileManager; |
friend class PrioritizedTileSet; |