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

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

Issue 881083002: cc: Clean up tilings in UpdateTiles as well as in AppendQuads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 11 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
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl.cc » ('j') | cc/layers/picture_layer_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; 108 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const;
109 109
110 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); 110 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask);
111 PictureLayerTiling* AddTiling(float contents_scale); 111 PictureLayerTiling* AddTiling(float contents_scale);
112 void RemoveAllTilings(); 112 void RemoveAllTilings();
113 void AddTilingsForRasterScale(); 113 void AddTilingsForRasterScale();
114 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); 114 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space);
115 virtual bool ShouldAdjustRasterScale() const; 115 virtual bool ShouldAdjustRasterScale() const;
116 virtual void RecalculateRasterScales(); 116 virtual void RecalculateRasterScales();
117 void CleanUpTilingsOnActiveLayer( 117 void CleanUpTilingsOnActiveLayer(
118 std::vector<PictureLayerTiling*> used_tilings); 118 const std::vector<PictureLayerTiling*>& used_tilings);
119 float MinimumContentsScale() const; 119 float MinimumContentsScale() const;
120 float MaximumContentsScale() const; 120 float MaximumContentsScale() const;
121 void ResetRasterScale(); 121 void ResetRasterScale();
122 void UpdateViewportRectForTilePriorityInContentSpace(); 122 void UpdateViewportRectForTilePriorityInContentSpace();
123 PictureLayerImpl* GetRecycledTwinLayer() const; 123 PictureLayerImpl* GetRecycledTwinLayer() const;
124 124
125 void SanityCheckTilingState() const; 125 void SanityCheckTilingState() const;
126 // Checks if all tiles required for a certain action (e.g. activation) are 126 // Checks if all tiles required for a certain action (e.g. activation) are
127 // ready to draw. is_tile_required_callback gets called on all candidate 127 // ready to draw. is_tile_required_callback gets called on all candidate
128 // tiles and returns true if the tile is required for the action. 128 // tiles and returns true if the tile is required for the action.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 // Any draw properties derived from |transform|, |viewport|, and |clip| 166 // Any draw properties derived from |transform|, |viewport|, and |clip|
167 // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid 167 // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid
168 // for prioritizing tiles during resourceless software draws. This is because 168 // for prioritizing tiles during resourceless software draws. This is because
169 // resourceless software draws can have wildly different transforms/viewports 169 // resourceless software draws can have wildly different transforms/viewports
170 // from regular draws. Save a copy of the required draw properties of the last 170 // from regular draws. Save a copy of the required draw properties of the last
171 // frame that has a valid viewport for prioritizing tiles. 171 // frame that has a valid viewport for prioritizing tiles.
172 gfx::Rect visible_rect_for_tile_priority_; 172 gfx::Rect visible_rect_for_tile_priority_;
173 gfx::Rect viewport_rect_for_tile_priority_in_content_space_; 173 gfx::Rect viewport_rect_for_tile_priority_in_content_space_;
174 174
175 // List of tilings that were used last time we appended quads. This can be
176 // used as an optimization not to remove tilings if they are still being
177 // drawn. Note that accessing this vector should only be done in the context
178 // of comparing pointers, since objects pointed to are not guaranteed to
179 // exist.
180 std::vector<PictureLayerTiling*> last_append_quads_tilings_;
181 bool need_tiling_cleanup_;
182
175 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); 183 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
176 }; 184 };
177 185
178 } // namespace cc 186 } // namespace cc
179 187
180 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ 188 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl.cc » ('j') | cc/layers/picture_layer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698