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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 return TilePriority::SOON; | 66 return TilePriority::SOON; |
67 case EVENTUALLY_RECT: | 67 case EVENTUALLY_RECT: |
68 return TilePriority::EVENTUALLY; | 68 return TilePriority::EVENTUALLY; |
69 } | 69 } |
70 NOTREACHED(); | 70 NOTREACHED(); |
71 return TilePriority::EVENTUALLY; | 71 return TilePriority::EVENTUALLY; |
72 } | 72 } |
73 | 73 |
74 TilingRasterTileIterator& operator++(); | 74 TilingRasterTileIterator& operator++(); |
75 | 75 |
76 gfx::Rect TileBounds() const { | |
77 DCHECK(*this); | |
78 if (phase_ == VISIBLE_RECT) { | |
79 return tiling_->tiling_data_.TileBounds(visible_iterator_.index_x(), | |
80 visible_iterator_.index_y()); | |
81 } | |
82 return tiling_->tiling_data_.TileBounds(spiral_iterator_.index_x(), | |
83 spiral_iterator_.index_y()); | |
84 } | |
85 | |
86 private: | 76 private: |
87 enum Phase { | 77 enum Phase { |
88 VISIBLE_RECT, | 78 VISIBLE_RECT, |
89 SKEWPORT_RECT, | 79 SKEWPORT_RECT, |
90 SOON_BORDER_RECT, | 80 SOON_BORDER_RECT, |
91 EVENTUALLY_RECT | 81 EVENTUALLY_RECT |
92 }; | 82 }; |
93 | 83 |
94 void AdvancePhase(); | 84 void AdvancePhase(); |
95 bool TileNeedsRaster(Tile* tile) const { | 85 bool TileNeedsRaster(Tile* tile) const { |
96 RasterMode mode = tile->DetermineRasterModeForTree(tree_); | 86 RasterMode mode = tile->DetermineRasterModeForTree(tree_); |
97 return tile->NeedsRasterForMode(mode); | 87 return tile->NeedsRasterForMode(mode); |
98 } | 88 } |
99 | 89 |
100 PictureLayerTiling* tiling_; | 90 PictureLayerTiling* tiling_; |
101 | 91 |
102 Phase phase_; | 92 Phase phase_; |
103 gfx::Rect visible_rect_in_content_space_; | |
104 gfx::Rect skewport_in_content_space_; | |
105 gfx::Rect eventually_rect_in_content_space_; | |
106 gfx::Rect soon_border_rect_in_content_space_; | |
107 WhichTree tree_; | 93 WhichTree tree_; |
108 | 94 |
109 Tile* current_tile_; | 95 Tile* current_tile_; |
110 TilingData::Iterator visible_iterator_; | 96 TilingData::Iterator visible_iterator_; |
111 TilingData::SpiralDifferenceIterator spiral_iterator_; | 97 TilingData::SpiralDifferenceIterator spiral_iterator_; |
112 }; | 98 }; |
113 | 99 |
114 class CC_EXPORT TilingEvictionTileIterator { | 100 class CC_EXPORT TilingEvictionTileIterator { |
115 public: | 101 public: |
116 TilingEvictionTileIterator(); | 102 TilingEvictionTileIterator(); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // State saved for computing velocities based upon finite differences. | 303 // State saved for computing velocities based upon finite differences. |
318 double last_impl_frame_time_in_seconds_; | 304 double last_impl_frame_time_in_seconds_; |
319 gfx::Rect last_visible_rect_in_content_space_; | 305 gfx::Rect last_visible_rect_in_content_space_; |
320 | 306 |
321 // Iteration rects in content space | 307 // Iteration rects in content space |
322 gfx::Rect current_visible_rect_; | 308 gfx::Rect current_visible_rect_; |
323 gfx::Rect current_skewport_rect_; | 309 gfx::Rect current_skewport_rect_; |
324 gfx::Rect current_soon_border_rect_; | 310 gfx::Rect current_soon_border_rect_; |
325 gfx::Rect current_eventually_rect_; | 311 gfx::Rect current_eventually_rect_; |
326 | 312 |
| 313 bool has_visible_rect_tiles_; |
| 314 bool has_skewport_rect_tiles_; |
| 315 bool has_soon_border_rect_tiles_; |
| 316 bool has_eventually_rect_tiles_; |
| 317 |
327 std::vector<Tile*> eviction_tiles_cache_; | 318 std::vector<Tile*> eviction_tiles_cache_; |
328 bool eviction_tiles_cache_valid_; | 319 bool eviction_tiles_cache_valid_; |
329 TreePriority eviction_cache_tree_priority_; | 320 TreePriority eviction_cache_tree_priority_; |
330 | 321 |
331 private: | 322 private: |
332 DISALLOW_ASSIGN(PictureLayerTiling); | 323 DISALLOW_ASSIGN(PictureLayerTiling); |
333 | 324 |
334 RectExpansionCache expansion_cache_; | 325 RectExpansionCache expansion_cache_; |
335 }; | 326 }; |
336 | 327 |
337 } // namespace cc | 328 } // namespace cc |
338 | 329 |
339 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 330 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |