OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "cc/resources/tile_manager.h" | 5 #include "cc/resources/tile_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 state->SetInteger("completed_count", stats.completed_count); | 161 state->SetInteger("completed_count", stats.completed_count); |
162 state->SetInteger("canceled_count", stats.canceled_count); | 162 state->SetInteger("canceled_count", stats.canceled_count); |
163 return state.PassAs<base::Value>(); | 163 return state.PassAs<base::Value>(); |
164 } | 164 } |
165 | 165 |
166 // static | 166 // static |
167 scoped_ptr<TileManager> TileManager::Create( | 167 scoped_ptr<TileManager> TileManager::Create( |
168 TileManagerClient* client, | 168 TileManagerClient* client, |
169 ResourceProvider* resource_provider, | 169 ResourceProvider* resource_provider, |
170 ContextProvider* context_provider, | 170 ContextProvider* context_provider, |
171 size_t num_raster_threads, | |
172 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 171 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
173 bool use_map_image, | 172 bool use_map_image, |
174 size_t max_transfer_buffer_usage_bytes, | 173 size_t max_transfer_buffer_usage_bytes, |
175 size_t max_raster_usage_bytes, | 174 size_t max_raster_usage_bytes, |
176 GLenum map_image_texture_target) { | 175 GLenum map_image_texture_target) { |
177 return make_scoped_ptr( | 176 return make_scoped_ptr( |
178 new TileManager(client, | 177 new TileManager(client, |
179 resource_provider, | 178 resource_provider, |
180 use_map_image ? | 179 use_map_image ? |
181 ImageRasterWorkerPool::Create( | 180 ImageRasterWorkerPool::Create( |
182 resource_provider, | 181 resource_provider, |
183 context_provider, | 182 context_provider, |
184 num_raster_threads, | |
185 map_image_texture_target) : | 183 map_image_texture_target) : |
186 PixelBufferRasterWorkerPool::Create( | 184 PixelBufferRasterWorkerPool::Create( |
187 resource_provider, | 185 resource_provider, |
188 context_provider, | 186 context_provider, |
189 num_raster_threads, | |
190 max_transfer_buffer_usage_bytes), | 187 max_transfer_buffer_usage_bytes), |
191 num_raster_threads, | |
192 max_raster_usage_bytes, | 188 max_raster_usage_bytes, |
193 rendering_stats_instrumentation)); | 189 rendering_stats_instrumentation)); |
194 } | 190 } |
195 | 191 |
196 TileManager::TileManager( | 192 TileManager::TileManager( |
197 TileManagerClient* client, | 193 TileManagerClient* client, |
198 ResourceProvider* resource_provider, | 194 ResourceProvider* resource_provider, |
199 scoped_ptr<RasterWorkerPool> raster_worker_pool, | 195 scoped_ptr<RasterWorkerPool> raster_worker_pool, |
200 size_t num_raster_threads, | |
201 size_t max_raster_usage_bytes, | 196 size_t max_raster_usage_bytes, |
202 RenderingStatsInstrumentation* rendering_stats_instrumentation) | 197 RenderingStatsInstrumentation* rendering_stats_instrumentation) |
203 : client_(client), | 198 : client_(client), |
204 resource_pool_(ResourcePool::Create( | 199 resource_pool_(ResourcePool::Create( |
205 resource_provider, | 200 resource_provider, |
206 raster_worker_pool->GetResourceTarget(), | 201 raster_worker_pool->GetResourceTarget(), |
207 raster_worker_pool->GetResourceFormat())), | 202 raster_worker_pool->GetResourceFormat())), |
208 raster_worker_pool_(raster_worker_pool.Pass()), | 203 raster_worker_pool_(raster_worker_pool.Pass()), |
209 prioritized_tiles_dirty_(false), | 204 prioritized_tiles_dirty_(false), |
210 all_tiles_that_need_to_be_rasterized_have_memory_(true), | 205 all_tiles_that_need_to_be_rasterized_have_memory_(true), |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 flags)); | 981 flags)); |
987 DCHECK(tiles_.find(tile->id()) == tiles_.end()); | 982 DCHECK(tiles_.find(tile->id()) == tiles_.end()); |
988 | 983 |
989 tiles_[tile->id()] = tile; | 984 tiles_[tile->id()] = tile; |
990 used_layer_counts_[tile->layer_id()]++; | 985 used_layer_counts_[tile->layer_id()]++; |
991 prioritized_tiles_dirty_ = true; | 986 prioritized_tiles_dirty_ = true; |
992 return tile; | 987 return tile; |
993 } | 988 } |
994 | 989 |
995 } // namespace cc | 990 } // namespace cc |
OLD | NEW |