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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 int GetSkewportExtrapolationLimitInContentPixels() const override; | 106 int GetSkewportExtrapolationLimitInContentPixels() const override; |
107 WhichTree GetTree() const override; | 107 WhichTree GetTree() const override; |
108 bool RequiresHighResToDraw() const override; | 108 bool RequiresHighResToDraw() const override; |
109 | 109 |
110 // PushPropertiesTo active tree => pending tree. | 110 // PushPropertiesTo active tree => pending tree. |
111 void SyncTiling(const PictureLayerTiling* tiling); | 111 void SyncTiling(const PictureLayerTiling* tiling); |
112 | 112 |
113 // Mask-related functions. | 113 // Mask-related functions. |
114 void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, | 114 void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, |
115 gfx::Size* resource_size) const override; | 115 gfx::Size* resource_size) const override; |
116 void set_is_mask(bool is_mask) { is_mask_ = is_mask; } | |
117 | 116 |
118 size_t GPUMemoryUsageInBytes() const override; | 117 size_t GPUMemoryUsageInBytes() const override; |
119 | 118 |
120 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; | 119 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
121 | 120 |
122 bool CanHaveTilings() const; | 121 bool CanHaveTilings() const; |
123 | 122 |
124 // Functions used by tile manager. | 123 // Functions used by tile manager. |
125 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; | 124 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; |
126 bool IsOnActiveOrPendingTree() const; | 125 bool IsOnActiveOrPendingTree() const; |
127 // Virtual for testing. | 126 // Virtual for testing. |
128 virtual bool HasValidTilePriorities() const; | 127 virtual bool HasValidTilePriorities() const; |
129 bool AllTilesRequiredForActivationAreReadyToDraw() const; | 128 bool AllTilesRequiredForActivationAreReadyToDraw() const; |
130 bool AllTilesRequiredForDrawAreReadyToDraw() const; | 129 bool AllTilesRequiredForDrawAreReadyToDraw() const; |
131 | 130 |
132 protected: | 131 protected: |
133 friend class LayerRasterTileIterator; | 132 friend class LayerRasterTileIterator; |
134 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; | 133 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; |
135 | 134 |
136 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 135 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
137 PictureLayerTiling* AddTiling(float contents_scale); | 136 PictureLayerTiling* AddTiling(float contents_scale); |
138 void RemoveAllTilings(); | 137 void RemoveAllTilings(); |
139 void SyncFromActiveLayer(const PictureLayerImpl* other); | |
140 void AddTilingsForRasterScale(); | 138 void AddTilingsForRasterScale(); |
141 void UpdateTilePriorities(const Occlusion& occlusion_in_content_space); | 139 void UpdateTilePriorities(const Occlusion& occlusion_in_content_space); |
142 virtual bool ShouldAdjustRasterScale() const; | 140 virtual bool ShouldAdjustRasterScale() const; |
143 virtual void RecalculateRasterScales(); | 141 virtual void RecalculateRasterScales(); |
144 void CleanUpTilingsOnActiveLayer( | 142 void CleanUpTilingsOnActiveLayer( |
145 std::vector<PictureLayerTiling*> used_tilings); | 143 std::vector<PictureLayerTiling*> used_tilings); |
146 float MinimumContentsScale() const; | 144 float MinimumContentsScale() const; |
147 void ResetRasterScale(); | 145 void ResetRasterScale(); |
148 gfx::Rect GetViewportForTilePriorityInContentSpace() const; | 146 gfx::Rect GetViewportForTilePriorityInContentSpace() const; |
149 PictureLayerImpl* GetRecycledTwinLayer() const; | 147 PictureLayerImpl* GetRecycledTwinLayer() const; |
150 void UpdateRasterSource(scoped_refptr<RasterSource> raster_source); | 148 void UpdateRasterSource(scoped_refptr<RasterSource> raster_source, |
149 Region* new_invalidation, | |
150 bool is_mask, | |
enne (OOO)
2014/12/01 22:08:17
I'm a little not sure about this mask parameter in
danakj
2014/12/05 22:30:44
Yes, that would be ideal if blink can actually do
enne (OOO)
2014/12/05 23:02:02
Sorry. It'd be ideal if Blink could do that for P
danakj
2014/12/06 17:14:08
Yah I guess so. I'll just dcheck in picture layer
| |
151 const PictureLayerTilingSet* pending_set); | |
151 | 152 |
152 void DoPostCommitInitializationIfNeeded() { | 153 void DoPostCommitInitializationIfNeeded() { |
153 if (needs_post_commit_initialization_) | 154 if (needs_post_commit_initialization_) |
154 DoPostCommitInitialization(); | 155 DoPostCommitInitialization(); |
155 } | 156 } |
156 void DoPostCommitInitialization(); | 157 void DoPostCommitInitialization(); |
157 | 158 |
158 bool CanHaveTilingWithScale(float contents_scale) const; | 159 bool CanHaveTilingWithScale(float contents_scale) const; |
159 void SanityCheckTilingState() const; | 160 void SanityCheckTilingState() const; |
160 // Checks if all tiles required for a certain action (e.g. activation) are | 161 // Checks if all tiles required for a certain action (e.g. activation) are |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 // frame that has a valid viewport for prioritizing tiles. | 207 // frame that has a valid viewport for prioritizing tiles. |
207 gfx::Rect visible_rect_for_tile_priority_; | 208 gfx::Rect visible_rect_for_tile_priority_; |
208 | 209 |
209 friend class PictureLayer; | 210 friend class PictureLayer; |
210 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 211 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
211 }; | 212 }; |
212 | 213 |
213 } // namespace cc | 214 } // namespace cc |
214 | 215 |
215 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 216 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |