| 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 | |
| 27 namespace cc { | 21 namespace cc { |
| 28 | 22 |
| 29 template <typename LayerType> | 23 template <typename LayerType> |
| 30 class OcclusionTracker; | 24 class OcclusionTracker; |
| 31 class PictureLayerTiling; | 25 class PictureLayerTiling; |
| 32 class PicturePileImpl; | 26 class PicturePileImpl; |
| 33 | 27 |
| 34 class CC_EXPORT PictureLayerTilingClient { | 28 class CC_EXPORT PictureLayerTilingClient { |
| 35 public: | 29 public: |
| 36 // Create a tile at the given content_rect (in the contents scale of the | 30 // Create a tile at the given content_rect (in the contents scale of the |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // tiling is becoming recycled. This may include some tiles which are | 235 // tiling is becoming recycled. This may include some tiles which are |
| 242 // not in the the pending tiling (due to invalidations). This must | 236 // not in the the pending tiling (due to invalidations). This must |
| 243 // be called before DidBecomeActive, as it resets the active priority | 237 // be called before DidBecomeActive, as it resets the active priority |
| 244 // while DidBecomeActive promotes pending priority on a similar set of tiles. | 238 // while DidBecomeActive promotes pending priority on a similar set of tiles. |
| 245 void DidBecomeRecycled(); | 239 void DidBecomeRecycled(); |
| 246 | 240 |
| 247 bool NeedsUpdateForFrameAtTime(double frame_time_in_seconds) { | 241 bool NeedsUpdateForFrameAtTime(double frame_time_in_seconds) { |
| 248 return frame_time_in_seconds != last_impl_frame_time_in_seconds_; | 242 return frame_time_in_seconds != last_impl_frame_time_in_seconds_; |
| 249 } | 243 } |
| 250 | 244 |
| 251 void AsValueInto(base::debug::TracedValue* array) const; | 245 scoped_ptr<base::Value> AsValue() const; |
| 252 size_t GPUMemoryUsageInBytes() const; | 246 size_t GPUMemoryUsageInBytes() const; |
| 253 | 247 |
| 254 struct RectExpansionCache { | 248 struct RectExpansionCache { |
| 255 RectExpansionCache(); | 249 RectExpansionCache(); |
| 256 | 250 |
| 257 gfx::Rect previous_start; | 251 gfx::Rect previous_start; |
| 258 gfx::Rect previous_bounds; | 252 gfx::Rect previous_bounds; |
| 259 gfx::Rect previous_result; | 253 gfx::Rect previous_result; |
| 260 int64 previous_target; | 254 int64 previous_target; |
| 261 }; | 255 }; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 325 |
| 332 private: | 326 private: |
| 333 DISALLOW_ASSIGN(PictureLayerTiling); | 327 DISALLOW_ASSIGN(PictureLayerTiling); |
| 334 | 328 |
| 335 RectExpansionCache expansion_cache_; | 329 RectExpansionCache expansion_cache_; |
| 336 }; | 330 }; |
| 337 | 331 |
| 338 } // namespace cc | 332 } // namespace cc |
| 339 | 333 |
| 340 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 334 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |