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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 client_->BuildRasterQueue(global_state_.tree_priority, type)); | 790 client_->BuildRasterQueue(global_state_.tree_priority, type)); |
791 // It is insufficient to check whether the raster queue we constructed is | 791 // It is insufficient to check whether the raster queue we constructed is |
792 // empty. The reason for this is that there are situations (rasterize on | 792 // empty. The reason for this is that there are situations (rasterize on |
793 // demand) when the tile both needs raster and it's ready to draw. Hence, we | 793 // demand) when the tile both needs raster and it's ready to draw. Hence, we |
794 // have to iterate the queue to check whether the required tiles are ready to | 794 // have to iterate the queue to check whether the required tiles are ready to |
795 // draw. | 795 // draw. |
796 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { | 796 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { |
797 if (!raster_priority_queue->Top()->IsReadyToDraw()) | 797 if (!raster_priority_queue->Top()->IsReadyToDraw()) |
798 return false; | 798 return false; |
799 } | 799 } |
| 800 |
| 801 #if DCHECK_IS_ON() |
| 802 scoped_ptr<RasterTilePriorityQueue> all_queue( |
| 803 client_->BuildRasterQueue(global_state_.tree_priority, type)); |
| 804 for (; !all_queue->IsEmpty(); all_queue->Pop()) { |
| 805 auto* tile = all_queue->Top(); |
| 806 DCHECK_IMPLIES(tile->required_for_activation(), tile->IsReadyToDraw()); |
| 807 } |
| 808 #endif |
800 return true; | 809 return true; |
801 } | 810 } |
802 bool TileManager::IsReadyToActivate() const { | 811 bool TileManager::IsReadyToActivate() const { |
803 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate"); | 812 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate"); |
804 return AreRequiredTilesReadyToDraw( | 813 return AreRequiredTilesReadyToDraw( |
805 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION); | 814 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION); |
806 } | 815 } |
807 | 816 |
808 bool TileManager::IsReadyToDraw() const { | 817 bool TileManager::IsReadyToDraw() const { |
809 TRACE_EVENT0("cc", "TileManager::IsReadyToDraw"); | 818 TRACE_EVENT0("cc", "TileManager::IsReadyToDraw"); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 result -= other; | 976 result -= other; |
968 return result; | 977 return result; |
969 } | 978 } |
970 | 979 |
971 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { | 980 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { |
972 return memory_bytes_ > limit.memory_bytes_ || | 981 return memory_bytes_ > limit.memory_bytes_ || |
973 resource_count_ > limit.resource_count_; | 982 resource_count_ > limit.resource_count_; |
974 } | 983 } |
975 | 984 |
976 } // namespace cc | 985 } // namespace cc |
OLD | NEW |