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

Side by Side Diff: cc/resources/picture_layer_tiling_set.h

Issue 1041893003: cc: Separate tiling set functionality into explicit separate functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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_RESOURCES_PICTURE_LAYER_TILING_SET_H_ 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 const PictureLayerTilingClient* client() const { return client_; } 48 const PictureLayerTilingClient* client() const { return client_; }
49 49
50 void CleanUpTilings(float min_acceptable_high_res_scale, 50 void CleanUpTilings(float min_acceptable_high_res_scale,
51 float max_acceptable_high_res_scale, 51 float max_acceptable_high_res_scale,
52 const std::vector<PictureLayerTiling*>& needed_tilings, 52 const std::vector<PictureLayerTiling*>& needed_tilings,
53 bool should_have_low_res, 53 bool should_have_low_res,
54 PictureLayerTilingSet* twin_set, 54 PictureLayerTilingSet* twin_set,
55 PictureLayerTilingSet* recycled_twin_set); 55 PictureLayerTilingSet* recycled_twin_set);
56 void RemoveNonIdealTilings(); 56 void RemoveNonIdealTilings();
57 57
58 // This function can be called on both the active and pending tree. 58 // This function is called on the active tree during activation.
59 // |pending_twin_set| represents the current pending twin. In situations where 59 void UpdateTilingsToCurrentRasterSourceForActivation(
60 // this is called on the active tree in two trees situations,
61 // |pending_twin_set| represents the tiling set from the pending twin layer.
62 // In situations where this is called on the sync tree (whether it's pending
63 // or active in cases of one tree), |pending_twin_set| should be nullptr.
64 void UpdateTilingsToCurrentRasterSource(
65 scoped_refptr<RasterSource> raster_source, 60 scoped_refptr<RasterSource> raster_source,
66 const PictureLayerTilingSet* pending_twin_set, 61 const PictureLayerTilingSet* pending_twin_set,
67 const Region& layer_invalidation, 62 const Region& layer_invalidation);
68 float minimum_contents_scale, 63
69 float maximum_contents_scale); 64 // This function is called on the sync tree during commit.
65 void UpdateTilingsToCurrentRasterSourceForCommit(
66 scoped_refptr<RasterSource> raster_source,
67 const Region& layer_invalidation);
68
69 // This function is called on the sync tree right after commit.
70 void UpdateRasterSourceDueToLCDChange(
71 const scoped_refptr<RasterSource>& raster_source,
72 const Region& layer_invalidation);
70 73
71 PictureLayerTiling* AddTiling(float contents_scale, 74 PictureLayerTiling* AddTiling(float contents_scale,
72 scoped_refptr<RasterSource> raster_source); 75 scoped_refptr<RasterSource> raster_source);
73 size_t num_tilings() const { return tilings_.size(); } 76 size_t num_tilings() const { return tilings_.size(); }
74 int NumHighResTilings() const; 77 int NumHighResTilings() const;
75 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } 78 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; }
76 const PictureLayerTiling* tiling_at(size_t idx) const { 79 const PictureLayerTiling* tiling_at(size_t idx) const {
77 return tilings_[idx]; 80 return tilings_[idx];
78 } 81 }
79 82
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 166
164 TilingRange GetTilingRange(TilingRangeType type) const; 167 TilingRange GetTilingRange(TilingRangeType type) const;
165 168
166 private: 169 private:
167 explicit PictureLayerTilingSet( 170 explicit PictureLayerTilingSet(
168 PictureLayerTilingClient* client, 171 PictureLayerTilingClient* client,
169 size_t max_tiles_for_interest_area, 172 size_t max_tiles_for_interest_area,
170 float skewport_target_time_in_seconds, 173 float skewport_target_time_in_seconds,
171 int skewport_extrapolation_limit_in_content_pixels); 174 int skewport_extrapolation_limit_in_content_pixels);
172 175
173 void CopyTilingsFromPendingTwin( 176 void CopyTilingsAndPropertiesFromPendingTwin(
174 const PictureLayerTilingSet* pending_twin_set, 177 const PictureLayerTilingSet* pending_twin_set,
175 const scoped_refptr<RasterSource>& raster_source); 178 const scoped_refptr<RasterSource>& raster_source);
176 179
177 // Remove one tiling. 180 // Remove one tiling.
178 void Remove(PictureLayerTiling* tiling); 181 void Remove(PictureLayerTiling* tiling);
182 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const;
179 183
180 ScopedPtrVector<PictureLayerTiling> tilings_; 184 ScopedPtrVector<PictureLayerTiling> tilings_;
181 185
182 const size_t max_tiles_for_interest_area_; 186 const size_t max_tiles_for_interest_area_;
183 const float skewport_target_time_in_seconds_; 187 const float skewport_target_time_in_seconds_;
184 const int skewport_extrapolation_limit_in_content_pixels_; 188 const int skewport_extrapolation_limit_in_content_pixels_;
185 PictureLayerTilingClient* client_; 189 PictureLayerTilingClient* client_;
186 190
187 friend class Iterator; 191 friend class Iterator;
188 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); 192 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet);
189 }; 193 };
190 194
191 } // namespace cc 195 } // namespace cc
192 196
193 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ 197 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698