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/tile_manager.h" | 5 #include "cc/tile_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 manage_tiles_pending_(false), | 177 manage_tiles_pending_(false), |
178 manage_tiles_call_count_(0), | 178 manage_tiles_call_count_(0), |
179 check_for_completed_set_pixels_pending_(false) { | 179 check_for_completed_set_pixels_pending_(false) { |
180 // Initialize all threads. | 180 // Initialize all threads. |
181 const std::string thread_name_prefix = kRasterThreadNamePrefix; | 181 const std::string thread_name_prefix = kRasterThreadNamePrefix; |
182 while (raster_threads_.size() < num_raster_threads) { | 182 while (raster_threads_.size() < num_raster_threads) { |
183 int thread_number = raster_threads_.size() + 1; | 183 int thread_number = raster_threads_.size() + 1; |
184 scoped_ptr<RasterThread> thread = make_scoped_ptr( | 184 scoped_ptr<RasterThread> thread = make_scoped_ptr( |
185 new RasterThread(thread_name_prefix + | 185 new RasterThread(thread_name_prefix + |
186 StringPrintf("Worker%d", thread_number).c_str())); | 186 StringPrintf("Worker%d", thread_number).c_str())); |
187 raster_threads_.append(thread.Pass()); | 187 raster_threads_.push_back(thread.Pass()); |
188 } | 188 } |
189 | 189 |
190 ResetBinCounts(); | 190 ResetBinCounts(); |
191 } | 191 } |
192 | 192 |
193 TileManager::~TileManager() { | 193 TileManager::~TileManager() { |
194 // Reset global state and manage. This should cause | 194 // Reset global state and manage. This should cause |
195 // our memory usage to drop to zero. | 195 // our memory usage to drop to zero. |
196 global_state_ = GlobalStateThatImpactsTilePriority(); | 196 global_state_ = GlobalStateThatImpactsTilePriority(); |
197 AssignGpuMemoryToTiles(); | 197 AssignGpuMemoryToTiles(); |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 void TileManager::DidFinishTileInitialization(Tile* tile) { | 719 void TileManager::DidFinishTileInitialization(Tile* tile) { |
720 ManagedTileState& managed_tile_state = tile->managed_state(); | 720 ManagedTileState& managed_tile_state = tile->managed_state(); |
721 DCHECK(managed_tile_state.resource); | 721 DCHECK(managed_tile_state.resource); |
722 managed_tile_state.resource_is_being_initialized = false; | 722 managed_tile_state.resource_is_being_initialized = false; |
723 managed_tile_state.can_be_freed = true; | 723 managed_tile_state.can_be_freed = true; |
724 for (int i = 0; i < NUM_TREES; ++i) | 724 for (int i = 0; i < NUM_TREES; ++i) |
725 drawable_tiles_in_bin_count_[managed_tile_state.bin[i]][i]++; | 725 drawable_tiles_in_bin_count_[managed_tile_state.bin[i]][i]++; |
726 } | 726 } |
727 | 727 |
728 } | 728 } |
OLD | NEW |