| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_MANAGED_TILE_STATE_H_ | 5 #ifndef CC_RESOURCES_MANAGED_TILE_STATE_H_ |
| 6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_ | 6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_ |
| 7 | 7 |
| 8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/resources/platform_color.h" | 10 #include "cc/resources/platform_color.h" |
| 11 #include "cc/resources/raster_worker_pool.h" |
| 11 #include "cc/resources/resource_pool.h" | 12 #include "cc/resources/resource_pool.h" |
| 12 #include "cc/resources/resource_provider.h" | 13 #include "cc/resources/resource_provider.h" |
| 13 #include "cc/resources/tile_manager.h" | 14 #include "cc/resources/tile_manager.h" |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 | 17 |
| 17 enum DrawingInfoMemoryState { | 18 enum DrawingInfoMemoryState { |
| 18 NOT_ALLOWED_TO_USE_MEMORY, | 19 NOT_ALLOWED_TO_USE_MEMORY, |
| 19 CAN_USE_MEMORY, | 20 CAN_USE_MEMORY, |
| 20 USING_UNRELEASABLE_MEMORY, | 21 USING_UNRELEASABLE_MEMORY, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 DrawingInfoMemoryState memory_state_; | 104 DrawingInfoMemoryState memory_state_; |
| 104 bool forced_upload_; | 105 bool forced_upload_; |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 | 108 |
| 108 ManagedTileState(); | 109 ManagedTileState(); |
| 109 ~ManagedTileState(); | 110 ~ManagedTileState(); |
| 110 scoped_ptr<base::Value> AsValue() const; | 111 scoped_ptr<base::Value> AsValue() const; |
| 111 | 112 |
| 112 // Persisted state: valid all the time. | 113 // Persisted state: valid all the time. |
| 113 typedef base::hash_set<uint32_t> PixelRefSet; | 114 TileManager::PixelRefSet decoded_pixel_refs; |
| 114 PixelRefSet decoded_pixel_refs; | |
| 115 DrawingInfo drawing_info; | 115 DrawingInfo drawing_info; |
| 116 bool picture_pile_analyzed; |
| 116 PicturePileImpl::Analysis picture_pile_analysis; | 117 PicturePileImpl::Analysis picture_pile_analysis; |
| 117 bool picture_pile_analyzed; | 118 RasterWorkerPool::Task raster_task; |
| 118 | 119 |
| 119 // Ephemeral state, valid only during TileManager::ManageTiles. | 120 // Ephemeral state, valid only during TileManager::ManageTiles. |
| 120 bool is_in_never_bin_on_both_trees() const { | 121 bool is_in_never_bin_on_both_trees() const { |
| 121 return bin[HIGH_PRIORITY_BIN] == NEVER_BIN && | 122 return bin[HIGH_PRIORITY_BIN] == NEVER_BIN && |
| 122 bin[LOW_PRIORITY_BIN] == NEVER_BIN; | 123 bin[LOW_PRIORITY_BIN] == NEVER_BIN; |
| 123 } | 124 } |
| 124 bool is_in_now_bin_on_either_tree() const { | 125 bool is_in_now_bin_on_either_tree() const { |
| 125 return bin[HIGH_PRIORITY_BIN] == NOW_BIN || | 126 return bin[HIGH_PRIORITY_BIN] == NOW_BIN || |
| 126 bin[LOW_PRIORITY_BIN] == NOW_BIN; | 127 bin[LOW_PRIORITY_BIN] == NOW_BIN; |
| 127 } | 128 } |
| 128 | 129 |
| 129 TileManagerBin bin[NUM_BIN_PRIORITIES]; | 130 TileManagerBin bin[NUM_BIN_PRIORITIES]; |
| 130 TileManagerBin tree_bin[NUM_TREES]; | 131 TileManagerBin tree_bin[NUM_TREES]; |
| 131 | 132 |
| 132 // The bin that the tile would have if the GPU memory manager had | 133 // The bin that the tile would have if the GPU memory manager had |
| 133 // a maximally permissive policy, send to the GPU memory manager | 134 // a maximally permissive policy, send to the GPU memory manager |
| 134 // to determine policy. | 135 // to determine policy. |
| 135 TileManagerBin gpu_memmgr_stats_bin; | 136 TileManagerBin gpu_memmgr_stats_bin; |
| 136 TileResolution resolution; | 137 TileResolution resolution; |
| 137 float time_to_needed_in_seconds; | 138 float time_to_needed_in_seconds; |
| 138 float distance_to_visible_in_pixels; | 139 float distance_to_visible_in_pixels; |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 } // namespace cc | 142 } // namespace cc |
| 142 | 143 |
| 143 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ | 144 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ |
| OLD | NEW |