| 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_H_ | 5 #ifndef CC_TILES_PICTURE_LAYER_TILING_H_ |
| 6 #define CC_TILES_PICTURE_LAYER_TILING_H_ | 6 #define CC_TILES_PICTURE_LAYER_TILING_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 namespace cc { | 32 namespace cc { |
| 33 | 33 |
| 34 class RasterSource; | 34 class RasterSource; |
| 35 class PictureLayerTiling; | 35 class PictureLayerTiling; |
| 36 class PrioritizedTile; | 36 class PrioritizedTile; |
| 37 | 37 |
| 38 class CC_EXPORT PictureLayerTilingClient { | 38 class CC_EXPORT PictureLayerTilingClient { |
| 39 public: | 39 public: |
| 40 // Create a tile at the given content_rect (in the contents scale of the | 40 // Create a tile at the given content_rect (in the contents scale of the |
| 41 // tiling) This might return null if the client cannot create such a tile. | 41 // tiling) This might return null if the client cannot create such a tile. |
| 42 virtual ScopedTilePtr CreateTile(const Tile::CreateInfo& info) = 0; | 42 virtual std::unique_ptr<Tile> CreateTile(const Tile::CreateInfo& info) = 0; |
| 43 virtual gfx::Size CalculateTileSize( | 43 virtual gfx::Size CalculateTileSize( |
| 44 const gfx::Size& content_bounds) const = 0; | 44 const gfx::Size& content_bounds) const = 0; |
| 45 // This invalidation region defines the area (if any, it can by null) that | 45 // This invalidation region defines the area (if any, it can by null) that |
| 46 // tiles can not be shared between pending and active trees. | 46 // tiles can not be shared between pending and active trees. |
| 47 virtual const Region* GetPendingInvalidation() = 0; | 47 virtual const Region* GetPendingInvalidation() = 0; |
| 48 virtual const PictureLayerTiling* GetPendingOrActiveTwinTiling( | 48 virtual const PictureLayerTiling* GetPendingOrActiveTwinTiling( |
| 49 const PictureLayerTiling* tiling) const = 0; | 49 const PictureLayerTiling* tiling) const = 0; |
| 50 virtual bool HasValidTilePriorities() const = 0; | 50 virtual bool HasValidTilePriorities() const = 0; |
| 51 virtual bool RequiresHighResToDraw() const = 0; | 51 virtual bool RequiresHighResToDraw() const = 0; |
| 52 | 52 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // here. Note that when processing a pending tree, this rect is the same as | 261 // here. Note that when processing a pending tree, this rect is the same as |
| 262 // the visible rect so no tiles are processed in this case. | 262 // the visible rect so no tiles are processed in this case. |
| 263 enum PriorityRectType { | 263 enum PriorityRectType { |
| 264 VISIBLE_RECT, | 264 VISIBLE_RECT, |
| 265 PENDING_VISIBLE_RECT, | 265 PENDING_VISIBLE_RECT, |
| 266 SKEWPORT_RECT, | 266 SKEWPORT_RECT, |
| 267 SOON_BORDER_RECT, | 267 SOON_BORDER_RECT, |
| 268 EVENTUALLY_RECT | 268 EVENTUALLY_RECT |
| 269 }; | 269 }; |
| 270 | 270 |
| 271 using TileMap = std::unordered_map<TileMapKey, ScopedTilePtr, TileMapKeyHash>; | 271 using TileMap = |
| 272 std::unordered_map<TileMapKey, std::unique_ptr<Tile>, TileMapKeyHash>; |
| 272 | 273 |
| 273 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); | 274 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); |
| 274 void VerifyLiveTilesRect(bool is_on_recycle_tree) const; | 275 void VerifyLiveTilesRect(bool is_on_recycle_tree) const; |
| 275 Tile* CreateTile(const Tile::CreateInfo& info); | 276 Tile* CreateTile(const Tile::CreateInfo& info); |
| 276 ScopedTilePtr TakeTileAt(int i, int j); | 277 std::unique_ptr<Tile> TakeTileAt(int i, int j); |
| 277 // Returns true if the Tile existed and was removed from the tiling. | 278 // Returns true if the Tile existed and was removed from the tiling. |
| 278 bool RemoveTileAt(int i, int j); | 279 bool RemoveTileAt(int i, int j); |
| 279 bool TilingMatchesTileIndices(const PictureLayerTiling* twin) const; | 280 bool TilingMatchesTileIndices(const PictureLayerTiling* twin) const; |
| 280 | 281 |
| 281 // Save the required data for computing tile priorities later. | 282 // Save the required data for computing tile priorities later. |
| 282 void SetTilePriorityRects(const gfx::SizeF& content_to_screen_scale, | 283 void SetTilePriorityRects(const gfx::SizeF& content_to_screen_scale, |
| 283 const gfx::Rect& visible_rect_in_content_space, | 284 const gfx::Rect& visible_rect_in_content_space, |
| 284 const gfx::Rect& skewport, | 285 const gfx::Rect& skewport, |
| 285 const gfx::Rect& soon_border_rect, | 286 const gfx::Rect& soon_border_rect, |
| 286 const gfx::Rect& eventually_rect, | 287 const gfx::Rect& eventually_rect, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 bool has_eventually_rect_tiles_ = false; | 361 bool has_eventually_rect_tiles_ = false; |
| 361 bool all_tiles_done_ = true; | 362 bool all_tiles_done_ = true; |
| 362 | 363 |
| 363 private: | 364 private: |
| 364 DISALLOW_COPY_AND_ASSIGN(PictureLayerTiling); | 365 DISALLOW_COPY_AND_ASSIGN(PictureLayerTiling); |
| 365 }; | 366 }; |
| 366 | 367 |
| 367 } // namespace cc | 368 } // namespace cc |
| 368 | 369 |
| 369 #endif // CC_TILES_PICTURE_LAYER_TILING_H_ | 370 #endif // CC_TILES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |