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/tiles/tile_manager.h" | 5 #include "cc/tiles/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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 538 |
539 // We won't be able to schedule this tile, so break out early. | 539 // We won't be able to schedule this tile, so break out early. |
540 if (tiles_that_need_to_be_rasterized->size() >= | 540 if (tiles_that_need_to_be_rasterized->size() >= |
541 scheduled_raster_task_limit) { | 541 scheduled_raster_task_limit) { |
542 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; | 542 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; |
543 break; | 543 break; |
544 } | 544 } |
545 | 545 |
546 tile->scheduled_priority_ = schedule_priority++; | 546 tile->scheduled_priority_ = schedule_priority++; |
547 | 547 |
548 DCHECK_IMPLIES(tile->draw_info().mode() != TileDrawInfo::OOM_MODE, | 548 DCHECK(tile->draw_info().mode() == TileDrawInfo::OOM_MODE || |
549 !tile->draw_info().IsReadyToDraw()); | 549 !tile->draw_info().IsReadyToDraw()); |
550 | 550 |
551 // If the tile already has a raster_task, then the memory used by it is | 551 // If the tile already has a raster_task, then the memory used by it is |
552 // already accounted for in memory_usage. Otherwise, we'll have to acquire | 552 // already accounted for in memory_usage. Otherwise, we'll have to acquire |
553 // more memory to create a raster task. | 553 // more memory to create a raster task. |
554 MemoryUsage memory_required_by_tile_to_be_scheduled; | 554 MemoryUsage memory_required_by_tile_to_be_scheduled; |
555 if (!tile->raster_task_.get()) { | 555 if (!tile->raster_task_.get()) { |
556 memory_required_by_tile_to_be_scheduled = MemoryUsage::FromConfig( | 556 memory_required_by_tile_to_be_scheduled = MemoryUsage::FromConfig( |
557 tile->desired_texture_size(), tile_task_runner_->GetResourceFormat()); | 557 tile->desired_texture_size(), tile_task_runner_->GetResourceFormat()); |
558 } | 558 } |
559 | 559 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { | 849 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { |
850 if (!raster_priority_queue->Top().tile()->draw_info().IsReadyToDraw()) | 850 if (!raster_priority_queue->Top().tile()->draw_info().IsReadyToDraw()) |
851 return false; | 851 return false; |
852 } | 852 } |
853 | 853 |
854 #if DCHECK_IS_ON() | 854 #if DCHECK_IS_ON() |
855 scoped_ptr<RasterTilePriorityQueue> all_queue( | 855 scoped_ptr<RasterTilePriorityQueue> all_queue( |
856 client_->BuildRasterQueue(global_state_.tree_priority, type)); | 856 client_->BuildRasterQueue(global_state_.tree_priority, type)); |
857 for (; !all_queue->IsEmpty(); all_queue->Pop()) { | 857 for (; !all_queue->IsEmpty(); all_queue->Pop()) { |
858 Tile* tile = all_queue->Top().tile(); | 858 Tile* tile = all_queue->Top().tile(); |
859 DCHECK_IMPLIES(tile->required_for_activation(), | 859 DCHECK(!tile->required_for_activation() || |
860 tile->draw_info().IsReadyToDraw()); | 860 tile->draw_info().IsReadyToDraw()); |
861 } | 861 } |
862 #endif | 862 #endif |
863 return true; | 863 return true; |
864 } | 864 } |
865 | 865 |
866 bool TileManager::IsReadyToActivate() const { | 866 bool TileManager::IsReadyToActivate() const { |
867 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate"); | 867 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate"); |
868 return AreRequiredTilesReadyToDraw( | 868 return AreRequiredTilesReadyToDraw( |
869 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION); | 869 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION); |
870 } | 870 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 void TileManager::Signals::reset() { | 1057 void TileManager::Signals::reset() { |
1058 ready_to_activate = false; | 1058 ready_to_activate = false; |
1059 did_notify_ready_to_activate = false; | 1059 did_notify_ready_to_activate = false; |
1060 ready_to_draw = false; | 1060 ready_to_draw = false; |
1061 did_notify_ready_to_draw = false; | 1061 did_notify_ready_to_draw = false; |
1062 all_tile_tasks_completed = false; | 1062 all_tile_tasks_completed = false; |
1063 did_notify_all_tile_tasks_completed = false; | 1063 did_notify_all_tile_tasks_completed = false; |
1064 } | 1064 } |
1065 | 1065 |
1066 } // namespace cc | 1066 } // namespace cc |
OLD | NEW |