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" | |
9 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
10 #include "cc/resources/platform_color.h" | 9 #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; | |
118 TileVersion tile_version; | 116 TileVersion tile_version; |
| 117 bool picture_pile_analyzed; |
119 PicturePileImpl::Analysis picture_pile_analysis; | 118 PicturePileImpl::Analysis picture_pile_analysis; |
120 bool picture_pile_analyzed; | 119 RasterWorkerPool::Task raster_task; |
121 | 120 |
122 // Ephemeral state, valid only during TileManager::ManageTiles. | 121 // Ephemeral state, valid only during TileManager::ManageTiles. |
123 bool is_in_never_bin_on_both_trees() const { | 122 bool is_in_never_bin_on_both_trees() const { |
124 return bin[HIGH_PRIORITY_BIN] == NEVER_BIN && | 123 return bin[HIGH_PRIORITY_BIN] == NEVER_BIN && |
125 bin[LOW_PRIORITY_BIN] == NEVER_BIN; | 124 bin[LOW_PRIORITY_BIN] == NEVER_BIN; |
126 } | 125 } |
127 bool is_in_now_bin_on_either_tree() const { | 126 bool is_in_now_bin_on_either_tree() const { |
128 return bin[HIGH_PRIORITY_BIN] == NOW_BIN || | 127 return bin[HIGH_PRIORITY_BIN] == NOW_BIN || |
129 bin[LOW_PRIORITY_BIN] == NOW_BIN; | 128 bin[LOW_PRIORITY_BIN] == NOW_BIN; |
130 } | 129 } |
131 | 130 |
132 TileManagerBin bin[NUM_BIN_PRIORITIES]; | 131 TileManagerBin bin[NUM_BIN_PRIORITIES]; |
133 TileManagerBin tree_bin[NUM_TREES]; | 132 TileManagerBin tree_bin[NUM_TREES]; |
134 | 133 |
135 // 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 |
136 // a maximally permissive policy, send to the GPU memory manager | 135 // a maximally permissive policy, send to the GPU memory manager |
137 // to determine policy. | 136 // to determine policy. |
138 TileManagerBin gpu_memmgr_stats_bin; | 137 TileManagerBin gpu_memmgr_stats_bin; |
139 TileResolution resolution; | 138 TileResolution resolution; |
140 bool required_for_activation; | 139 bool required_for_activation; |
141 float time_to_needed_in_seconds; | 140 float time_to_needed_in_seconds; |
142 float distance_to_visible_in_pixels; | 141 float distance_to_visible_in_pixels; |
143 }; | 142 }; |
144 | 143 |
145 } // namespace cc | 144 } // namespace cc |
146 | 145 |
147 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ | 146 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ |
OLD | NEW |