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 "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 case NEW_CONTENT_TAKES_PRIORITY: | 74 case NEW_CONTENT_TAKES_PRIORITY: |
75 return is_occluded_[PENDING_TREE]; | 75 return is_occluded_[PENDING_TREE]; |
76 case SAME_PRIORITY_FOR_BOTH_TREES: | 76 case SAME_PRIORITY_FOR_BOTH_TREES: |
77 return is_occluded_[ACTIVE_TREE] && is_occluded_[PENDING_TREE]; | 77 return is_occluded_[ACTIVE_TREE] && is_occluded_[PENDING_TREE]; |
78 default: | 78 default: |
79 NOTREACHED(); | 79 NOTREACHED(); |
80 return false; | 80 return false; |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 void MarkRequiredForActivation(); | 84 bool required_for_activation() const { return required_for_activation_; } |
85 | 85 void set_required_for_activation(bool is_required) { |
86 bool required_for_activation() const { | 86 required_for_activation_ = is_required; |
87 return priority_[PENDING_TREE].required_for_activation; | |
88 } | 87 } |
89 | 88 |
90 bool use_picture_analysis() const { | 89 bool use_picture_analysis() const { |
91 return !!(flags_ & USE_PICTURE_ANALYSIS); | 90 return !!(flags_ & USE_PICTURE_ANALYSIS); |
92 } | 91 } |
93 | 92 |
94 bool NeedsRasterForMode(RasterMode mode) const { | 93 bool NeedsRasterForMode(RasterMode mode) const { |
95 return !managed_state_.tile_versions[mode].IsReadyToDraw(); | 94 return !managed_state_.tile_versions[mode].IsReadyToDraw(); |
96 } | 95 } |
97 | 96 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 picture_pile_ = pile; | 135 picture_pile_ = pile; |
137 } | 136 } |
138 | 137 |
139 size_t GPUMemoryUsageInBytes() const; | 138 size_t GPUMemoryUsageInBytes() const; |
140 | 139 |
141 gfx::Size size() const { return tile_size_.size(); } | 140 gfx::Size size() const { return tile_size_.size(); } |
142 | 141 |
143 RasterMode DetermineRasterModeForTree(WhichTree tree) const; | 142 RasterMode DetermineRasterModeForTree(WhichTree tree) const; |
144 RasterMode DetermineOverallRasterMode() const; | 143 RasterMode DetermineOverallRasterMode() const; |
145 | 144 |
| 145 void set_tiling_index(int i, int j) { |
| 146 tiling_i_index_ = i; |
| 147 tiling_j_index_ = j; |
| 148 } |
| 149 int tiling_i_index() const { return tiling_i_index_; } |
| 150 int tiling_j_index() const { return tiling_j_index_; } |
| 151 |
146 // Functionality used in tests. | 152 // Functionality used in tests. |
147 RasterMode GetRasterModeForTesting() const { | 153 RasterMode GetRasterModeForTesting() const { |
148 return managed_state().raster_mode; | 154 return managed_state().raster_mode; |
149 } | 155 } |
150 ManagedTileState::TileVersion& GetTileVersionForTesting(RasterMode mode) { | 156 ManagedTileState::TileVersion& GetTileVersionForTesting(RasterMode mode) { |
151 return managed_state_.tile_versions[mode]; | 157 return managed_state_.tile_versions[mode]; |
152 } | 158 } |
153 | 159 |
154 private: | 160 private: |
155 friend class TileManager; | 161 friend class TileManager; |
(...skipping 26 matching lines...) Expand all Loading... |
182 gfx::Rect content_rect_; | 188 gfx::Rect content_rect_; |
183 float contents_scale_; | 189 float contents_scale_; |
184 gfx::Rect opaque_rect_; | 190 gfx::Rect opaque_rect_; |
185 bool is_occluded_[NUM_TREES]; | 191 bool is_occluded_[NUM_TREES]; |
186 | 192 |
187 TilePriority priority_[NUM_TREES]; | 193 TilePriority priority_[NUM_TREES]; |
188 ManagedTileState managed_state_; | 194 ManagedTileState managed_state_; |
189 int layer_id_; | 195 int layer_id_; |
190 int source_frame_number_; | 196 int source_frame_number_; |
191 int flags_; | 197 int flags_; |
| 198 int tiling_i_index_; |
| 199 int tiling_j_index_; |
| 200 bool required_for_activation_; |
192 | 201 |
193 Id id_; | 202 Id id_; |
194 static Id s_next_id_; | 203 static Id s_next_id_; |
195 | 204 |
196 DISALLOW_COPY_AND_ASSIGN(Tile); | 205 DISALLOW_COPY_AND_ASSIGN(Tile); |
197 }; | 206 }; |
198 | 207 |
199 } // namespace cc | 208 } // namespace cc |
200 | 209 |
201 #endif // CC_RESOURCES_TILE_H_ | 210 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |