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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 514 |
515 // We won't be able to schedule this tile, so break out early. | 515 // We won't be able to schedule this tile, so break out early. |
516 if (tiles_that_need_to_be_rasterized->size() >= | 516 if (tiles_that_need_to_be_rasterized->size() >= |
517 scheduled_raster_task_limit) { | 517 scheduled_raster_task_limit) { |
518 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; | 518 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; |
519 break; | 519 break; |
520 } | 520 } |
521 | 521 |
522 tile->scheduled_priority_ = schedule_priority++; | 522 tile->scheduled_priority_ = schedule_priority++; |
523 | 523 |
524 DCHECK_IMPLIES(tile->draw_info().mode() != TileDrawInfo::OOM_MODE, | 524 DCHECK(tile->draw_info().mode() == TileDrawInfo::OOM_MODE || |
525 !tile->draw_info().IsReadyToDraw()); | 525 !tile->draw_info().IsReadyToDraw()); |
526 | 526 |
527 // If the tile already has a raster_task, then the memory used by it is | 527 // If the tile already has a raster_task, then the memory used by it is |
528 // already accounted for in memory_usage. Otherwise, we'll have to acquire | 528 // already accounted for in memory_usage. Otherwise, we'll have to acquire |
529 // more memory to create a raster task. | 529 // more memory to create a raster task. |
530 MemoryUsage memory_required_by_tile_to_be_scheduled; | 530 MemoryUsage memory_required_by_tile_to_be_scheduled; |
531 if (!tile->raster_task_.get()) { | 531 if (!tile->raster_task_.get()) { |
532 memory_required_by_tile_to_be_scheduled = MemoryUsage::FromConfig( | 532 memory_required_by_tile_to_be_scheduled = MemoryUsage::FromConfig( |
533 tile->desired_texture_size(), DetermineResourceFormat(tile)); | 533 tile->desired_texture_size(), DetermineResourceFormat(tile)); |
534 } | 534 } |
535 | 535 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { | 788 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { |
789 if (!raster_priority_queue->Top().tile()->draw_info().IsReadyToDraw()) | 789 if (!raster_priority_queue->Top().tile()->draw_info().IsReadyToDraw()) |
790 return false; | 790 return false; |
791 } | 791 } |
792 | 792 |
793 #if DCHECK_IS_ON() | 793 #if DCHECK_IS_ON() |
794 scoped_ptr<RasterTilePriorityQueue> all_queue( | 794 scoped_ptr<RasterTilePriorityQueue> all_queue( |
795 client_->BuildRasterQueue(global_state_.tree_priority, type)); | 795 client_->BuildRasterQueue(global_state_.tree_priority, type)); |
796 for (; !all_queue->IsEmpty(); all_queue->Pop()) { | 796 for (; !all_queue->IsEmpty(); all_queue->Pop()) { |
797 Tile* tile = all_queue->Top().tile(); | 797 Tile* tile = all_queue->Top().tile(); |
798 DCHECK_IMPLIES(tile->required_for_activation(), | 798 DCHECK(!tile->required_for_activation() || |
799 tile->draw_info().IsReadyToDraw()); | 799 tile->draw_info().IsReadyToDraw()); |
800 } | 800 } |
801 #endif | 801 #endif |
802 return true; | 802 return true; |
803 } | 803 } |
804 | 804 |
805 bool TileManager::IsReadyToActivate() const { | 805 bool TileManager::IsReadyToActivate() const { |
806 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate"); | 806 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate"); |
807 return AreRequiredTilesReadyToDraw( | 807 return AreRequiredTilesReadyToDraw( |
808 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION); | 808 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION); |
809 } | 809 } |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 void TileManager::Signals::reset() { | 1005 void TileManager::Signals::reset() { |
1006 ready_to_activate = false; | 1006 ready_to_activate = false; |
1007 did_notify_ready_to_activate = false; | 1007 did_notify_ready_to_activate = false; |
1008 ready_to_draw = false; | 1008 ready_to_draw = false; |
1009 did_notify_ready_to_draw = false; | 1009 did_notify_ready_to_draw = false; |
1010 all_tile_tasks_completed = false; | 1010 all_tile_tasks_completed = false; |
1011 did_notify_all_tile_tasks_completed = false; | 1011 did_notify_all_tile_tasks_completed = false; |
1012 } | 1012 } |
1013 | 1013 |
1014 } // namespace cc | 1014 } // namespace cc |
OLD | NEW |