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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
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 UpdateTiles() OVERRIDE; |
95 virtual void NotifyTileStateChanged(const Tile* tile) OVERRIDE; | 95 virtual void NotifyTileStateChanged(const Tile* tile) OVERRIDE; |
96 virtual void DidBecomeActive() OVERRIDE; | 96 virtual void DidBecomeActive() OVERRIDE; |
97 virtual void DidBeginTracing() OVERRIDE; | 97 virtual void DidBeginTracing() OVERRIDE; |
98 virtual void ReleaseResources() OVERRIDE; | 98 virtual void ReleaseResources() OVERRIDE; |
99 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; | 99 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; |
100 | 100 |
101 // PictureLayerTilingClient overrides. | 101 // PictureLayerTilingClient overrides. |
102 virtual scoped_refptr<Tile> CreateTile( | 102 virtual scoped_refptr<Tile> CreateTile( |
103 PictureLayerTiling* tiling, | 103 PictureLayerTiling* tiling, |
104 const gfx::Rect& content_rect) OVERRIDE; | 104 const gfx::Rect& content_rect) OVERRIDE; |
(...skipping 26 matching lines...) Expand all Loading... |
131 bool AllTilesRequiredForActivationAreReadyToDraw() const; | 131 bool AllTilesRequiredForActivationAreReadyToDraw() const; |
132 | 132 |
133 protected: | 133 protected: |
134 friend class LayerRasterTileIterator; | 134 friend class LayerRasterTileIterator; |
135 | 135 |
136 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 136 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
137 PictureLayerTiling* AddTiling(float contents_scale); | 137 PictureLayerTiling* AddTiling(float contents_scale); |
138 void RemoveTiling(float contents_scale); | 138 void RemoveTiling(float contents_scale); |
139 void RemoveAllTilings(); | 139 void RemoveAllTilings(); |
140 void SyncFromActiveLayer(const PictureLayerImpl* other); | 140 void SyncFromActiveLayer(const PictureLayerImpl* other); |
141 void ManageTilings(bool animating_transform_to_screen, | 141 void AddTilingsForRasterScale(); |
142 float maximum_animation_contents_scale); | 142 void UpdateTilePriorities(); |
143 virtual bool ShouldAdjustRasterScale( | 143 virtual bool ShouldAdjustRasterScale() const; |
144 bool animating_transform_to_screen) const; | 144 virtual void RecalculateRasterScales(); |
145 virtual void RecalculateRasterScales(bool animating_transform_to_screen, | |
146 float maximum_animation_contents_scale); | |
147 void CleanUpTilingsOnActiveLayer( | 145 void CleanUpTilingsOnActiveLayer( |
148 std::vector<PictureLayerTiling*> used_tilings); | 146 std::vector<PictureLayerTiling*> used_tilings); |
149 float MinimumContentsScale() const; | 147 float MinimumContentsScale() const; |
150 float SnappedContentsScale(float new_contents_scale); | 148 float SnappedContentsScale(float new_contents_scale); |
151 void ResetRasterScale(); | 149 void ResetRasterScale(); |
152 void MarkVisibleResourcesAsRequired() const; | 150 void MarkVisibleResourcesAsRequired() const; |
153 bool MarkVisibleTilesAsRequired( | 151 bool MarkVisibleTilesAsRequired( |
154 PictureLayerTiling* tiling, | 152 PictureLayerTiling* tiling, |
155 const PictureLayerTiling* optional_twin_tiling, | 153 const PictureLayerTiling* optional_twin_tiling, |
156 float contents_scale, | 154 float contents_scale, |
(...skipping 30 matching lines...) Expand all Loading... |
187 float ideal_source_scale_; | 185 float ideal_source_scale_; |
188 float ideal_contents_scale_; | 186 float ideal_contents_scale_; |
189 | 187 |
190 float raster_page_scale_; | 188 float raster_page_scale_; |
191 float raster_device_scale_; | 189 float raster_device_scale_; |
192 float raster_source_scale_; | 190 float raster_source_scale_; |
193 float raster_contents_scale_; | 191 float raster_contents_scale_; |
194 float low_res_raster_contents_scale_; | 192 float low_res_raster_contents_scale_; |
195 | 193 |
196 bool raster_source_scale_is_fixed_; | 194 bool raster_source_scale_is_fixed_; |
197 bool was_animating_transform_to_screen_; | 195 bool was_screen_space_transform_animating_; |
198 bool needs_post_commit_initialization_; | 196 bool needs_post_commit_initialization_; |
199 // A sanity state check to make sure UpdateTilePriorities only gets called | 197 // A sanity state check to make sure UpdateTilePriorities only gets called |
200 // after a CalculateContentsScale/ManageTilings. | 198 // after a CalculateContentsScale/ManageTilings. |
201 bool should_update_tile_priorities_; | 199 bool should_update_tile_priorities_; |
202 | 200 |
203 // Save a copy of the visible rect and viewport size of the last frame that | 201 // Save a copy of the visible rect and viewport size of the last frame that |
204 // has a valid viewport for prioritizing tiles. | 202 // has a valid viewport for prioritizing tiles. |
205 gfx::Rect visible_rect_for_tile_priority_; | 203 gfx::Rect visible_rect_for_tile_priority_; |
206 gfx::Size viewport_size_for_tile_priority_; | 204 gfx::Size viewport_size_for_tile_priority_; |
207 gfx::Transform screen_space_transform_for_tile_priority_; | 205 gfx::Transform screen_space_transform_for_tile_priority_; |
208 | 206 |
209 friend class PictureLayer; | 207 friend class PictureLayer; |
210 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 208 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
211 }; | 209 }; |
212 | 210 |
213 } // namespace cc | 211 } // namespace cc |
214 | 212 |
215 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 213 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |