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_TILES_PICTURE_LAYER_TILING_SET_H_ | 5 #ifndef CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
6 #define CC_TILES_PICTURE_LAYER_TILING_SET_H_ | 6 #define CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 float max_acceptable_high_res_scale_key, | 56 float max_acceptable_high_res_scale_key, |
57 const std::vector<PictureLayerTiling*>& needed_tilings, | 57 const std::vector<PictureLayerTiling*>& needed_tilings, |
58 PictureLayerTilingSet* twin_set); | 58 PictureLayerTilingSet* twin_set); |
59 void RemoveNonIdealTilings(); | 59 void RemoveNonIdealTilings(); |
60 | 60 |
61 // This function is called on the active tree during activation. | 61 // This function is called on the active tree during activation. |
62 void UpdateTilingsToCurrentRasterSourceForActivation( | 62 void UpdateTilingsToCurrentRasterSourceForActivation( |
63 scoped_refptr<RasterSource> raster_source, | 63 scoped_refptr<RasterSource> raster_source, |
64 const PictureLayerTilingSet* pending_twin_set, | 64 const PictureLayerTilingSet* pending_twin_set, |
65 const Region& layer_invalidation, | 65 const Region& layer_invalidation, |
66 float minimum_contents_scale_key, | 66 float minimum_contents_scale, |
67 float maximum_contents_scale_key); | 67 float maximum_contents_scale); |
68 | 68 |
69 // This function is called on the sync tree during commit. | 69 // This function is called on the sync tree during commit. |
70 void UpdateTilingsToCurrentRasterSourceForCommit( | 70 void UpdateTilingsToCurrentRasterSourceForCommit( |
71 scoped_refptr<RasterSource> raster_source, | 71 scoped_refptr<RasterSource> raster_source, |
72 const Region& layer_invalidation, | 72 const Region& layer_invalidation, |
73 float minimum_contents_scale_key, | 73 float minimum_contents_scale, |
74 float maximum_contents_scale_key); | 74 float maximum_contents_scale); |
75 | 75 |
76 // This function is called on the sync tree right after commit. | 76 // This function is called on the sync tree right after commit. |
77 void UpdateRasterSourceDueToLCDChange( | 77 void UpdateRasterSourceDueToLCDChange( |
78 scoped_refptr<RasterSource> raster_source, | 78 scoped_refptr<RasterSource> raster_source, |
79 const Region& layer_invalidation); | 79 const Region& layer_invalidation); |
80 | 80 |
81 PictureLayerTiling* AddTiling(float contents_scale_key, | 81 PictureLayerTiling* AddTiling(float contents_scale, |
82 scoped_refptr<RasterSource> raster_source); | 82 scoped_refptr<RasterSource> raster_source); |
83 size_t num_tilings() const { return tilings_.size(); } | 83 size_t num_tilings() const { return tilings_.size(); } |
84 int NumHighResTilings() const; | 84 int NumHighResTilings() const; |
85 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx].get(); } | 85 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx].get(); } |
86 const PictureLayerTiling* tiling_at(size_t idx) const { | 86 const PictureLayerTiling* tiling_at(size_t idx) const { |
87 return tilings_[idx].get(); | 87 return tilings_[idx].get(); |
88 } | 88 } |
89 WhichTree tree() const { return tree_; } | 89 WhichTree tree() const { return tree_; } |
90 | 90 |
91 PictureLayerTiling* FindTilingWithScaleKey(float scale_key) const; | 91 PictureLayerTiling* FindTilingWithScaleKey(float scale_key) const; |
(...skipping 26 matching lines...) Expand all Loading... |
118 void RemoveAllTiles(); | 118 void RemoveAllTiles(); |
119 | 119 |
120 // Update the rects and priorities for tiles based on the given information. | 120 // Update the rects and priorities for tiles based on the given information. |
121 // Returns true if PrepareTiles is required. | 121 // Returns true if PrepareTiles is required. |
122 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, | 122 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, |
123 float ideal_contents_scale, | 123 float ideal_contents_scale, |
124 double current_frame_time_in_seconds, | 124 double current_frame_time_in_seconds, |
125 const Occlusion& occlusion_in_layer_space, | 125 const Occlusion& occlusion_in_layer_space, |
126 bool can_require_tiles_for_activation); | 126 bool can_require_tiles_for_activation); |
127 | 127 |
128 void SetAspectRatio(float ratio); | |
129 float aspect_ratio() const { return aspect_ratio_; } | |
130 | |
131 void GetAllPrioritizedTilesForTracing( | 128 void GetAllPrioritizedTilesForTracing( |
132 std::vector<PrioritizedTile>* prioritized_tiles) const; | 129 std::vector<PrioritizedTile>* prioritized_tiles) const; |
133 | 130 |
134 // For a given rect, iterates through tiles that can fill it. If no | 131 // For a given rect, iterates through tiles that can fill it. If no |
135 // set of tiles with resources can fill the rect, then it will iterate | 132 // set of tiles with resources can fill the rect, then it will iterate |
136 // through null tiles with valid geometry_rect() until the rect is full. | 133 // through null tiles with valid geometry_rect() until the rect is full. |
137 // If all tiles have resources, the union of all geometry_rects will | 134 // If all tiles have resources, the union of all geometry_rects will |
138 // exactly fill rect with no overlap. | 135 // exactly fill rect with no overlap. |
139 class CC_EXPORT CoverageIterator { | 136 class CC_EXPORT CoverageIterator { |
140 public: | 137 public: |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 std::list<FrameVisibleRect> visible_rect_history_; | 252 std::list<FrameVisibleRect> visible_rect_history_; |
256 StateSinceLastTilePriorityUpdate state_since_last_tile_priority_update_; | 253 StateSinceLastTilePriorityUpdate state_since_last_tile_priority_update_; |
257 | 254 |
258 scoped_refptr<RasterSource> raster_source_; | 255 scoped_refptr<RasterSource> raster_source_; |
259 | 256 |
260 gfx::Rect visible_rect_in_layer_space_; | 257 gfx::Rect visible_rect_in_layer_space_; |
261 gfx::Rect skewport_in_layer_space_; | 258 gfx::Rect skewport_in_layer_space_; |
262 gfx::Rect soon_border_rect_in_layer_space_; | 259 gfx::Rect soon_border_rect_in_layer_space_; |
263 gfx::Rect eventually_rect_in_layer_space_; | 260 gfx::Rect eventually_rect_in_layer_space_; |
264 | 261 |
265 float aspect_ratio_ = 1.f; | |
266 | |
267 friend class Iterator; | 262 friend class Iterator; |
268 | 263 |
269 private: | 264 private: |
270 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 265 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
271 }; | 266 }; |
272 | 267 |
273 } // namespace cc | 268 } // namespace cc |
274 | 269 |
275 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ | 270 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
OLD | NEW |