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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 virtual ~PictureLayerImpl(); | 85 virtual ~PictureLayerImpl(); |
86 | 86 |
87 // LayerImpl overrides. | 87 // LayerImpl overrides. |
88 virtual const char* LayerTypeAsString() const OVERRIDE; | 88 virtual const char* LayerTypeAsString() const OVERRIDE; |
89 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 89 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
90 OVERRIDE; | 90 OVERRIDE; |
91 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 91 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
92 virtual void AppendQuads(QuadSink* quad_sink, | 92 virtual void AppendQuads(QuadSink* quad_sink, |
93 AppendQuadsData* append_quads_data) OVERRIDE; | 93 AppendQuadsData* append_quads_data) OVERRIDE; |
94 virtual void UpdateTilePriorities() OVERRIDE; | 94 virtual void UpdateTilePriorities() OVERRIDE; |
95 virtual void NotifyTileInitialized(const Tile* tile) OVERRIDE; | |
95 virtual void DidBecomeActive() OVERRIDE; | 96 virtual void DidBecomeActive() OVERRIDE; |
96 virtual void DidBeginTracing() OVERRIDE; | 97 virtual void DidBeginTracing() OVERRIDE; |
97 virtual void ReleaseResources() OVERRIDE; | 98 virtual void ReleaseResources() OVERRIDE; |
98 virtual void CalculateContentsScale(float ideal_contents_scale, | 99 virtual void CalculateContentsScale(float ideal_contents_scale, |
99 float device_scale_factor, | 100 float device_scale_factor, |
100 float page_scale_factor, | 101 float page_scale_factor, |
101 float maximum_animation_contents_scale, | 102 float maximum_animation_contents_scale, |
102 bool animating_transform_to_screen, | 103 bool animating_transform_to_screen, |
103 float* contents_scale_x, | 104 float* contents_scale_x, |
104 float* contents_scale_y, | 105 float* contents_scale_y, |
(...skipping 26 matching lines...) Expand all Loading... | |
131 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; | 132 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; |
132 | 133 |
133 void SetUseGpuRasterization(bool use_gpu); | 134 void SetUseGpuRasterization(bool use_gpu); |
134 bool ShouldUseGpuRasterization() const { return use_gpu_rasterization_; } | 135 bool ShouldUseGpuRasterization() const { return use_gpu_rasterization_; } |
135 | 136 |
136 // Functions used by tile manager. | 137 // Functions used by tile manager. |
137 void DidUnregisterLayer(); | 138 void DidUnregisterLayer(); |
138 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } | 139 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } |
139 WhichTree GetTree() const; | 140 WhichTree GetTree() const; |
140 bool IsOnActiveOrPendingTree() const; | 141 bool IsOnActiveOrPendingTree() const; |
142 size_t RequiredForActivationTileNeedsRasterCount() const { | |
reveman
2014/04/25 20:44:08
TilesRequiredForActivationThatNeedsRasterCount?
vmpstr
2014/04/25 22:09:52
Done.
| |
143 return required_for_activation_tile_needs_raster_count_; | |
144 } | |
141 | 145 |
142 protected: | 146 protected: |
143 friend class LayerRasterTileIterator; | 147 friend class LayerRasterTileIterator; |
144 | 148 |
145 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 149 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
146 PictureLayerTiling* AddTiling(float contents_scale); | 150 PictureLayerTiling* AddTiling(float contents_scale); |
147 void RemoveTiling(float contents_scale); | 151 void RemoveTiling(float contents_scale); |
148 void RemoveAllTilings(); | 152 void RemoveAllTilings(); |
149 void SyncFromActiveLayer(const PictureLayerImpl* other); | 153 void SyncFromActiveLayer(const PictureLayerImpl* other); |
150 void ManageTilings(bool animating_transform_to_screen, | 154 void ManageTilings(bool animating_transform_to_screen, |
151 float maximum_animation_contents_scale); | 155 float maximum_animation_contents_scale); |
152 bool ShouldHaveLowResTiling() const { | 156 bool ShouldHaveLowResTiling() const { |
153 return should_use_low_res_tiling_ && !ShouldUseGpuRasterization(); | 157 return should_use_low_res_tiling_ && !ShouldUseGpuRasterization(); |
154 } | 158 } |
155 virtual bool ShouldAdjustRasterScale( | 159 virtual bool ShouldAdjustRasterScale( |
156 bool animating_transform_to_screen) const; | 160 bool animating_transform_to_screen) const; |
157 virtual void RecalculateRasterScales(bool animating_transform_to_screen, | 161 virtual void RecalculateRasterScales(bool animating_transform_to_screen, |
158 float maximum_animation_contents_scale); | 162 float maximum_animation_contents_scale); |
159 void CleanUpTilingsOnActiveLayer( | 163 void CleanUpTilingsOnActiveLayer( |
160 std::vector<PictureLayerTiling*> used_tilings); | 164 std::vector<PictureLayerTiling*> used_tilings); |
161 float MinimumContentsScale() const; | 165 float MinimumContentsScale() const; |
162 float SnappedContentsScale(float new_contents_scale); | 166 float SnappedContentsScale(float new_contents_scale); |
163 void UpdateLCDTextStatus(bool new_status); | 167 void UpdateLCDTextStatus(bool new_status); |
164 void ResetRasterScale(); | 168 void ResetRasterScale(); |
165 void MarkVisibleResourcesAsRequired() const; | 169 void MarkVisibleResourcesAsRequired(); |
166 bool MarkVisibleTilesAsRequired( | 170 bool MarkVisibleTilesAsRequired( |
167 PictureLayerTiling* tiling, | 171 PictureLayerTiling* tiling, |
168 const PictureLayerTiling* optional_twin_tiling, | 172 const PictureLayerTiling* optional_twin_tiling, |
169 float contents_scale, | 173 float contents_scale, |
170 const gfx::Rect& rect, | 174 const gfx::Rect& rect, |
171 const Region& missing_region) const; | 175 const Region& missing_region); |
172 | 176 |
173 void DoPostCommitInitializationIfNeeded() { | 177 void DoPostCommitInitializationIfNeeded() { |
174 if (needs_post_commit_initialization_) | 178 if (needs_post_commit_initialization_) |
175 DoPostCommitInitialization(); | 179 DoPostCommitInitialization(); |
176 } | 180 } |
177 void DoPostCommitInitialization(); | 181 void DoPostCommitInitialization(); |
178 | 182 |
179 bool CanHaveTilings() const; | 183 bool CanHaveTilings() const; |
180 bool CanHaveTilingWithScale(float contents_scale) const; | 184 bool CanHaveTilingWithScale(float contents_scale) const; |
181 void SanityCheckTilingState() const; | 185 void SanityCheckTilingState() const; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 bool use_gpu_rasterization_; | 217 bool use_gpu_rasterization_; |
214 | 218 |
215 bool layer_needs_to_register_itself_; | 219 bool layer_needs_to_register_itself_; |
216 | 220 |
217 // Save a copy of the visible rect and viewport size of the last frame that | 221 // Save a copy of the visible rect and viewport size of the last frame that |
218 // has a valid viewport for prioritizing tiles. | 222 // has a valid viewport for prioritizing tiles. |
219 gfx::Rect visible_rect_for_tile_priority_; | 223 gfx::Rect visible_rect_for_tile_priority_; |
220 gfx::Size viewport_size_for_tile_priority_; | 224 gfx::Size viewport_size_for_tile_priority_; |
221 gfx::Transform screen_space_transform_for_tile_priority_; | 225 gfx::Transform screen_space_transform_for_tile_priority_; |
222 | 226 |
227 size_t required_for_activation_tile_needs_raster_count_; | |
228 | |
223 friend class PictureLayer; | 229 friend class PictureLayer; |
224 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 230 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
225 }; | 231 }; |
226 | 232 |
227 } // namespace cc | 233 } // namespace cc |
228 | 234 |
229 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 235 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |