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_PICTURE_LAYER_TILING_H_ | 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 const gfx::Rect& bounding_rect, | 205 const gfx::Rect& bounding_rect, |
206 RectExpansionCache* cache); | 206 RectExpansionCache* cache); |
207 | 207 |
208 protected: | 208 protected: |
209 friend class CoverageIterator; | 209 friend class CoverageIterator; |
210 friend class PrioritizedTile; | 210 friend class PrioritizedTile; |
211 friend class TilingSetRasterQueueAll; | 211 friend class TilingSetRasterQueueAll; |
212 friend class TilingSetRasterQueueRequired; | 212 friend class TilingSetRasterQueueRequired; |
213 friend class TilingSetEvictionQueue; | 213 friend class TilingSetEvictionQueue; |
214 | 214 |
| 215 // PENDING VISIBLE RECT refers to the visible rect that will become current |
| 216 // upon activation (ie, the pending tree's visible rect). Tiles in this |
| 217 // region that are not part of the current visible rect are all handled |
| 218 // here. Note that when processing a pending tree, this rect is the same as |
| 219 // the visible rect so no tiles are processed in this case. |
| 220 enum PriorityRectType { |
| 221 VISIBLE_RECT, |
| 222 PENDING_VISIBLE_RECT, |
| 223 SKEWPORT_RECT, |
| 224 SOON_BORDER_RECT, |
| 225 EVENTUALLY_RECT |
| 226 }; |
| 227 |
215 using TileMapKey = std::pair<int, int>; | 228 using TileMapKey = std::pair<int, int>; |
216 using TileMap = base::ScopedPtrHashMap<TileMapKey, ScopedTilePtr>; | 229 using TileMap = base::ScopedPtrHashMap<TileMapKey, ScopedTilePtr>; |
217 | 230 |
218 struct FrameVisibleRect { | 231 struct FrameVisibleRect { |
219 gfx::Rect visible_rect_in_content_space; | 232 gfx::Rect visible_rect_in_content_space; |
220 double frame_time_in_seconds = 0.0; | 233 double frame_time_in_seconds = 0.0; |
221 }; | 234 }; |
222 | 235 |
223 PictureLayerTiling(WhichTree tree, | 236 PictureLayerTiling(WhichTree tree, |
224 float contents_scale, | 237 float contents_scale, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 visible_rect_history_[0].visible_rect_in_content_space = | 278 visible_rect_history_[0].visible_rect_in_content_space = |
266 visible_rect_in_content_space; | 279 visible_rect_in_content_space; |
267 // If we don't have a second history item, set it to the most recent one. | 280 // If we don't have a second history item, set it to the most recent one. |
268 if (visible_rect_history_[1].frame_time_in_seconds == 0.0) | 281 if (visible_rect_history_[1].frame_time_in_seconds == 0.0) |
269 visible_rect_history_[1] = visible_rect_history_[0]; | 282 visible_rect_history_[1] = visible_rect_history_[0]; |
270 } | 283 } |
271 bool IsTileOccludedOnCurrentTree(const Tile* tile) const; | 284 bool IsTileOccludedOnCurrentTree(const Tile* tile) const; |
272 bool ShouldCreateTileAt(int i, int j) const; | 285 bool ShouldCreateTileAt(int i, int j) const; |
273 bool IsTileOccluded(const Tile* tile) const; | 286 bool IsTileOccluded(const Tile* tile) const; |
274 void UpdateRequiredStatesOnTile(Tile* tile) const; | 287 void UpdateRequiredStatesOnTile(Tile* tile) const; |
275 PrioritizedTile MakePrioritizedTile(Tile* tile) const; | 288 PrioritizedTile MakePrioritizedTile( |
276 TilePriority ComputePriorityForTile(const Tile* tile) const; | 289 Tile* tile, |
| 290 PriorityRectType priority_rect_type) const; |
| 291 TilePriority ComputePriorityForTile( |
| 292 const Tile* tile, |
| 293 PriorityRectType priority_rect_type) const; |
| 294 PriorityRectType ComputePriorityRectTypeForTile(const Tile* tile) const; |
277 bool has_visible_rect_tiles() const { return has_visible_rect_tiles_; } | 295 bool has_visible_rect_tiles() const { return has_visible_rect_tiles_; } |
278 bool has_skewport_rect_tiles() const { return has_skewport_rect_tiles_; } | 296 bool has_skewport_rect_tiles() const { return has_skewport_rect_tiles_; } |
279 bool has_soon_border_rect_tiles() const { | 297 bool has_soon_border_rect_tiles() const { |
280 return has_soon_border_rect_tiles_; | 298 return has_soon_border_rect_tiles_; |
281 } | 299 } |
282 bool has_eventually_rect_tiles() const { return has_eventually_rect_tiles_; } | 300 bool has_eventually_rect_tiles() const { return has_eventually_rect_tiles_; } |
283 | 301 |
284 const gfx::Rect& current_visible_rect() const { | 302 const gfx::Rect& current_visible_rect() const { |
285 return current_visible_rect_; | 303 return current_visible_rect_; |
286 } | 304 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 362 |
345 private: | 363 private: |
346 DISALLOW_ASSIGN(PictureLayerTiling); | 364 DISALLOW_ASSIGN(PictureLayerTiling); |
347 | 365 |
348 RectExpansionCache expansion_cache_; | 366 RectExpansionCache expansion_cache_; |
349 }; | 367 }; |
350 | 368 |
351 } // namespace cc | 369 } // namespace cc |
352 | 370 |
353 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 371 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |