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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 client_->BuildRasterQueue(global_state_.tree_priority, type)); | 887 client_->BuildRasterQueue(global_state_.tree_priority, type)); |
888 // It is insufficient to check whether the raster queue we constructed is | 888 // It is insufficient to check whether the raster queue we constructed is |
889 // empty. The reason for this is that there are situations (rasterize on | 889 // empty. The reason for this is that there are situations (rasterize on |
890 // demand) when the tile both needs raster and it's ready to draw. Hence, we | 890 // demand) when the tile both needs raster and it's ready to draw. Hence, we |
891 // have to iterate the queue to check whether the required tiles are ready to | 891 // have to iterate the queue to check whether the required tiles are ready to |
892 // draw. | 892 // draw. |
893 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { | 893 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { |
894 if (!raster_priority_queue->Top()->IsReadyToDraw()) | 894 if (!raster_priority_queue->Top()->IsReadyToDraw()) |
895 return false; | 895 return false; |
896 } | 896 } |
| 897 |
| 898 #if DCHECK_IS_ON() |
| 899 scoped_ptr<RasterTilePriorityQueue> all_queue( |
| 900 client_->BuildRasterQueue(global_state_.tree_priority, type)); |
| 901 for (; !all_queue->IsEmpty(); all_queue->Pop()) { |
| 902 auto* tile = all_queue->Top(); |
| 903 DCHECK_IMPLIES(tile->required_for_activation(), tile->IsReadyToDraw()); |
| 904 } |
| 905 #endif |
897 return true; | 906 return true; |
898 } | 907 } |
899 bool TileManager::IsReadyToActivate() const { | 908 bool TileManager::IsReadyToActivate() const { |
900 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate"); | 909 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate"); |
901 return AreRequiredTilesReadyToDraw( | 910 return AreRequiredTilesReadyToDraw( |
902 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION); | 911 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION); |
903 } | 912 } |
904 | 913 |
905 bool TileManager::IsReadyToDraw() const { | 914 bool TileManager::IsReadyToDraw() const { |
906 TRACE_EVENT0("cc", "TileManager::IsReadyToDraw"); | 915 TRACE_EVENT0("cc", "TileManager::IsReadyToDraw"); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 result -= other; | 1073 result -= other; |
1065 return result; | 1074 return result; |
1066 } | 1075 } |
1067 | 1076 |
1068 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { | 1077 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { |
1069 return memory_bytes_ > limit.memory_bytes_ || | 1078 return memory_bytes_ > limit.memory_bytes_ || |
1070 resource_count_ > limit.resource_count_; | 1079 resource_count_ > limit.resource_count_; |
1071 } | 1080 } |
1072 | 1081 |
1073 } // namespace cc | 1082 } // namespace cc |
OLD | NEW |