Chromium Code Reviews| 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; |
| 156 typedef bool (PictureLayerTiling::*TileRequirementCheck)(const Tile*) const; | |
|
danakj
2014/11/04 22:02:58
can you do this with using instead of typedef? the
ernstm
2014/11/04 22:41:14
Done.
| |
| 155 | 157 |
| 156 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 158 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
| 157 PictureLayerTiling* AddTiling(float contents_scale); | 159 PictureLayerTiling* AddTiling(float contents_scale); |
| 158 void RemoveTiling(float contents_scale); | 160 void RemoveTiling(float contents_scale); |
| 159 void RemoveAllTilings(); | 161 void RemoveAllTilings(); |
| 160 void SyncFromActiveLayer(const PictureLayerImpl* other); | 162 void SyncFromActiveLayer(const PictureLayerImpl* other); |
| 161 void AddTilingsForRasterScale(); | 163 void AddTilingsForRasterScale(); |
| 162 void UpdateTilePriorities(const Occlusion& occlusion_in_content_space); | 164 void UpdateTilePriorities(const Occlusion& occlusion_in_content_space); |
| 163 virtual bool ShouldAdjustRasterScale() const; | 165 virtual bool ShouldAdjustRasterScale() const; |
| 164 virtual void RecalculateRasterScales(); | 166 virtual void RecalculateRasterScales(); |
| 165 void CleanUpTilingsOnActiveLayer( | 167 void CleanUpTilingsOnActiveLayer( |
| 166 std::vector<PictureLayerTiling*> used_tilings); | 168 std::vector<PictureLayerTiling*> used_tilings); |
| 167 float MinimumContentsScale() const; | 169 float MinimumContentsScale() const; |
| 168 float SnappedContentsScale(float new_contents_scale); | 170 float SnappedContentsScale(float new_contents_scale); |
| 169 void ResetRasterScale(); | 171 void ResetRasterScale(); |
| 170 gfx::Rect GetViewportForTilePriorityInContentSpace() const; | 172 gfx::Rect GetViewportForTilePriorityInContentSpace() const; |
| 171 PictureLayerImpl* GetRecycledTwinLayer() const; | 173 PictureLayerImpl* GetRecycledTwinLayer() const; |
| 172 void UpdatePile(scoped_refptr<PicturePileImpl> pile); | 174 void UpdatePile(scoped_refptr<PicturePileImpl> pile); |
| 173 | 175 |
| 174 void DoPostCommitInitializationIfNeeded() { | 176 void DoPostCommitInitializationIfNeeded() { |
| 175 if (needs_post_commit_initialization_) | 177 if (needs_post_commit_initialization_) |
| 176 DoPostCommitInitialization(); | 178 DoPostCommitInitialization(); |
| 177 } | 179 } |
| 178 void DoPostCommitInitialization(); | 180 void DoPostCommitInitialization(); |
| 179 | 181 |
| 180 bool CanHaveTilings() const; | 182 bool CanHaveTilings() const; |
| 181 bool CanHaveTilingWithScale(float contents_scale) const; | 183 bool CanHaveTilingWithScale(float contents_scale) const; |
| 182 void SanityCheckTilingState() const; | 184 void SanityCheckTilingState() const; |
| 185 // Checks if all tiles required for a certain action (e.g. activation) are | |
| 186 // ready to draw. is_tile_required_callback gets called on all candidate | |
| 187 // tiles and returns true if the tile is required for the action. | |
| 188 bool AllTilesRequiredAreReadyToDraw( | |
| 189 TileRequirementCheck is_tile_required_callback) const; | |
| 183 | 190 |
| 184 bool ShouldAdjustRasterScaleDuringScaleAnimations() const; | 191 bool ShouldAdjustRasterScaleDuringScaleAnimations() const; |
| 185 | 192 |
| 186 void GetDebugBorderProperties(SkColor* color, float* width) const override; | 193 void GetDebugBorderProperties(SkColor* color, float* width) const override; |
| 187 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const override; | 194 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const override; |
| 188 void AsValueInto(base::debug::TracedValue* dict) const override; | 195 void AsValueInto(base::debug::TracedValue* dict) const override; |
| 189 | 196 |
| 190 virtual void UpdateIdealScales(); | 197 virtual void UpdateIdealScales(); |
| 191 float MaximumTilingContentsScale() const; | 198 float MaximumTilingContentsScale() const; |
| 192 | 199 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 223 // frame that has a valid viewport for prioritizing tiles. | 230 // frame that has a valid viewport for prioritizing tiles. |
| 224 gfx::Rect visible_rect_for_tile_priority_; | 231 gfx::Rect visible_rect_for_tile_priority_; |
| 225 | 232 |
| 226 friend class PictureLayer; | 233 friend class PictureLayer; |
| 227 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 234 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 228 }; | 235 }; |
| 229 | 236 |
| 230 } // namespace cc | 237 } // namespace cc |
| 231 | 238 |
| 232 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 239 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |