Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1064 bool TileManager::AreRequiredTilesReadyToDraw( | 1064 bool TileManager::AreRequiredTilesReadyToDraw( |
| 1065 RasterTilePriorityQueue::Type type) const { | 1065 RasterTilePriorityQueue::Type type) const { |
| 1066 std::unique_ptr<RasterTilePriorityQueue> raster_priority_queue( | 1066 std::unique_ptr<RasterTilePriorityQueue> raster_priority_queue( |
| 1067 client_->BuildRasterQueue(global_state_.tree_priority, type)); | 1067 client_->BuildRasterQueue(global_state_.tree_priority, type)); |
| 1068 // It is insufficient to check whether the raster queue we constructed is | 1068 // It is insufficient to check whether the raster queue we constructed is |
| 1069 // empty. The reason for this is that there are situations (rasterize on | 1069 // empty. The reason for this is that there are situations (rasterize on |
| 1070 // demand) when the tile both needs raster and it's ready to draw. Hence, we | 1070 // demand) when the tile both needs raster and it's ready to draw. Hence, we |
| 1071 // have to iterate the queue to check whether the required tiles are ready to | 1071 // have to iterate the queue to check whether the required tiles are ready to |
| 1072 // draw. | 1072 // draw. |
| 1073 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { | 1073 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { |
| 1074 if (!raster_priority_queue->Top().tile()->draw_info().IsReadyToDraw()) | 1074 const auto& prioritized_tile = raster_priority_queue->Top(); |
| 1075 // TODO(vmpstr): Check to debug crbug.com/622080. Remove when fixed. | |
|
sunnyps
2016/12/10 01:29:47
Shouldn't we do this check only for the required f
| |
| 1076 CHECK_EQ(prioritized_tile.priority().priority_bin, TilePriority::NOW); | |
| 1077 if (!prioritized_tile.tile()->draw_info().IsReadyToDraw()) | |
| 1075 return false; | 1078 return false; |
| 1076 } | 1079 } |
| 1077 | 1080 |
| 1078 #if DCHECK_IS_ON() | 1081 #if DCHECK_IS_ON() |
| 1079 std::unique_ptr<RasterTilePriorityQueue> all_queue( | 1082 std::unique_ptr<RasterTilePriorityQueue> all_queue( |
| 1080 client_->BuildRasterQueue(global_state_.tree_priority, type)); | 1083 client_->BuildRasterQueue(global_state_.tree_priority, type)); |
| 1081 for (; !all_queue->IsEmpty(); all_queue->Pop()) { | 1084 for (; !all_queue->IsEmpty(); all_queue->Pop()) { |
| 1082 Tile* tile = all_queue->Top().tile(); | 1085 Tile* tile = all_queue->Top().tile(); |
| 1083 DCHECK(!tile->required_for_activation() || | 1086 DCHECK(!tile->required_for_activation() || |
| 1084 tile->draw_info().IsReadyToDraw()); | 1087 tile->draw_info().IsReadyToDraw()); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1341 all_tile_tasks_completed = false; | 1344 all_tile_tasks_completed = false; |
| 1342 did_notify_all_tile_tasks_completed = false; | 1345 did_notify_all_tile_tasks_completed = false; |
| 1343 } | 1346 } |
| 1344 | 1347 |
| 1345 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1348 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
| 1346 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1349 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
| 1347 PrioritizedWorkToSchedule&& other) = default; | 1350 PrioritizedWorkToSchedule&& other) = default; |
| 1348 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1351 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
| 1349 | 1352 |
| 1350 } // namespace cc | 1353 } // namespace cc |
| OLD | NEW |