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