Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Side by Side Diff: cc/layers/picture_layer_impl.h

Issue 271533011: cc: Move tiling management out of draw properties calculation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP - review comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) 90 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
91 OVERRIDE; 91 OVERRIDE;
92 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; 92 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
93 virtual void AppendQuads(QuadSink* quad_sink, 93 virtual void AppendQuads(QuadSink* quad_sink,
94 AppendQuadsData* append_quads_data) OVERRIDE; 94 AppendQuadsData* append_quads_data) OVERRIDE;
95 virtual void UpdateTilePriorities() OVERRIDE; 95 virtual void UpdateTilePriorities() OVERRIDE;
96 virtual void NotifyTileInitialized(const Tile* tile) OVERRIDE; 96 virtual void NotifyTileInitialized(const Tile* tile) OVERRIDE;
97 virtual void DidBecomeActive() OVERRIDE; 97 virtual void DidBecomeActive() OVERRIDE;
98 virtual void DidBeginTracing() OVERRIDE; 98 virtual void DidBeginTracing() OVERRIDE;
99 virtual void ReleaseResources() OVERRIDE; 99 virtual void ReleaseResources() OVERRIDE;
100 virtual void CalculateContentsScale(float ideal_contents_scale,
101 float device_scale_factor,
102 float page_scale_factor,
103 float maximum_animation_contents_scale,
104 bool animating_transform_to_screen,
105 float* contents_scale_x,
106 float* contents_scale_y,
107 gfx::Size* content_bounds) OVERRIDE;
108 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; 100 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE;
109 101
110 // PictureLayerTilingClient overrides. 102 // PictureLayerTilingClient overrides.
111 virtual scoped_refptr<Tile> CreateTile( 103 virtual scoped_refptr<Tile> CreateTile(
112 PictureLayerTiling* tiling, 104 PictureLayerTiling* tiling,
113 const gfx::Rect& content_rect) OVERRIDE; 105 const gfx::Rect& content_rect) OVERRIDE;
114 virtual void UpdatePile(Tile* tile) OVERRIDE; 106 virtual void UpdatePile(Tile* tile) OVERRIDE;
115 virtual gfx::Size CalculateTileSize( 107 virtual gfx::Size CalculateTileSize(
116 const gfx::Size& content_bounds) const OVERRIDE; 108 const gfx::Size& content_bounds) const OVERRIDE;
117 virtual const Region* GetInvalidation() OVERRIDE; 109 virtual const Region* GetInvalidation() OVERRIDE;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 void DoPostCommitInitializationIfNeeded() { 168 void DoPostCommitInitializationIfNeeded() {
177 if (needs_post_commit_initialization_) 169 if (needs_post_commit_initialization_)
178 DoPostCommitInitialization(); 170 DoPostCommitInitialization();
179 } 171 }
180 void DoPostCommitInitialization(); 172 void DoPostCommitInitialization();
181 173
182 bool CanHaveTilings() const; 174 bool CanHaveTilings() const;
183 bool CanHaveTilingWithScale(float contents_scale) const; 175 bool CanHaveTilingWithScale(float contents_scale) const;
184 void SanityCheckTilingState() const; 176 void SanityCheckTilingState() const;
185 177
178 float GetMaxContentScale() const;
danakj 2014/05/16 14:49:05 let's call this MaximumTilingContentScale()
179 void CalculateIdealScales();
180
186 virtual void GetDebugBorderProperties( 181 virtual void GetDebugBorderProperties(
187 SkColor* color, float* width) const OVERRIDE; 182 SkColor* color, float* width) const OVERRIDE;
188 virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE; 183 virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE;
189 184
190 PictureLayerImpl* twin_layer_; 185 PictureLayerImpl* twin_layer_;
191 186
192 scoped_ptr<PictureLayerTilingSet> tilings_; 187 scoped_ptr<PictureLayerTilingSet> tilings_;
193 scoped_refptr<PicturePileImpl> pile_; 188 scoped_refptr<PicturePileImpl> pile_;
194 Region invalidation_; 189 Region invalidation_;
195 190
196 bool is_mask_; 191 bool is_mask_;
197 192
198 float ideal_page_scale_; 193 float ideal_page_scale_;
199 float ideal_device_scale_; 194 float ideal_device_scale_;
200 float ideal_source_scale_; 195 float ideal_source_scale_;
201 float ideal_contents_scale_; 196 float ideal_contents_scale_;
202 197
203 float raster_page_scale_; 198 float raster_page_scale_;
204 float raster_device_scale_; 199 float raster_device_scale_;
205 float raster_source_scale_; 200 float raster_source_scale_;
206 float raster_contents_scale_; 201 float raster_contents_scale_;
207 float low_res_raster_contents_scale_; 202 float low_res_raster_contents_scale_;
208 203
209 bool raster_source_scale_is_fixed_; 204 bool raster_source_scale_is_fixed_;
210 bool was_animating_transform_to_screen_; 205 bool was_animating_transform_to_screen_;
211 bool is_using_lcd_text_; 206 bool is_using_lcd_text_;
212 bool needs_post_commit_initialization_; 207 bool needs_post_commit_initialization_;
213 // A sanity state check to make sure UpdateTilePriorities only gets called
214 // after a CalculateContentsScale/ManageTilings.
215 bool should_update_tile_priorities_;
216 bool should_use_low_res_tiling_; 208 bool should_use_low_res_tiling_;
217 209
218 bool layer_needs_to_register_itself_; 210 bool layer_needs_to_register_itself_;
219 211
220 // Save a copy of the visible rect and viewport size of the last frame that 212 // Save a copy of the visible rect and viewport size of the last frame that
221 // has a valid viewport for prioritizing tiles. 213 // has a valid viewport for prioritizing tiles.
222 gfx::Rect visible_rect_for_tile_priority_; 214 gfx::Rect visible_rect_for_tile_priority_;
223 gfx::Size viewport_size_for_tile_priority_; 215 gfx::Size viewport_size_for_tile_priority_;
224 gfx::Transform screen_space_transform_for_tile_priority_; 216 gfx::Transform screen_space_transform_for_tile_priority_;
225 217
226 friend class PictureLayer; 218 friend class PictureLayer;
227 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); 219 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
228 }; 220 };
229 221
230 } // namespace cc 222 } // namespace cc
231 223
232 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ 224 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698