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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/resources/platform_color.h" | 9 #include "cc/resources/platform_color.h" |
10 #include "cc/resources/raster_worker_pool.h" | 10 #include "cc/resources/raster_worker_pool.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 Mode mode_; | 98 Mode mode_; |
99 SkColor solid_color_; | 99 SkColor solid_color_; |
100 | 100 |
101 // TODO(reveman): Eliminate the need for both |resource_id_| | 101 // TODO(reveman): Eliminate the need for both |resource_id_| |
102 // and |resource| by re-factoring the "force upload" | 102 // and |resource| by re-factoring the "force upload" |
103 // mechanism. crbug.com/245767 | 103 // mechanism. crbug.com/245767 |
104 ResourceProvider::ResourceId resource_id_; | 104 ResourceProvider::ResourceId resource_id_; |
105 scoped_ptr<ResourcePool::Resource> resource_; | 105 scoped_ptr<ResourcePool::Resource> resource_; |
106 GLenum resource_format_; | 106 GLenum resource_format_; |
107 bool forced_upload_; | 107 bool forced_upload_; |
| 108 RasterWorkerPool::RasterTask raster_task_; |
108 }; | 109 }; |
109 | 110 |
110 | 111 |
111 ManagedTileState(); | 112 ManagedTileState(); |
112 ~ManagedTileState(); | 113 ~ManagedTileState(); |
113 | 114 |
114 scoped_ptr<base::Value> AsValue() const; | 115 scoped_ptr<base::Value> AsValue() const; |
115 | 116 |
116 // Persisted state: valid all the time. | 117 // Persisted state: valid all the time. |
117 TileVersion tile_version; | 118 TileVersion tile_versions[NUM_RASTER_MODES]; |
| 119 TileRasterMode raster_mode; |
| 120 |
118 bool picture_pile_analyzed; | 121 bool picture_pile_analyzed; |
119 PicturePileImpl::Analysis picture_pile_analysis; | 122 PicturePileImpl::Analysis picture_pile_analysis; |
120 RasterWorkerPool::RasterTask raster_task; | |
121 | 123 |
122 // Ephemeral state, valid only during TileManager::ManageTiles. | 124 // Ephemeral state, valid only during TileManager::ManageTiles. |
123 bool is_in_never_bin_on_both_trees() const { | 125 bool is_in_never_bin_on_both_trees() const { |
124 return bin[HIGH_PRIORITY_BIN] == NEVER_BIN && | 126 return bin[HIGH_PRIORITY_BIN] == NEVER_BIN && |
125 bin[LOW_PRIORITY_BIN] == NEVER_BIN; | 127 bin[LOW_PRIORITY_BIN] == NEVER_BIN; |
126 } | 128 } |
127 bool is_in_now_bin_on_either_tree() const { | 129 bool is_in_now_bin_on_either_tree() const { |
128 return bin[HIGH_PRIORITY_BIN] == NOW_BIN || | 130 return bin[HIGH_PRIORITY_BIN] == NOW_BIN || |
129 bin[LOW_PRIORITY_BIN] == NOW_BIN; | 131 bin[LOW_PRIORITY_BIN] == NOW_BIN; |
130 } | 132 } |
131 | 133 |
132 TileManagerBin bin[NUM_BIN_PRIORITIES]; | 134 TileManagerBin bin[NUM_BIN_PRIORITIES]; |
133 TileManagerBin tree_bin[NUM_TREES]; | 135 TileManagerBin tree_bin[NUM_TREES]; |
134 | 136 |
135 // The bin that the tile would have if the GPU memory manager had | 137 // The bin that the tile would have if the GPU memory manager had |
136 // a maximally permissive policy, send to the GPU memory manager | 138 // a maximally permissive policy, send to the GPU memory manager |
137 // to determine policy. | 139 // to determine policy. |
138 TileManagerBin gpu_memmgr_stats_bin; | 140 TileManagerBin gpu_memmgr_stats_bin; |
139 TileResolution resolution; | 141 TileResolution resolution; |
140 bool required_for_activation; | 142 bool required_for_activation; |
141 float time_to_needed_in_seconds; | 143 float time_to_needed_in_seconds; |
142 float distance_to_visible_in_pixels; | 144 float distance_to_visible_in_pixels; |
143 }; | 145 }; |
144 | 146 |
145 } // namespace cc | 147 } // namespace cc |
146 | 148 |
147 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ | 149 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ |
OLD | NEW |