| 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 28 matching lines...) Expand all Loading... |
| 39 PictureLayerImpl* pending; | 39 PictureLayerImpl* pending; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, | 42 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, |
| 43 int id, | 43 int id, |
| 44 bool is_mask) { | 44 bool is_mask) { |
| 45 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id, is_mask)); | 45 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id, is_mask)); |
| 46 } | 46 } |
| 47 ~PictureLayerImpl() override; | 47 ~PictureLayerImpl() override; |
| 48 | 48 |
| 49 bool is_mask() const { return is_mask_; } |
| 50 |
| 49 scoped_ptr<TilingSetEvictionQueue> CreateEvictionQueue( | 51 scoped_ptr<TilingSetEvictionQueue> CreateEvictionQueue( |
| 50 TreePriority tree_priority); | 52 TreePriority tree_priority); |
| 51 scoped_ptr<TilingSetRasterQueue> CreateRasterQueue(bool prioritize_low_res); | 53 scoped_ptr<TilingSetRasterQueue> CreateRasterQueue(bool prioritize_low_res); |
| 52 | 54 |
| 53 // LayerImpl overrides. | 55 // LayerImpl overrides. |
| 54 const char* LayerTypeAsString() const override; | 56 const char* LayerTypeAsString() const override; |
| 55 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 57 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 56 void PushPropertiesTo(LayerImpl* layer) override; | 58 void PushPropertiesTo(LayerImpl* layer) override; |
| 57 void AppendQuads(RenderPass* render_pass, | 59 void AppendQuads(RenderPass* render_pass, |
| 58 const Occlusion& occlusion_in_content_space, | 60 const Occlusion& occlusion_in_content_space, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 71 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; | 73 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; |
| 72 const Region* GetPendingInvalidation() override; | 74 const Region* GetPendingInvalidation() override; |
| 73 const PictureLayerTiling* GetPendingOrActiveTwinTiling( | 75 const PictureLayerTiling* GetPendingOrActiveTwinTiling( |
| 74 const PictureLayerTiling* tiling) const override; | 76 const PictureLayerTiling* tiling) const override; |
| 75 PictureLayerTiling* GetRecycledTwinTiling( | 77 PictureLayerTiling* GetRecycledTwinTiling( |
| 76 const PictureLayerTiling* tiling) override; | 78 const PictureLayerTiling* tiling) override; |
| 77 TilePriority::PriorityBin GetMaxTilePriorityBin() const override; | 79 TilePriority::PriorityBin GetMaxTilePriorityBin() const override; |
| 78 WhichTree GetTree() const override; | 80 WhichTree GetTree() const override; |
| 79 bool RequiresHighResToDraw() const override; | 81 bool RequiresHighResToDraw() const override; |
| 80 | 82 |
| 81 // PushPropertiesTo active tree => pending tree. | 83 void UpdateRasterSource(scoped_refptr<RasterSource> raster_source, |
| 82 void SyncTiling(const PictureLayerTiling* tiling); | 84 Region* new_invalidation, |
| 85 const PictureLayerTilingSet* pending_set); |
| 83 | 86 |
| 84 // Mask-related functions. | 87 // Mask-related functions. |
| 85 void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, | 88 void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, |
| 86 gfx::Size* resource_size) const override; | 89 gfx::Size* resource_size) const override; |
| 87 | 90 |
| 88 size_t GPUMemoryUsageInBytes() const override; | 91 size_t GPUMemoryUsageInBytes() const override; |
| 89 | 92 |
| 90 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; | 93 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
| 91 | 94 |
| 92 bool CanHaveTilings() const; | 95 bool CanHaveTilings() const; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 112 void AddTilingsForRasterScale(); | 115 void AddTilingsForRasterScale(); |
| 113 void UpdateTilePriorities(const Occlusion& occlusion_in_content_space); | 116 void UpdateTilePriorities(const Occlusion& occlusion_in_content_space); |
| 114 virtual bool ShouldAdjustRasterScale() const; | 117 virtual bool ShouldAdjustRasterScale() const; |
| 115 virtual void RecalculateRasterScales(); | 118 virtual void RecalculateRasterScales(); |
| 116 void CleanUpTilingsOnActiveLayer( | 119 void CleanUpTilingsOnActiveLayer( |
| 117 std::vector<PictureLayerTiling*> used_tilings); | 120 std::vector<PictureLayerTiling*> used_tilings); |
| 118 float MinimumContentsScale() const; | 121 float MinimumContentsScale() const; |
| 119 void ResetRasterScale(); | 122 void ResetRasterScale(); |
| 120 gfx::Rect GetViewportForTilePriorityInContentSpace() const; | 123 gfx::Rect GetViewportForTilePriorityInContentSpace() const; |
| 121 PictureLayerImpl* GetRecycledTwinLayer() const; | 124 PictureLayerImpl* GetRecycledTwinLayer() const; |
| 122 void UpdateRasterSource(scoped_refptr<RasterSource> raster_source, | |
| 123 Region* new_invalidation, | |
| 124 const PictureLayerTilingSet* pending_set); | |
| 125 | 125 |
| 126 void DoPostCommitInitializationIfNeeded() { | 126 void DoPostCommitInitializationIfNeeded() { |
| 127 if (needs_post_commit_initialization_) | 127 if (needs_post_commit_initialization_) |
| 128 DoPostCommitInitialization(); | 128 DoPostCommitInitialization(); |
| 129 } | 129 } |
| 130 void DoPostCommitInitialization(); | 130 void DoPostCommitInitialization(); |
| 131 | 131 |
| 132 bool CanHaveTilingWithScale(float contents_scale) const; | 132 bool CanHaveTilingWithScale(float contents_scale) const; |
| 133 void SanityCheckTilingState() const; | 133 void SanityCheckTilingState() const; |
| 134 // Checks if all tiles required for a certain action (e.g. activation) are | 134 // Checks if all tiles required for a certain action (e.g. activation) are |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 const bool is_mask_; | 174 const bool is_mask_; |
| 175 | 175 |
| 176 // Any draw properties derived from |transform|, |viewport|, and |clip| | 176 // Any draw properties derived from |transform|, |viewport|, and |clip| |
| 177 // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid | 177 // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid |
| 178 // for prioritizing tiles during resourceless software draws. This is because | 178 // for prioritizing tiles during resourceless software draws. This is because |
| 179 // resourceless software draws can have wildly different transforms/viewports | 179 // resourceless software draws can have wildly different transforms/viewports |
| 180 // from regular draws. Save a copy of the required draw properties of the last | 180 // from regular draws. Save a copy of the required draw properties of the last |
| 181 // frame that has a valid viewport for prioritizing tiles. | 181 // frame that has a valid viewport for prioritizing tiles. |
| 182 gfx::Rect visible_rect_for_tile_priority_; | 182 gfx::Rect visible_rect_for_tile_priority_; |
| 183 | 183 |
| 184 friend class PictureLayer; | |
| 185 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 184 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 186 }; | 185 }; |
| 187 | 186 |
| 188 } // namespace cc | 187 } // namespace cc |
| 189 | 188 |
| 190 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 189 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |