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_H_ | 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 const gfx::Rect& bounding_rect, | 208 const gfx::Rect& bounding_rect, |
209 RectExpansionCache* cache); | 209 RectExpansionCache* cache); |
210 | 210 |
211 protected: | 211 protected: |
212 friend class CoverageIterator; | 212 friend class CoverageIterator; |
213 friend class PrioritizedTile; | 213 friend class PrioritizedTile; |
214 friend class TilingSetRasterQueueAll; | 214 friend class TilingSetRasterQueueAll; |
215 friend class TilingSetRasterQueueRequired; | 215 friend class TilingSetRasterQueueRequired; |
216 friend class TilingSetEvictionQueue; | 216 friend class TilingSetEvictionQueue; |
217 | 217 |
| 218 // PENDING VISIBLE RECT refers to the visible rect that will become current |
| 219 // upon activation (ie, the pending tree's visible rect). Tiles in this |
| 220 // region that are not part of the current visible rect are all handled |
| 221 // here. Note that when processing a pending tree, this rect is the same as |
| 222 // the visible rect so no tiles are processed in this case. |
| 223 enum PriorityRectType { |
| 224 VISIBLE_RECT, |
| 225 PENDING_VISIBLE_RECT, |
| 226 SKEWPORT_RECT, |
| 227 SOON_BORDER_RECT, |
| 228 EVENTUALLY_RECT |
| 229 }; |
| 230 |
218 using TileMapKey = std::pair<int, int>; | 231 using TileMapKey = std::pair<int, int>; |
219 using TileMap = base::ScopedPtrHashMap<TileMapKey, ScopedTilePtr>; | 232 using TileMap = base::ScopedPtrHashMap<TileMapKey, ScopedTilePtr>; |
220 | 233 |
221 struct FrameVisibleRect { | 234 struct FrameVisibleRect { |
222 gfx::Rect visible_rect_in_content_space; | 235 gfx::Rect visible_rect_in_content_space; |
223 double frame_time_in_seconds = 0.0; | 236 double frame_time_in_seconds = 0.0; |
224 }; | 237 }; |
225 | 238 |
226 PictureLayerTiling(WhichTree tree, | 239 PictureLayerTiling(WhichTree tree, |
227 float contents_scale, | 240 float contents_scale, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 visible_rect_history_[0].visible_rect_in_content_space = | 281 visible_rect_history_[0].visible_rect_in_content_space = |
269 visible_rect_in_content_space; | 282 visible_rect_in_content_space; |
270 // If we don't have a second history item, set it to the most recent one. | 283 // If we don't have a second history item, set it to the most recent one. |
271 if (visible_rect_history_[1].frame_time_in_seconds == 0.0) | 284 if (visible_rect_history_[1].frame_time_in_seconds == 0.0) |
272 visible_rect_history_[1] = visible_rect_history_[0]; | 285 visible_rect_history_[1] = visible_rect_history_[0]; |
273 } | 286 } |
274 bool IsTileOccludedOnCurrentTree(const Tile* tile) const; | 287 bool IsTileOccludedOnCurrentTree(const Tile* tile) const; |
275 bool ShouldCreateTileAt(int i, int j) const; | 288 bool ShouldCreateTileAt(int i, int j) const; |
276 bool IsTileOccluded(const Tile* tile) const; | 289 bool IsTileOccluded(const Tile* tile) const; |
277 void UpdateRequiredStatesOnTile(Tile* tile) const; | 290 void UpdateRequiredStatesOnTile(Tile* tile) const; |
278 PrioritizedTile MakePrioritizedTile(Tile* tile) const; | 291 PrioritizedTile MakePrioritizedTile( |
279 TilePriority ComputePriorityForTile(const Tile* tile) const; | 292 Tile* tile, |
| 293 PriorityRectType priority_rect_type) const; |
| 294 TilePriority ComputePriorityForTile( |
| 295 const Tile* tile, |
| 296 PriorityRectType priority_rect_type) const; |
| 297 PriorityRectType ComputePriorityRectTypeForTile(const Tile* tile) const; |
280 bool has_visible_rect_tiles() const { return has_visible_rect_tiles_; } | 298 bool has_visible_rect_tiles() const { return has_visible_rect_tiles_; } |
281 bool has_skewport_rect_tiles() const { return has_skewport_rect_tiles_; } | 299 bool has_skewport_rect_tiles() const { return has_skewport_rect_tiles_; } |
282 bool has_soon_border_rect_tiles() const { | 300 bool has_soon_border_rect_tiles() const { |
283 return has_soon_border_rect_tiles_; | 301 return has_soon_border_rect_tiles_; |
284 } | 302 } |
285 bool has_eventually_rect_tiles() const { return has_eventually_rect_tiles_; } | 303 bool has_eventually_rect_tiles() const { return has_eventually_rect_tiles_; } |
286 | 304 |
287 const gfx::Rect& current_visible_rect() const { | 305 const gfx::Rect& current_visible_rect() const { |
288 return current_visible_rect_; | 306 return current_visible_rect_; |
289 } | 307 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 365 |
348 private: | 366 private: |
349 DISALLOW_ASSIGN(PictureLayerTiling); | 367 DISALLOW_ASSIGN(PictureLayerTiling); |
350 | 368 |
351 RectExpansionCache expansion_cache_; | 369 RectExpansionCache expansion_cache_; |
352 }; | 370 }; |
353 | 371 |
354 } // namespace cc | 372 } // namespace cc |
355 | 373 |
356 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 374 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |