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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 260 |
261 class BinComparator { | 261 class BinComparator { |
262 public: | 262 public: |
263 bool operator() (const Tile* a, const Tile* b) const { | 263 bool operator() (const Tile* a, const Tile* b) const { |
264 const ManagedTileState& ams = a->managed_state(); | 264 const ManagedTileState& ams = a->managed_state(); |
265 const ManagedTileState& bms = b->managed_state(); | 265 const ManagedTileState& bms = b->managed_state(); |
266 if (ams.raster_bin != bms.raster_bin) | 266 if (ams.raster_bin != bms.raster_bin) |
267 return ams.raster_bin < bms.raster_bin; | 267 return ams.raster_bin < bms.raster_bin; |
268 | 268 |
269 if (ams.resolution != bms.resolution) | 269 if (ams.resolution != bms.resolution) |
270 return ams.resolution < ams.resolution; | 270 return ams.resolution < bms.resolution; |
271 | 271 |
272 return | 272 return |
273 ams.time_to_needed_in_seconds < | 273 ams.time_to_needed_in_seconds < |
274 bms.time_to_needed_in_seconds; | 274 bms.time_to_needed_in_seconds; |
275 } | 275 } |
276 }; | 276 }; |
277 | 277 |
278 void TileManager::ManageTiles() { | 278 void TileManager::ManageTiles() { |
279 TRACE_EVENT0("cc", "TileManager::ManageTiles"); | 279 TRACE_EVENT0("cc", "TileManager::ManageTiles"); |
280 manage_tiles_pending_ = false; | 280 manage_tiles_pending_ = false; |
(...skipping 438 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 |