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

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

Issue 640063010: cc: Don't swap PictureLayerTilingSet on activate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: noswap: maskconstructor Created 6 years 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 | « cc/resources/picture_layer_tiling.cc ('k') | cc/resources/picture_layer_tiling_set.cc » ('j') | no next file with comments »
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_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
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.
61 bool SyncTilings(const PictureLayerTilingSet& other, 59 // TODO(danakj): Remove this !!!
62 const gfx::Size& new_layer_bounds, 60 bool SyncTilingsForTesting(const PictureLayerTilingSet& other,
63 const Region& layer_invalidation, 61 const gfx::Size& new_layer_bounds,
64 float minimum_contents_scale, 62 const Region& layer_invalidation,
65 RasterSource* raster_source); 63 float minimum_contents_scale,
64 RasterSource* raster_source);
65
66 void UpdateTilingsToCurrentRasterSource(
67 RasterSource* raster_source,
68 // TODO(danakj): DONT NEED LAYER BOUNDSS WE HAVE THE RASTER SOURCE
enne (OOO) 2014/12/08 21:02:38 BOUNDSS typo. Is there a reason to punt this TODO
danakj 2014/12/08 22:27:08 Ya... I tried to do this a couple times, but it's
69 const gfx::Size& layer_bounds,
70 const Region& layer_invalidation,
71 float minimum_contents_scale);
72
73 void UpdateTilingsFromPending(
74 RasterSource* raster_source,
75 const PictureLayerTilingSet& other,
76 // TODO(danakj): DONT NEED LAYER BOUNDSS WE HAVE THE RASTER SOURCE
77 const gfx::Size& layer_bounds,
78 const Region& layer_invalidation,
79 float minimum_contents_scale);
66 80
67 PictureLayerTiling* AddTiling(float contents_scale, 81 PictureLayerTiling* AddTiling(float contents_scale,
68 const gfx::Size& layer_bounds); 82 const gfx::Size& layer_bounds);
69 size_t num_tilings() const { return tilings_.size(); } 83 size_t num_tilings() const { return tilings_.size(); }
70 int NumHighResTilings() const; 84 int NumHighResTilings() const;
71 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } 85 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; }
72 const PictureLayerTiling* tiling_at(size_t idx) const { 86 const PictureLayerTiling* tiling_at(size_t idx) const {
73 return tilings_[idx]; 87 return tilings_[idx];
74 } 88 }
75 89
76 PictureLayerTiling* FindTilingWithScale(float scale) const; 90 PictureLayerTiling* FindTilingWithScale(float scale) const;
77 PictureLayerTiling* FindTilingWithResolution(TileResolution resolution) const; 91 PictureLayerTiling* FindTilingWithResolution(TileResolution resolution) const;
78 92
79 void MarkAllTilingsNonIdeal(); 93 void MarkAllTilingsNonIdeal();
80 94
81 // If a tiling exists whose scale is within |snap_to_existing_tiling_ratio| 95 // If a tiling exists whose scale is within |snap_to_existing_tiling_ratio|
82 // ratio of |start_scale|, then return that tiling's scale. Otherwise, return 96 // ratio of |start_scale|, then return that tiling's scale. Otherwise, return
83 // |start_scale|. If multiple tilings match the criteria, return the one with 97 // |start_scale|. If multiple tilings match the criteria, return the one with
84 // the least ratio to |start_scale|. 98 // the least ratio to |start_scale|.
85 float GetSnappedContentsScale(float start_scale, 99 float GetSnappedContentsScale(float start_scale,
86 float snap_to_existing_tiling_ratio) const; 100 float snap_to_existing_tiling_ratio) const;
87 101
88 // Returns the maximum contents scale of all tilings, or 0 if no tilings 102 // Returns the maximum contents scale of all tilings, or 0 if no tilings
89 // exist. 103 // exist.
90 float GetMaximumContentsScale() const; 104 float GetMaximumContentsScale() const;
91 105
106 // Removes all tilings with a contents scale < |minimum_scale|.
107 void RemoveTilingsBelowScale(float minimum_scale);
108
92 // Remove all tilings. 109 // Remove all tilings.
93 void RemoveAllTilings(); 110 void RemoveAllTilings();
94 111
95 // Remove all tiles; keep all tilings. 112 // Remove all tiles; keep all tilings.
96 void RemoveAllTiles(); 113 void RemoveAllTiles();
97 114
98 // Update the rects and priorities for tiles based on the given information. 115 // Update the rects and priorities for tiles based on the given information.
99 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, 116 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space,
100 float ideal_contents_scale, 117 float ideal_contents_scale,
101 double current_frame_time_in_seconds, 118 double current_frame_time_in_seconds,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 PictureLayerTilingClient* client_; 180 PictureLayerTilingClient* client_;
164 ScopedPtrVector<PictureLayerTiling> tilings_; 181 ScopedPtrVector<PictureLayerTiling> tilings_;
165 182
166 friend class Iterator; 183 friend class Iterator;
167 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); 184 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet);
168 }; 185 };
169 186
170 } // namespace cc 187 } // namespace cc
171 188
172 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ 189 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling.cc ('k') | cc/resources/picture_layer_tiling_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698