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/raster_source.h" | 10 #include "cc/resources/raster_source.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // TODO(vmpstr): Move this to the iterators. | 61 // TODO(vmpstr): Move this to the iterators. |
62 void set_is_occluded(WhichTree tree, bool is_occluded) { | 62 void set_is_occluded(WhichTree tree, bool is_occluded) { |
63 is_occluded_[tree] = is_occluded; | 63 is_occluded_[tree] = is_occluded; |
64 } | 64 } |
65 | 65 |
66 bool is_occluded(WhichTree tree) const { return is_occluded_[tree]; } | 66 bool is_occluded(WhichTree tree) const { return is_occluded_[tree]; } |
67 | 67 |
68 void set_shared(bool is_shared) { is_shared_ = is_shared; } | 68 void set_shared(bool is_shared) { is_shared_ = is_shared; } |
69 bool is_shared() const { return is_shared_; } | 69 bool is_shared() const { return is_shared_; } |
70 | 70 |
71 bool is_occluded_for_tree_priority(TreePriority tree_priority) const { | 71 bool is_occluded_combined() const { |
72 switch (tree_priority) { | 72 return is_occluded_[ACTIVE_TREE] && is_occluded_[PENDING_TREE]; |
73 case SMOOTHNESS_TAKES_PRIORITY: | |
74 return is_occluded_[ACTIVE_TREE]; | |
75 case NEW_CONTENT_TAKES_PRIORITY: | |
76 return is_occluded_[PENDING_TREE]; | |
77 case SAME_PRIORITY_FOR_BOTH_TREES: | |
78 return is_occluded_[ACTIVE_TREE] && is_occluded_[PENDING_TREE]; | |
79 default: | |
80 NOTREACHED(); | |
81 return false; | |
82 } | |
83 } | 73 } |
84 | 74 |
85 // TODO(vmpstr): Move this to the iterators. | 75 // TODO(vmpstr): Move this to the iterators. |
86 bool required_for_activation() const { return required_for_activation_; } | 76 bool required_for_activation() const { return required_for_activation_; } |
87 void set_required_for_activation(bool is_required) { | 77 void set_required_for_activation(bool is_required) { |
88 required_for_activation_ = is_required; | 78 required_for_activation_ = is_required; |
89 } | 79 } |
90 bool required_for_draw() const { return required_for_draw_; } | 80 bool required_for_draw() const { return required_for_draw_; } |
91 void set_required_for_draw(bool is_required) { | 81 void set_required_for_draw(bool is_required) { |
92 required_for_draw_ = is_required; | 82 required_for_draw_ = is_required; |
93 } | 83 } |
94 | 84 |
95 bool use_picture_analysis() const { | 85 bool use_picture_analysis() const { |
96 return !!(flags_ & USE_PICTURE_ANALYSIS); | 86 return !!(flags_ & USE_PICTURE_ANALYSIS); |
97 } | 87 } |
98 | 88 |
99 bool HasResource() const { return draw_info_.has_resource(); } | 89 bool HasResource() const { return draw_info_.has_resource(); } |
100 bool NeedsRaster() const { | 90 bool NeedsRaster() const { |
101 return draw_info_.mode() == TileDrawInfo::PICTURE_PILE_MODE || | 91 return draw_info_.mode() == TileDrawInfo::PICTURE_PILE_MODE || |
102 !draw_info_.IsReadyToDraw(); | 92 !draw_info_.IsReadyToDraw(); |
103 } | 93 } |
104 | 94 |
105 void AsValueInto(base::debug::TracedValue* dict) const; | 95 void AsValueInto(base::trace_event::TracedValue* dict) const; |
106 | 96 |
107 inline bool IsReadyToDraw() const { return draw_info_.IsReadyToDraw(); } | 97 inline bool IsReadyToDraw() const { return draw_info_.IsReadyToDraw(); } |
108 | 98 |
109 const TileDrawInfo& draw_info() const { return draw_info_; } | 99 const TileDrawInfo& draw_info() const { return draw_info_; } |
110 | 100 |
111 TileDrawInfo& draw_info() { return draw_info_; } | 101 TileDrawInfo& draw_info() { return draw_info_; } |
112 | 102 |
113 float contents_scale() const { return contents_scale_; } | 103 float contents_scale() const { return contents_scale_; } |
114 gfx::Rect content_rect() const { return content_rect_; } | 104 gfx::Rect content_rect() const { return content_rect_; } |
115 | 105 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 unsigned scheduled_priority_; | 170 unsigned scheduled_priority_; |
181 | 171 |
182 scoped_refptr<RasterTask> raster_task_; | 172 scoped_refptr<RasterTask> raster_task_; |
183 | 173 |
184 DISALLOW_COPY_AND_ASSIGN(Tile); | 174 DISALLOW_COPY_AND_ASSIGN(Tile); |
185 }; | 175 }; |
186 | 176 |
187 } // namespace cc | 177 } // namespace cc |
188 | 178 |
189 #endif // CC_RESOURCES_TILE_H_ | 179 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |