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

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: unit tests + 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 13 matching lines...) Expand all
131 virtual size_t GPUMemoryUsageInBytes() const OVERRIDE; 123 virtual size_t GPUMemoryUsageInBytes() const OVERRIDE;
132 124
133 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; 125 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE;
134 126
135 // Functions used by tile manager. 127 // Functions used by tile manager.
136 void DidUnregisterLayer(); 128 void DidUnregisterLayer();
137 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } 129 PictureLayerImpl* GetTwinLayer() { return twin_layer_; }
138 WhichTree GetTree() const; 130 WhichTree GetTree() const;
139 bool IsOnActiveOrPendingTree() const; 131 bool IsOnActiveOrPendingTree() const;
140 132
133 float MaximumTilingContentScale() const;
134 void PopulateSharedQuadStateWithOverrides(
danakj 2014/05/23 17:07:34 Can this be not public?
135 SharedQuadState* state,
136 gfx::Transform target_space_transform,
137 gfx::Size content_bounds,
138 gfx::Rect visible_content_rect) const;
139
141 protected: 140 protected:
142 friend class LayerRasterTileIterator; 141 friend class LayerRasterTileIterator;
143 142
144 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); 143 PictureLayerImpl(LayerTreeImpl* tree_impl, int id);
145 PictureLayerTiling* AddTiling(float contents_scale); 144 PictureLayerTiling* AddTiling(float contents_scale);
146 void RemoveTiling(float contents_scale); 145 void RemoveTiling(float contents_scale);
147 void RemoveAllTilings(); 146 void RemoveAllTilings();
148 void SyncFromActiveLayer(const PictureLayerImpl* other); 147 void SyncFromActiveLayer(const PictureLayerImpl* other);
149 void ManageTilings(bool animating_transform_to_screen, 148 void ManageTilings(bool animating_transform_to_screen,
150 float maximum_animation_contents_scale); 149 float maximum_animation_contents_scale);
(...skipping 22 matching lines...) Expand all
173 void DoPostCommitInitializationIfNeeded() { 172 void DoPostCommitInitializationIfNeeded() {
174 if (needs_post_commit_initialization_) 173 if (needs_post_commit_initialization_)
175 DoPostCommitInitialization(); 174 DoPostCommitInitialization();
176 } 175 }
177 void DoPostCommitInitialization(); 176 void DoPostCommitInitialization();
178 177
179 bool CanHaveTilings() const; 178 bool CanHaveTilings() const;
180 bool CanHaveTilingWithScale(float contents_scale) const; 179 bool CanHaveTilingWithScale(float contents_scale) const;
181 void SanityCheckTilingState() const; 180 void SanityCheckTilingState() const;
182 181
182 void UpdateIdealScales();
danakj 2014/05/23 17:07:34 this should be virtual, right?
183
183 virtual void GetDebugBorderProperties( 184 virtual void GetDebugBorderProperties(
184 SkColor* color, float* width) const OVERRIDE; 185 SkColor* color, float* width) const OVERRIDE;
185 virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE; 186 virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE;
186 187
187 PictureLayerImpl* twin_layer_; 188 PictureLayerImpl* twin_layer_;
188 189
189 scoped_ptr<PictureLayerTilingSet> tilings_; 190 scoped_ptr<PictureLayerTilingSet> tilings_;
190 scoped_refptr<PicturePileImpl> pile_; 191 scoped_refptr<PicturePileImpl> pile_;
191 Region invalidation_; 192 Region invalidation_;
192 193
(...skipping 27 matching lines...) Expand all
220 gfx::Size viewport_size_for_tile_priority_; 221 gfx::Size viewport_size_for_tile_priority_;
221 gfx::Transform screen_space_transform_for_tile_priority_; 222 gfx::Transform screen_space_transform_for_tile_priority_;
222 223
223 friend class PictureLayer; 224 friend class PictureLayer;
224 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); 225 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
225 }; 226 };
226 227
227 } // namespace cc 228 } // namespace cc
228 229
229 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ 230 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698