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

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: Updated PictureLayerImplTest.LayerEvictionTileIterator test. 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 NotifyTileInitialized(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 void CalculateContentsScale(float ideal_contents_scale,
100 float device_scale_factor,
101 float page_scale_factor,
102 float maximum_animation_contents_scale,
103 bool animating_transform_to_screen,
104 float* contents_scale_x,
105 float* contents_scale_y,
106 gfx::Size* content_bounds) OVERRIDE;
107 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; 99 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE;
108 100
109 // PictureLayerTilingClient overrides. 101 // PictureLayerTilingClient overrides.
110 virtual scoped_refptr<Tile> CreateTile( 102 virtual scoped_refptr<Tile> CreateTile(
111 PictureLayerTiling* tiling, 103 PictureLayerTiling* tiling,
112 const gfx::Rect& content_rect) OVERRIDE; 104 const gfx::Rect& content_rect) OVERRIDE;
113 virtual void UpdatePile(Tile* tile) OVERRIDE; 105 virtual void UpdatePile(Tile* tile) OVERRIDE;
114 virtual gfx::Size CalculateTileSize( 106 virtual gfx::Size CalculateTileSize(
115 const gfx::Size& content_bounds) const OVERRIDE; 107 const gfx::Size& content_bounds) const OVERRIDE;
116 virtual const Region* GetInvalidation() OVERRIDE; 108 virtual const Region* GetInvalidation() OVERRIDE;
(...skipping 13 matching lines...) Expand all
130 virtual size_t GPUMemoryUsageInBytes() const OVERRIDE; 122 virtual size_t GPUMemoryUsageInBytes() const OVERRIDE;
131 123
132 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; 124 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE;
133 125
134 // Functions used by tile manager. 126 // Functions used by tile manager.
135 void DidUnregisterLayer(); 127 void DidUnregisterLayer();
136 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } 128 PictureLayerImpl* GetTwinLayer() { return twin_layer_; }
137 WhichTree GetTree() const; 129 WhichTree GetTree() const;
138 bool IsOnActiveOrPendingTree() const; 130 bool IsOnActiveOrPendingTree() const;
139 131
132 float MaximumTilingContentScale() const;
133
140 protected: 134 protected:
141 friend class LayerRasterTileIterator; 135 friend class LayerRasterTileIterator;
142 136
143 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); 137 PictureLayerImpl(LayerTreeImpl* tree_impl, int id);
144 PictureLayerTiling* AddTiling(float contents_scale); 138 PictureLayerTiling* AddTiling(float contents_scale);
145 void RemoveTiling(float contents_scale); 139 void RemoveTiling(float contents_scale);
146 void RemoveAllTilings(); 140 void RemoveAllTilings();
147 void SyncFromActiveLayer(const PictureLayerImpl* other); 141 void SyncFromActiveLayer(const PictureLayerImpl* other);
148 void ManageTilings(bool animating_transform_to_screen, 142 void ManageTilings(bool animating_transform_to_screen,
149 float maximum_animation_contents_scale); 143 float maximum_animation_contents_scale);
(...skipping 18 matching lines...) Expand all
168 void DoPostCommitInitializationIfNeeded() { 162 void DoPostCommitInitializationIfNeeded() {
169 if (needs_post_commit_initialization_) 163 if (needs_post_commit_initialization_)
170 DoPostCommitInitialization(); 164 DoPostCommitInitialization();
171 } 165 }
172 void DoPostCommitInitialization(); 166 void DoPostCommitInitialization();
173 167
174 bool CanHaveTilings() const; 168 bool CanHaveTilings() const;
175 bool CanHaveTilingWithScale(float contents_scale) const; 169 bool CanHaveTilingWithScale(float contents_scale) const;
176 void SanityCheckTilingState() const; 170 void SanityCheckTilingState() const;
177 171
172 virtual void UpdateIdealScales();
173 void PopulateSharedQuadStateWithOverrides(
174 SharedQuadState* state,
175 gfx::Transform target_space_transform,
176 gfx::Size content_bounds,
177 gfx::Rect visible_content_rect) const;
178
178 virtual void GetDebugBorderProperties( 179 virtual void GetDebugBorderProperties(
179 SkColor* color, float* width) const OVERRIDE; 180 SkColor* color, float* width) const OVERRIDE;
180 virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE; 181 virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE;
181 182
182 PictureLayerImpl* twin_layer_; 183 PictureLayerImpl* twin_layer_;
183 184
184 scoped_ptr<PictureLayerTilingSet> tilings_; 185 scoped_ptr<PictureLayerTilingSet> tilings_;
185 scoped_refptr<PicturePileImpl> pile_; 186 scoped_refptr<PicturePileImpl> pile_;
186 Region invalidation_; 187 Region invalidation_;
187 188
(...skipping 26 matching lines...) Expand all
214 gfx::Size viewport_size_for_tile_priority_; 215 gfx::Size viewport_size_for_tile_priority_;
215 gfx::Transform screen_space_transform_for_tile_priority_; 216 gfx::Transform screen_space_transform_for_tile_priority_;
216 217
217 friend class PictureLayer; 218 friend class PictureLayer;
218 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); 219 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
219 }; 220 };
220 221
221 } // namespace cc 222 } // namespace cc
222 223
223 #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