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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 ~TilingRasterTileIterator(); | 52 ~TilingRasterTileIterator(); |
53 | 53 |
54 operator bool() const { | 54 operator bool() const { |
55 return current_tile_ && TileNeedsRaster(current_tile_); | 55 return current_tile_ && TileNeedsRaster(current_tile_); |
56 } | 56 } |
57 Tile* operator*() { return current_tile_; } | 57 Tile* operator*() { return current_tile_; } |
58 TilePriority::PriorityBin get_type() const { return type_; } | 58 TilePriority::PriorityBin get_type() const { return type_; } |
59 | 59 |
60 TilingRasterTileIterator& operator++(); | 60 TilingRasterTileIterator& operator++(); |
61 | 61 |
| 62 bool HasTilesRequiredForActivation() const; |
| 63 |
62 gfx::Rect TileBounds() const { | 64 gfx::Rect TileBounds() const { |
63 DCHECK(*this); | 65 DCHECK(*this); |
64 if (type_ == TilePriority::NOW) { | 66 if (type_ == TilePriority::NOW) { |
65 return tiling_->tiling_data_.TileBounds(visible_iterator_.index_x(), | 67 return tiling_->tiling_data_.TileBounds(visible_iterator_.index_x(), |
66 visible_iterator_.index_y()); | 68 visible_iterator_.index_y()); |
67 } | 69 } |
68 return tiling_->tiling_data_.TileBounds(spiral_iterator_.index_x(), | 70 return tiling_->tiling_data_.TileBounds(spiral_iterator_.index_x(), |
69 spiral_iterator_.index_y()); | 71 spiral_iterator_.index_y()); |
70 } | 72 } |
71 | 73 |
72 private: | 74 private: |
73 void AdvancePhase(); | 75 void AdvancePhase(); |
74 bool TileNeedsRaster(Tile* tile) const { | 76 bool TileNeedsRaster(Tile* tile) const { |
75 RasterMode mode = tile->DetermineRasterModeForTree(tree_); | 77 RasterMode mode = tile->DetermineRasterModeForTree(tree_); |
76 return tile->NeedsRasterForMode(mode); | 78 return tile->NeedsRasterForMode(mode); |
77 }; | 79 } |
78 | 80 |
79 PictureLayerTiling* tiling_; | 81 PictureLayerTiling* tiling_; |
80 | 82 |
81 TilePriority::PriorityBin type_; | 83 TilePriority::PriorityBin type_; |
82 gfx::Rect visible_rect_in_content_space_; | 84 gfx::Rect visible_rect_in_content_space_; |
83 gfx::Rect skewport_in_content_space_; | 85 gfx::Rect skewport_in_content_space_; |
84 gfx::Rect eventually_rect_in_content_space_; | 86 gfx::Rect eventually_rect_in_content_space_; |
85 gfx::Rect soon_border_rect_in_content_space_; | 87 gfx::Rect soon_border_rect_in_content_space_; |
86 WhichTree tree_; | 88 WhichTree tree_; |
87 | 89 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 311 |
310 private: | 312 private: |
311 DISALLOW_ASSIGN(PictureLayerTiling); | 313 DISALLOW_ASSIGN(PictureLayerTiling); |
312 | 314 |
313 RectExpansionCache expansion_cache_; | 315 RectExpansionCache expansion_cache_; |
314 }; | 316 }; |
315 | 317 |
316 } // namespace cc | 318 } // namespace cc |
317 | 319 |
318 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 320 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |