| 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_TILE_MANAGER_H_ | 5 #ifndef CC_TILE_MANAGER_H_ |
| 6 #define CC_TILE_MANAGER_H_ | 6 #define CC_TILE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/hash_tables.h" | 13 #include "base/hash_tables.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "cc/memory_history.h" | 16 #include "cc/memory_history.h" |
| 17 #include "cc/rendering_stats.h" | 17 #include "cc/rendering_stats.h" |
| 18 #include "cc/resource_pool.h" | 18 #include "cc/resource_pool.h" |
| 19 #include "cc/tile_drawing_info.h" |
| 19 #include "cc/tile_priority.h" | 20 #include "cc/tile_priority.h" |
| 20 #include "cc/worker_pool.h" | 21 #include "cc/worker_pool.h" |
| 21 | 22 |
| 22 namespace cc { | 23 namespace cc { |
| 23 class RasterWorkerPool; | 24 class RasterWorkerPool; |
| 24 class ResourceProvider; | 25 class ResourceProvider; |
| 25 class Tile; | 26 class Tile; |
| 26 class TileVersion; | 27 class TileVersion; |
| 27 | 28 |
| 28 class CC_EXPORT TileManagerClient { | 29 class CC_EXPORT TileManagerClient { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // This is state that is specific to a tile that is | 69 // This is state that is specific to a tile that is |
| 69 // managed by the TileManager. | 70 // managed by the TileManager. |
| 70 class CC_EXPORT ManagedTileState { | 71 class CC_EXPORT ManagedTileState { |
| 71 public: | 72 public: |
| 72 ManagedTileState(); | 73 ManagedTileState(); |
| 73 ~ManagedTileState(); | 74 ~ManagedTileState(); |
| 74 scoped_ptr<base::Value> AsValue() const; | 75 scoped_ptr<base::Value> AsValue() const; |
| 75 | 76 |
| 76 // Persisted state: valid all the time. | 77 // Persisted state: valid all the time. |
| 77 bool can_use_gpu_memory; | 78 bool can_use_gpu_memory; |
| 78 bool can_be_freed; | |
| 79 scoped_ptr<ResourcePool::Resource> resource; | |
| 80 bool resource_is_being_initialized; | |
| 81 bool contents_swizzled; | |
| 82 bool need_to_gather_pixel_refs; | 79 bool need_to_gather_pixel_refs; |
| 83 std::list<skia::LazyPixelRef*> pending_pixel_refs; | 80 std::list<skia::LazyPixelRef*> pending_pixel_refs; |
| 84 TileRasterState raster_state; | 81 TileRasterState raster_state; |
| 82 TileDrawingInfo drawing_info; |
| 85 | 83 |
| 86 // Ephemeral state, valid only during Manage. | 84 // Ephemeral state, valid only during Manage. |
| 87 TileManagerBin bin[NUM_BIN_PRIORITIES]; | 85 TileManagerBin bin[NUM_BIN_PRIORITIES]; |
| 88 TileManagerBin tree_bin[NUM_TREES]; | 86 TileManagerBin tree_bin[NUM_TREES]; |
| 89 // The bin that the tile would have if the GPU memory manager had a maximally
permissive policy, | 87 // The bin that the tile would have if the GPU memory manager had a maximally
permissive policy, |
| 90 // send to the GPU memory manager to determine policy. | 88 // send to the GPU memory manager to determine policy. |
| 91 TileManagerBin gpu_memmgr_stats_bin; | 89 TileManagerBin gpu_memmgr_stats_bin; |
| 92 TileResolution resolution; | 90 TileResolution resolution; |
| 93 float time_to_needed_in_seconds; | 91 float time_to_needed_in_seconds; |
| 94 float distance_to_visible_in_pixels; | 92 float distance_to_visible_in_pixels; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 bool did_schedule_cheap_tasks_; | 232 bool did_schedule_cheap_tasks_; |
| 235 bool allow_cheap_tasks_; | 233 bool allow_cheap_tasks_; |
| 236 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; | 234 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; |
| 237 | 235 |
| 238 DISALLOW_COPY_AND_ASSIGN(TileManager); | 236 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 239 }; | 237 }; |
| 240 | 238 |
| 241 } // namespace cc | 239 } // namespace cc |
| 242 | 240 |
| 243 #endif // CC_TILE_MANAGER_H_ | 241 #endif // CC_TILE_MANAGER_H_ |
| OLD | NEW |