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 <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 TilingRasterTileIterator(PictureLayerTiling* tiling, WhichTree tree); | 54 TilingRasterTileIterator(PictureLayerTiling* tiling, WhichTree tree); |
55 ~TilingRasterTileIterator(); | 55 ~TilingRasterTileIterator(); |
56 | 56 |
57 operator bool() const { return !!current_tile_; } | 57 operator bool() const { return !!current_tile_; } |
58 const Tile* operator*() const { return current_tile_; } | 58 const Tile* operator*() const { return current_tile_; } |
59 Tile* operator*() { return current_tile_; } | 59 Tile* operator*() { return current_tile_; } |
60 TilePriority::PriorityBin get_type() const { return type_; } | 60 TilePriority::PriorityBin get_type() const { return type_; } |
61 | 61 |
62 TilingRasterTileIterator& operator++(); | 62 TilingRasterTileIterator& operator++(); |
63 | 63 |
64 gfx::Rect TileBounds() const { | |
65 DCHECK(*this); | |
66 if (type_ == TilePriority::NOW) { | |
67 return tiling_->tiling_data_.TileBounds(visible_iterator_.index_x(), | |
68 visible_iterator_.index_y()); | |
69 } | |
70 return tiling_->tiling_data_.TileBounds(spiral_iterator_.index_x(), | |
71 spiral_iterator_.index_y()); | |
72 } | |
73 | |
74 private: | 64 private: |
75 void AdvancePhase(); | 65 void AdvancePhase(); |
76 bool TileNeedsRaster(Tile* tile) const { | 66 bool TileNeedsRaster(Tile* tile) const { |
77 RasterMode mode = tile->DetermineRasterModeForTree(tree_); | 67 RasterMode mode = tile->DetermineRasterModeForTree(tree_); |
78 return tile->NeedsRasterForMode(mode); | 68 return tile->NeedsRasterForMode(mode); |
79 } | 69 } |
80 | 70 |
81 PictureLayerTiling* tiling_; | 71 PictureLayerTiling* tiling_; |
82 | 72 |
83 TilePriority::PriorityBin type_; | 73 TilePriority::PriorityBin type_; |
84 gfx::Rect visible_rect_in_content_space_; | |
85 gfx::Rect skewport_in_content_space_; | |
86 gfx::Rect eventually_rect_in_content_space_; | |
87 gfx::Rect soon_border_rect_in_content_space_; | |
88 WhichTree tree_; | 74 WhichTree tree_; |
89 | 75 |
90 Tile* current_tile_; | 76 Tile* current_tile_; |
91 TilingData::Iterator visible_iterator_; | 77 TilingData::Iterator visible_iterator_; |
92 TilingData::SpiralDifferenceIterator spiral_iterator_; | 78 TilingData::SpiralDifferenceIterator spiral_iterator_; |
93 bool skewport_processed_; | 79 bool skewport_processed_; |
94 }; | 80 }; |
95 | 81 |
96 class CC_EXPORT TilingEvictionTileIterator { | 82 class CC_EXPORT TilingEvictionTileIterator { |
97 public: | 83 public: |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // State saved for computing velocities based upon finite differences. | 285 // State saved for computing velocities based upon finite differences. |
300 double last_impl_frame_time_in_seconds_; | 286 double last_impl_frame_time_in_seconds_; |
301 gfx::Rect last_visible_rect_in_content_space_; | 287 gfx::Rect last_visible_rect_in_content_space_; |
302 | 288 |
303 // Iteration rects in content space | 289 // Iteration rects in content space |
304 gfx::Rect current_visible_rect_; | 290 gfx::Rect current_visible_rect_; |
305 gfx::Rect current_skewport_rect_; | 291 gfx::Rect current_skewport_rect_; |
306 gfx::Rect current_soon_border_rect_; | 292 gfx::Rect current_soon_border_rect_; |
307 gfx::Rect current_eventually_rect_; | 293 gfx::Rect current_eventually_rect_; |
308 | 294 |
| 295 bool has_visible_rect_tiles_; |
| 296 bool has_skewport_rect_tiles_; |
| 297 bool has_soon_border_rect_tiles_; |
| 298 bool has_eventually_rect_tiles_; |
| 299 |
309 std::vector<Tile*> eviction_tiles_cache_; | 300 std::vector<Tile*> eviction_tiles_cache_; |
310 bool eviction_tiles_cache_valid_; | 301 bool eviction_tiles_cache_valid_; |
311 TreePriority eviction_cache_tree_priority_; | 302 TreePriority eviction_cache_tree_priority_; |
312 | 303 |
313 private: | 304 private: |
314 DISALLOW_ASSIGN(PictureLayerTiling); | 305 DISALLOW_ASSIGN(PictureLayerTiling); |
315 | 306 |
316 RectExpansionCache expansion_cache_; | 307 RectExpansionCache expansion_cache_; |
317 }; | 308 }; |
318 | 309 |
319 } // namespace cc | 310 } // namespace cc |
320 | 311 |
321 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 312 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |