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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 size_t GPUMemoryUsageInBytes() const override; | 142 size_t GPUMemoryUsageInBytes() const override; |
143 | 143 |
144 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; | 144 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
145 | 145 |
146 // Functions used by tile manager. | 146 // Functions used by tile manager. |
147 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; | 147 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; |
148 bool IsOnActiveOrPendingTree() const; | 148 bool IsOnActiveOrPendingTree() const; |
149 // Virtual for testing. | 149 // Virtual for testing. |
150 virtual bool HasValidTilePriorities() const; | 150 virtual bool HasValidTilePriorities() const; |
151 bool AllTilesRequiredForActivationAreReadyToDraw() const; | 151 bool AllTilesRequiredForActivationAreReadyToDraw() const; |
| 152 bool AllTilesRequiredForDrawAreReadyToDraw() const; |
152 | 153 |
153 protected: | 154 protected: |
154 friend class LayerRasterTileIterator; | 155 friend class LayerRasterTileIterator; |
155 | 156 |
156 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 157 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
157 PictureLayerTiling* AddTiling(float contents_scale); | 158 PictureLayerTiling* AddTiling(float contents_scale); |
158 void RemoveTiling(float contents_scale); | 159 void RemoveTiling(float contents_scale); |
159 void RemoveAllTilings(); | 160 void RemoveAllTilings(); |
160 void SyncFromActiveLayer(const PictureLayerImpl* other); | 161 void SyncFromActiveLayer(const PictureLayerImpl* other); |
161 void AddTilingsForRasterScale(); | 162 void AddTilingsForRasterScale(); |
(...skipping 11 matching lines...) Expand all Loading... |
173 | 174 |
174 void DoPostCommitInitializationIfNeeded() { | 175 void DoPostCommitInitializationIfNeeded() { |
175 if (needs_post_commit_initialization_) | 176 if (needs_post_commit_initialization_) |
176 DoPostCommitInitialization(); | 177 DoPostCommitInitialization(); |
177 } | 178 } |
178 void DoPostCommitInitialization(); | 179 void DoPostCommitInitialization(); |
179 | 180 |
180 bool CanHaveTilings() const; | 181 bool CanHaveTilings() const; |
181 bool CanHaveTilingWithScale(float contents_scale) const; | 182 bool CanHaveTilingWithScale(float contents_scale) const; |
182 void SanityCheckTilingState() const; | 183 void SanityCheckTilingState() const; |
| 184 // Checks if all tiles required for a certain action (e.g. activation) are |
| 185 // ready to draw. is_tile_required_callback gets called on all candidate |
| 186 // tiles and returns true if the tile is required for the action. |
| 187 template <typename F> |
| 188 bool AllTilesRequiredAreReadyToDraw(const F& is_tile_required_callback) const; |
183 | 189 |
184 bool ShouldAdjustRasterScaleDuringScaleAnimations() const; | 190 bool ShouldAdjustRasterScaleDuringScaleAnimations() const; |
185 | 191 |
186 void GetDebugBorderProperties(SkColor* color, float* width) const override; | 192 void GetDebugBorderProperties(SkColor* color, float* width) const override; |
187 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const override; | 193 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const override; |
188 void AsValueInto(base::debug::TracedValue* dict) const override; | 194 void AsValueInto(base::debug::TracedValue* dict) const override; |
189 | 195 |
190 virtual void UpdateIdealScales(); | 196 virtual void UpdateIdealScales(); |
191 float MaximumTilingContentsScale() const; | 197 float MaximumTilingContentsScale() const; |
192 | 198 |
(...skipping 30 matching lines...) Expand all Loading... |
223 // frame that has a valid viewport for prioritizing tiles. | 229 // frame that has a valid viewport for prioritizing tiles. |
224 gfx::Rect visible_rect_for_tile_priority_; | 230 gfx::Rect visible_rect_for_tile_priority_; |
225 | 231 |
226 friend class PictureLayer; | 232 friend class PictureLayer; |
227 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 233 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
228 }; | 234 }; |
229 | 235 |
230 } // namespace cc | 236 } // namespace cc |
231 | 237 |
232 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 238 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |