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_LAYERS_PICTURE_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 : public LayerImpl, | 27 : public LayerImpl, |
28 NON_EXPORTED_BASE(public PictureLayerTilingClient) { | 28 NON_EXPORTED_BASE(public PictureLayerTilingClient) { |
29 public: | 29 public: |
30 class CC_EXPORT LayerRasterTileIterator { | 30 class CC_EXPORT LayerRasterTileIterator { |
31 public: | 31 public: |
32 LayerRasterTileIterator(); | 32 LayerRasterTileIterator(); |
33 LayerRasterTileIterator(PictureLayerImpl* layer, bool prioritize_low_res); | 33 LayerRasterTileIterator(PictureLayerImpl* layer, bool prioritize_low_res); |
34 ~LayerRasterTileIterator(); | 34 ~LayerRasterTileIterator(); |
35 | 35 |
36 Tile* operator*(); | 36 Tile* operator*(); |
| 37 const Tile* operator*() const; |
37 LayerRasterTileIterator& operator++(); | 38 LayerRasterTileIterator& operator++(); |
38 operator bool() const; | 39 operator bool() const; |
39 | 40 |
40 private: | 41 private: |
41 enum IteratorType { LOW_RES, HIGH_RES, NUM_ITERATORS }; | 42 enum IteratorType { LOW_RES, HIGH_RES, NUM_ITERATORS }; |
42 | 43 |
43 PictureLayerImpl* layer_; | 44 PictureLayerImpl* layer_; |
44 | 45 |
45 struct IterationStage { | 46 struct IterationStage { |
46 IteratorType iterator_type; | 47 IteratorType iterator_type; |
47 TilePriority::PriorityBin tile_type; | 48 TilePriority::PriorityBin tile_type; |
48 }; | 49 }; |
49 | 50 |
50 int current_stage_; | 51 int current_stage_; |
51 | 52 |
52 // One low res stage, and three high res stages. | 53 // One low res stage, and three high res stages. |
53 IterationStage stages_[4]; | 54 IterationStage stages_[4]; |
54 PictureLayerTiling::TilingRasterTileIterator iterators_[NUM_ITERATORS]; | 55 PictureLayerTiling::TilingRasterTileIterator iterators_[NUM_ITERATORS]; |
55 }; | 56 }; |
56 | 57 |
57 class CC_EXPORT LayerEvictionTileIterator { | 58 class CC_EXPORT LayerEvictionTileIterator { |
58 public: | 59 public: |
59 LayerEvictionTileIterator(); | 60 LayerEvictionTileIterator(); |
60 LayerEvictionTileIterator(PictureLayerImpl* layer, | 61 LayerEvictionTileIterator(PictureLayerImpl* layer, |
61 TreePriority tree_priority); | 62 TreePriority tree_priority); |
62 ~LayerEvictionTileIterator(); | 63 ~LayerEvictionTileIterator(); |
63 | 64 |
64 Tile* operator*(); | 65 Tile* operator*(); |
| 66 const Tile* operator*() const; |
65 LayerEvictionTileIterator& operator++(); | 67 LayerEvictionTileIterator& operator++(); |
66 operator bool() const; | 68 operator bool() const; |
67 | 69 |
68 private: | 70 private: |
69 void AdvanceToNextIterator(); | 71 void AdvanceToNextIterator(); |
70 bool IsCorrectType( | 72 bool IsCorrectType( |
71 PictureLayerTiling::TilingEvictionTileIterator* it) const; | 73 PictureLayerTiling::TilingEvictionTileIterator* it) const; |
72 | 74 |
73 std::vector<PictureLayerTiling::TilingEvictionTileIterator> iterators_; | 75 std::vector<PictureLayerTiling::TilingEvictionTileIterator> iterators_; |
74 size_t iterator_index_; | 76 size_t iterator_index_; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 gfx::Size viewport_size_for_tile_priority_; | 208 gfx::Size viewport_size_for_tile_priority_; |
207 gfx::Transform screen_space_transform_for_tile_priority_; | 209 gfx::Transform screen_space_transform_for_tile_priority_; |
208 | 210 |
209 friend class PictureLayer; | 211 friend class PictureLayer; |
210 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 212 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
211 }; | 213 }; |
212 | 214 |
213 } // namespace cc | 215 } // namespace cc |
214 | 216 |
215 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 217 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |