| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 typedef base::hash_set<uint32_t> PixelRefSet; |
| 114 PixelRefSet decoded_pixel_refs; | 115 PixelRefSet decoded_pixel_refs; |
| 115 DrawingInfo drawing_info; | 116 DrawingInfo drawing_info; |
| 117 bool picture_pile_analyzed; |
| 116 PicturePileImpl::Analysis picture_pile_analysis; | 118 PicturePileImpl::Analysis picture_pile_analysis; |
| 117 bool picture_pile_analyzed; | 119 RasterWorkerPool::Task raster_task; |
| 118 | 120 |
| 119 // Ephemeral state, valid only during TileManager::ManageTiles. | 121 // Ephemeral state, valid only during TileManager::ManageTiles. |
| 120 bool is_in_never_bin_on_both_trees() const { | 122 bool is_in_never_bin_on_both_trees() const { |
| 121 return bin[HIGH_PRIORITY_BIN] == NEVER_BIN && | 123 return bin[HIGH_PRIORITY_BIN] == NEVER_BIN && |
| 122 bin[LOW_PRIORITY_BIN] == NEVER_BIN; | 124 bin[LOW_PRIORITY_BIN] == NEVER_BIN; |
| 123 } | 125 } |
| 124 bool is_in_now_bin_on_either_tree() const { | 126 bool is_in_now_bin_on_either_tree() const { |
| 125 return bin[HIGH_PRIORITY_BIN] == NOW_BIN || | 127 return bin[HIGH_PRIORITY_BIN] == NOW_BIN || |
| 126 bin[LOW_PRIORITY_BIN] == NOW_BIN; | 128 bin[LOW_PRIORITY_BIN] == NOW_BIN; |
| 127 } | 129 } |
| 128 | 130 |
| 129 TileManagerBin bin[NUM_BIN_PRIORITIES]; | 131 TileManagerBin bin[NUM_BIN_PRIORITIES]; |
| 130 TileManagerBin tree_bin[NUM_TREES]; | 132 TileManagerBin tree_bin[NUM_TREES]; |
| 131 | 133 |
| 132 // The bin that the tile would have if the GPU memory manager had | 134 // The bin that the tile would have if the GPU memory manager had |
| 133 // a maximally permissive policy, send to the GPU memory manager | 135 // a maximally permissive policy, send to the GPU memory manager |
| 134 // to determine policy. | 136 // to determine policy. |
| 135 TileManagerBin gpu_memmgr_stats_bin; | 137 TileManagerBin gpu_memmgr_stats_bin; |
| 136 TileResolution resolution; | 138 TileResolution resolution; |
| 137 float time_to_needed_in_seconds; | 139 float time_to_needed_in_seconds; |
| 138 float distance_to_visible_in_pixels; | 140 float distance_to_visible_in_pixels; |
| 139 }; | 141 }; |
| 140 | 142 |
| 141 } // namespace cc | 143 } // namespace cc |
| 142 | 144 |
| 143 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ | 145 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ |
| OLD | NEW |