| 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 <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
| 16 #include "cc/base/region.h" | 16 #include "cc/base/region.h" |
| 17 #include "cc/base/tiling_data.h" | 17 #include "cc/base/tiling_data.h" |
| 18 #include "cc/resources/tile.h" | 18 #include "cc/resources/tile.h" |
| 19 #include "cc/resources/tile_priority.h" | 19 #include "cc/resources/tile_priority.h" |
| 20 #include "cc/trees/occlusion.h" |
| 20 #include "ui/gfx/rect.h" | 21 #include "ui/gfx/rect.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 namespace debug { | 24 namespace debug { |
| 24 class TracedValue; | 25 class TracedValue; |
| 25 } | 26 } |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace cc { | 29 namespace cc { |
| 29 | 30 |
| 30 template <typename LayerType> | |
| 31 class OcclusionTracker; | |
| 32 class PictureLayerTiling; | 31 class PictureLayerTiling; |
| 33 class PicturePileImpl; | 32 class PicturePileImpl; |
| 34 | 33 |
| 35 class CC_EXPORT PictureLayerTilingClient { | 34 class CC_EXPORT PictureLayerTilingClient { |
| 36 public: | 35 public: |
| 37 // Create a tile at the given content_rect (in the contents scale of the | 36 // Create a tile at the given content_rect (in the contents scale of the |
| 38 // tiling) This might return null if the client cannot create such a tile. | 37 // tiling) This might return null if the client cannot create such a tile. |
| 39 virtual scoped_refptr<Tile> CreateTile( | 38 virtual scoped_refptr<Tile> CreateTile( |
| 40 PictureLayerTiling* tiling, | 39 PictureLayerTiling* tiling, |
| 41 const gfx::Rect& content_rect) = 0; | 40 const gfx::Rect& content_rect) = 0; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 int left_; | 229 int left_; |
| 231 int top_; | 230 int top_; |
| 232 int right_; | 231 int right_; |
| 233 int bottom_; | 232 int bottom_; |
| 234 | 233 |
| 235 friend class PictureLayerTiling; | 234 friend class PictureLayerTiling; |
| 236 }; | 235 }; |
| 237 | 236 |
| 238 void Reset(); | 237 void Reset(); |
| 239 | 238 |
| 240 void UpdateTilePriorities( | 239 void UpdateTilePriorities(WhichTree tree, |
| 241 WhichTree tree, | 240 const gfx::Rect& visible_layer_rect, |
| 242 const gfx::Rect& visible_layer_rect, | 241 float ideal_contents_scale, |
| 243 float ideal_contents_scale, | 242 double current_frame_time_in_seconds, |
| 244 double current_frame_time_in_seconds, | 243 const Occlusion& occlusion_in_layer_space); |
| 245 const OcclusionTracker<LayerImpl>* occlusion_tracker, | |
| 246 const LayerImpl* render_target, | |
| 247 const gfx::Transform& draw_transform); | |
| 248 | 244 |
| 249 // Copies the src_tree priority into the dst_tree priority for all tiles. | 245 // Copies the src_tree priority into the dst_tree priority for all tiles. |
| 250 // The src_tree priority is reset to the lowest priority possible. This | 246 // The src_tree priority is reset to the lowest priority possible. This |
| 251 // also updates the pile on each tile to be the current client's pile. | 247 // also updates the pile on each tile to be the current client's pile. |
| 252 void DidBecomeActive(); | 248 void DidBecomeActive(); |
| 253 | 249 |
| 254 // Resets the active priority for all tiles in a tiling, when an active | 250 // Resets the active priority for all tiles in a tiling, when an active |
| 255 // tiling is becoming recycled. This may include some tiles which are | 251 // tiling is becoming recycled. This may include some tiles which are |
| 256 // not in the the pending tiling (due to invalidations). This must | 252 // not in the the pending tiling (due to invalidations). This must |
| 257 // be called before DidBecomeActive, as it resets the active priority | 253 // be called before DidBecomeActive, as it resets the active priority |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 357 |
| 362 private: | 358 private: |
| 363 DISALLOW_ASSIGN(PictureLayerTiling); | 359 DISALLOW_ASSIGN(PictureLayerTiling); |
| 364 | 360 |
| 365 RectExpansionCache expansion_cache_; | 361 RectExpansionCache expansion_cache_; |
| 366 }; | 362 }; |
| 367 | 363 |
| 368 } // namespace cc | 364 } // namespace cc |
| 369 | 365 |
| 370 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 366 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |