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 20 matching lines...) Expand all Loading... |
31 class CC_EXPORT LayerRasterTileIterator { | 31 class CC_EXPORT LayerRasterTileIterator { |
32 public: | 32 public: |
33 LayerRasterTileIterator(); | 33 LayerRasterTileIterator(); |
34 LayerRasterTileIterator(PictureLayerImpl* layer, bool prioritize_low_res); | 34 LayerRasterTileIterator(PictureLayerImpl* layer, bool prioritize_low_res); |
35 ~LayerRasterTileIterator(); | 35 ~LayerRasterTileIterator(); |
36 | 36 |
37 Tile* operator*(); | 37 Tile* operator*(); |
38 LayerRasterTileIterator& operator++(); | 38 LayerRasterTileIterator& operator++(); |
39 operator bool() const; | 39 operator bool() const; |
40 | 40 |
| 41 bool HasTilesRequiredForActivation() const; |
| 42 |
41 private: | 43 private: |
42 enum IteratorType { LOW_RES, HIGH_RES, NUM_ITERATORS }; | 44 enum IteratorType { LOW_RES, HIGH_RES, NUM_ITERATORS }; |
43 | 45 |
44 PictureLayerImpl* layer_; | 46 PictureLayerImpl* layer_; |
45 | 47 |
46 struct IterationStage { | 48 struct IterationStage { |
47 IteratorType iterator_type; | 49 IteratorType iterator_type; |
48 TilePriority::PriorityBin tile_type; | 50 TilePriority::PriorityBin tile_type; |
49 }; | 51 }; |
50 | 52 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 131 |
130 virtual size_t GPUMemoryUsageInBytes() const OVERRIDE; | 132 virtual size_t GPUMemoryUsageInBytes() const OVERRIDE; |
131 | 133 |
132 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; | 134 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; |
133 | 135 |
134 // Functions used by tile manager. | 136 // Functions used by tile manager. |
135 void DidUnregisterLayer(); | 137 void DidUnregisterLayer(); |
136 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } | 138 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } |
137 WhichTree GetTree() const; | 139 WhichTree GetTree() const; |
138 bool IsOnActiveOrPendingTree() const; | 140 bool IsOnActiveOrPendingTree() const; |
| 141 bool LayerRegisteredInTileManager() const { |
| 142 return !layer_needs_to_register_itself_; |
| 143 } |
139 | 144 |
140 protected: | 145 protected: |
141 friend class LayerRasterTileIterator; | 146 friend class LayerRasterTileIterator; |
142 | 147 |
143 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 148 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
144 PictureLayerTiling* AddTiling(float contents_scale); | 149 PictureLayerTiling* AddTiling(float contents_scale); |
145 void RemoveTiling(float contents_scale); | 150 void RemoveTiling(float contents_scale); |
146 void RemoveAllTilings(); | 151 void RemoveAllTilings(); |
147 void SyncFromActiveLayer(const PictureLayerImpl* other); | 152 void SyncFromActiveLayer(const PictureLayerImpl* other); |
148 void ManageTilings(bool animating_transform_to_screen, | 153 void ManageTilings(bool animating_transform_to_screen, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 gfx::Size viewport_size_for_tile_priority_; | 219 gfx::Size viewport_size_for_tile_priority_; |
215 gfx::Transform screen_space_transform_for_tile_priority_; | 220 gfx::Transform screen_space_transform_for_tile_priority_; |
216 | 221 |
217 friend class PictureLayer; | 222 friend class PictureLayer; |
218 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 223 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
219 }; | 224 }; |
220 | 225 |
221 } // namespace cc | 226 } // namespace cc |
222 | 227 |
223 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 228 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |