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