OLD | NEW |
---|---|
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 24 matching lines...) Expand all Loading... | |
35 | 35 |
36 size_t start; | 36 size_t start; |
37 size_t end; | 37 size_t end; |
38 }; | 38 }; |
39 | 39 |
40 static scoped_ptr<PictureLayerTilingSet> Create( | 40 static scoped_ptr<PictureLayerTilingSet> Create( |
41 PictureLayerTilingClient* client); | 41 PictureLayerTilingClient* client); |
42 | 42 |
43 ~PictureLayerTilingSet(); | 43 ~PictureLayerTilingSet(); |
44 | 44 |
45 void SetClient(PictureLayerTilingClient* client); | |
46 const PictureLayerTilingClient* client() const { return client_; } | 45 const PictureLayerTilingClient* client() const { return client_; } |
47 | 46 |
48 void RemoveTilesInRegion(const Region& region); | |
49 void CleanUpTilings(float min_acceptable_high_res_scale, | 47 void CleanUpTilings(float min_acceptable_high_res_scale, |
50 float max_acceptable_high_res_scale, | 48 float max_acceptable_high_res_scale, |
51 const std::vector<PictureLayerTiling*>& needed_tilings, | 49 const std::vector<PictureLayerTiling*>& needed_tilings, |
52 bool should_have_low_res, | 50 bool should_have_low_res, |
53 PictureLayerTilingSet* twin_set, | 51 PictureLayerTilingSet* twin_set, |
54 PictureLayerTilingSet* recycled_twin_set); | 52 PictureLayerTilingSet* recycled_twin_set); |
55 | 53 void RemoveNonIdealTilings(); |
56 // Make this set of tilings match the same set of content scales from |other|. | 54 // Make this set of tilings match the same set of content scales from |other|. |
57 // Delete any tilings that don't meet |minimum_contents_scale|. Recreate | 55 // Delete any tilings that don't meet |minimum_contents_scale|. Recreate |
58 // any tiles that intersect |layer_invalidation|. Update the size of all | 56 // any tiles that intersect |layer_invalidation|. Update the size of all |
59 // tilings to |new_layer_bounds|. | 57 // tilings to |new_layer_bounds|. |
60 // Returns true if we had at least one high res tiling synced. | 58 // Returns true if we had at least one high res tiling synced. |
59 // TODO(danakj): Remove this !!! | |
61 bool SyncTilings(const PictureLayerTilingSet& other, | 60 bool SyncTilings(const PictureLayerTilingSet& other, |
enne (OOO)
2014/12/01 22:08:17
SyncTilingsForTesting in the meantime?
danakj
2014/12/05 22:30:44
Done.
| |
62 const gfx::Size& new_layer_bounds, | 61 const gfx::Size& new_layer_bounds, |
63 const Region& layer_invalidation, | 62 const Region& layer_invalidation, |
64 float minimum_contents_scale, | 63 float minimum_contents_scale, |
65 RasterSource* raster_source); | 64 RasterSource* raster_source); |
66 | 65 |
66 void UpdateTilingsToCurrentRasterSource( | |
67 RasterSource* raster_source, | |
68 // TODO(danakj): DONT NEED LAYER BOUNDSS WE HAVE THE RASTER SOURCE | |
69 const gfx::Size& layer_bounds, | |
70 bool solid_color, | |
71 const Region& layer_invalidation, | |
72 float minimum_contents_scale); | |
73 | |
74 void UpdateTilingsFromPending( | |
75 RasterSource* raster_source, | |
76 const PictureLayerTilingSet& other, | |
77 // TODO(danakj): DONT NEED LAYER BOUNDSS WE HAVE THE RASTER SOURCE | |
78 const gfx::Size& layer_bounds, | |
79 bool solid_color, | |
80 const Region& layer_invalidation, | |
81 float minimum_contents_scale); | |
82 | |
67 PictureLayerTiling* AddTiling(float contents_scale, | 83 PictureLayerTiling* AddTiling(float contents_scale, |
68 const gfx::Size& layer_bounds); | 84 const gfx::Size& layer_bounds); |
69 size_t num_tilings() const { return tilings_.size(); } | 85 size_t num_tilings() const { return tilings_.size(); } |
70 int NumHighResTilings() const; | 86 int NumHighResTilings() const; |
71 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } | 87 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } |
72 const PictureLayerTiling* tiling_at(size_t idx) const { | 88 const PictureLayerTiling* tiling_at(size_t idx) const { |
73 return tilings_[idx]; | 89 return tilings_[idx]; |
74 } | 90 } |
75 | 91 |
76 PictureLayerTiling* FindTilingWithScale(float scale) const; | 92 PictureLayerTiling* FindTilingWithScale(float scale) const; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 PictureLayerTilingClient* client_; | 179 PictureLayerTilingClient* client_; |
164 ScopedPtrVector<PictureLayerTiling> tilings_; | 180 ScopedPtrVector<PictureLayerTiling> tilings_; |
165 | 181 |
166 friend class Iterator; | 182 friend class Iterator; |
167 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 183 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
168 }; | 184 }; |
169 | 185 |
170 } // namespace cc | 186 } // namespace cc |
171 | 187 |
172 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 188 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
OLD | NEW |