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 <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
15 #include "cc/base/region.h" | 15 #include "cc/base/region.h" |
16 #include "cc/base/tiling_data.h" | 16 #include "cc/base/tiling_data.h" |
17 #include "cc/resources/tile.h" | 17 #include "cc/resources/tile.h" |
18 #include "cc/resources/tile_priority.h" | 18 #include "cc/resources/tile_priority.h" |
19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
20 | 20 |
| 21 namespace base { |
| 22 namespace debug { |
| 23 class TracedValue; |
| 24 } |
| 25 } |
| 26 |
21 namespace cc { | 27 namespace cc { |
22 | 28 |
23 template <typename LayerType> | 29 template <typename LayerType> |
24 class OcclusionTracker; | 30 class OcclusionTracker; |
25 class PictureLayerTiling; | 31 class PictureLayerTiling; |
26 class PicturePileImpl; | 32 class PicturePileImpl; |
27 | 33 |
28 class CC_EXPORT PictureLayerTilingClient { | 34 class CC_EXPORT PictureLayerTilingClient { |
29 public: | 35 public: |
30 // 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 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // tiling is becoming recycled. This may include some tiles which are | 237 // tiling is becoming recycled. This may include some tiles which are |
232 // not in the the pending tiling (due to invalidations). This must | 238 // not in the the pending tiling (due to invalidations). This must |
233 // be called before DidBecomeActive, as it resets the active priority | 239 // be called before DidBecomeActive, as it resets the active priority |
234 // while DidBecomeActive promotes pending priority on a similar set of tiles. | 240 // while DidBecomeActive promotes pending priority on a similar set of tiles. |
235 void DidBecomeRecycled(); | 241 void DidBecomeRecycled(); |
236 | 242 |
237 bool NeedsUpdateForFrameAtTime(double frame_time_in_seconds) { | 243 bool NeedsUpdateForFrameAtTime(double frame_time_in_seconds) { |
238 return frame_time_in_seconds != last_impl_frame_time_in_seconds_; | 244 return frame_time_in_seconds != last_impl_frame_time_in_seconds_; |
239 } | 245 } |
240 | 246 |
241 scoped_ptr<base::Value> AsValue() const; | 247 void AsValueInto(base::debug::TracedValue* array) const; |
242 size_t GPUMemoryUsageInBytes() const; | 248 size_t GPUMemoryUsageInBytes() const; |
243 | 249 |
244 struct RectExpansionCache { | 250 struct RectExpansionCache { |
245 RectExpansionCache(); | 251 RectExpansionCache(); |
246 | 252 |
247 gfx::Rect previous_start; | 253 gfx::Rect previous_start; |
248 gfx::Rect previous_bounds; | 254 gfx::Rect previous_bounds; |
249 gfx::Rect previous_result; | 255 gfx::Rect previous_result; |
250 int64 previous_target; | 256 int64 previous_target; |
251 }; | 257 }; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 327 |
322 private: | 328 private: |
323 DISALLOW_ASSIGN(PictureLayerTiling); | 329 DISALLOW_ASSIGN(PictureLayerTiling); |
324 | 330 |
325 RectExpansionCache expansion_cache_; | 331 RectExpansionCache expansion_cache_; |
326 }; | 332 }; |
327 | 333 |
328 } // namespace cc | 334 } // namespace cc |
329 | 335 |
330 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 336 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |