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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 | 486 |
| 487 if (!tile_task_manager_) { | 487 if (!tile_task_manager_) { |
| 488 TRACE_EVENT_INSTANT0("cc", "PrepareTiles aborted", | 488 TRACE_EVENT_INSTANT0("cc", "PrepareTiles aborted", |
| 489 TRACE_EVENT_SCOPE_THREAD); | 489 TRACE_EVENT_SCOPE_THREAD); |
| 490 return false; | 490 return false; |
| 491 } | 491 } |
| 492 | 492 |
| 493 signals_.reset(); | 493 signals_.reset(); |
| 494 global_state_ = state; | 494 global_state_ = state; |
| 495 | 495 |
| 496 // Ensure that we don't schedule any decode work for checkered images until | |
| 497 // the raster work for visible tiles is done. | |
|
vmpstr
2017/06/22 16:57:58
Can you elaborate a bit more by stating when exact
Khushal
2017/06/22 20:11:51
Done.
| |
| 498 checker_image_tracker_.SetNoDecodesAllowed(); | |
| 499 | |
| 496 // We need to call CheckForCompletedTasks() once in-between each call | 500 // We need to call CheckForCompletedTasks() once in-between each call |
| 497 // to ScheduleTasks() to prevent canceled tasks from being scheduled. | 501 // to ScheduleTasks() to prevent canceled tasks from being scheduled. |
| 498 if (!did_check_for_completed_tasks_since_last_schedule_tasks_) { | 502 if (!did_check_for_completed_tasks_since_last_schedule_tasks_) { |
| 499 tile_task_manager_->CheckForCompletedTasks(); | 503 tile_task_manager_->CheckForCompletedTasks(); |
| 500 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; | 504 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; |
| 501 } | 505 } |
| 502 | 506 |
| 503 PrioritizedWorkToSchedule prioritized_work = AssignGpuMemoryToTiles(); | 507 PrioritizedWorkToSchedule prioritized_work = AssignGpuMemoryToTiles(); |
| 504 | 508 |
| 505 // Inform the client that will likely require a draw if the highest priority | 509 // Inform the client that will likely require a draw if the highest priority |
| 506 // tile that will be rasterized is required for draw. | 510 // tile that will be rasterized is required for draw. |
| 507 client_->SetIsLikelyToRequireADraw( | 511 client_->SetIsLikelyToRequireADraw( |
| 508 !prioritized_work.tiles_to_raster.empty() && | 512 !prioritized_work.tiles_to_raster.empty() && |
| 509 prioritized_work.tiles_to_raster.front().tile()->required_for_draw()); | 513 prioritized_work.tiles_to_raster.front().tile()->required_for_draw()); |
| 510 | 514 |
| 511 // Schedule tile tasks. | 515 // Schedule tile tasks. |
| 512 ScheduleTasks(prioritized_work); | 516 ScheduleTasks(std::move(prioritized_work)); |
| 513 | 517 |
| 514 TRACE_EVENT_INSTANT1("cc", "DidPrepareTiles", TRACE_EVENT_SCOPE_THREAD, | 518 TRACE_EVENT_INSTANT1("cc", "DidPrepareTiles", TRACE_EVENT_SCOPE_THREAD, |
| 515 "state", BasicStateAsValue()); | 519 "state", BasicStateAsValue()); |
| 516 return true; | 520 return true; |
| 517 } | 521 } |
| 518 | 522 |
| 519 void TileManager::Flush() { | 523 void TileManager::Flush() { |
| 520 TRACE_EVENT0("cc", "TileManager::Flush"); | 524 TRACE_EVENT0("cc", "TileManager::Flush"); |
| 521 | 525 |
| 522 if (!tile_task_manager_) { | 526 if (!tile_task_manager_) { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 698 // checker-images. If this tile does not need raster, process it only to | 702 // checker-images. If this tile does not need raster, process it only to |
| 699 // build the decode queue for checkered images. | 703 // build the decode queue for checkered images. |
| 700 // Note that performing this check after the solid color analysis is not | 704 // Note that performing this check after the solid color analysis is not |
| 701 // necessary for correctness. | 705 // necessary for correctness. |
| 702 if (!tile->draw_info().NeedsRaster()) { | 706 if (!tile->draw_info().NeedsRaster()) { |
| 703 DCHECK(tile->draw_info().is_checker_imaged()); | 707 DCHECK(tile->draw_info().is_checker_imaged()); |
| 704 DCHECK(prioritized_tile.should_decode_checkered_images_for_tile()); | 708 DCHECK(prioritized_tile.should_decode_checkered_images_for_tile()); |
| 705 | 709 |
| 706 AddCheckeredImagesToDecodeQueue( | 710 AddCheckeredImagesToDecodeQueue( |
| 707 prioritized_tile, raster_color_space, | 711 prioritized_tile, raster_color_space, |
| 712 CheckerImageTracker::DecodeType::kRaster, | |
| 708 &work_to_schedule.checker_image_decode_queue); | 713 &work_to_schedule.checker_image_decode_queue); |
| 709 continue; | 714 continue; |
| 710 } | 715 } |
| 711 | 716 |
| 712 // We won't be able to schedule this tile, so break out early. | 717 // We won't be able to schedule this tile, so break out early. |
| 713 if (work_to_schedule.tiles_to_raster.size() >= | 718 if (work_to_schedule.tiles_to_raster.size() >= |
| 714 scheduled_raster_task_limit_) { | 719 scheduled_raster_task_limit_) { |
| 715 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; | 720 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; |
| 716 break; | 721 break; |
| 717 } | 722 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 756 | 761 |
| 757 // If the tile has a scheduled task that will rasterize a resource with | 762 // If the tile has a scheduled task that will rasterize a resource with |
| 758 // checker-imaged content, add those images to the decode queue. Note that | 763 // checker-imaged content, add those images to the decode queue. Note that |
| 759 // we add all images as we process the raster priority queue to ensure that | 764 // we add all images as we process the raster priority queue to ensure that |
| 760 // images are added to the decode queue in raster priority order. | 765 // images are added to the decode queue in raster priority order. |
| 761 if (tile->HasRasterTask()) { | 766 if (tile->HasRasterTask()) { |
| 762 if (tile->raster_task_scheduled_with_checker_images() && | 767 if (tile->raster_task_scheduled_with_checker_images() && |
| 763 prioritized_tile.should_decode_checkered_images_for_tile()) { | 768 prioritized_tile.should_decode_checkered_images_for_tile()) { |
| 764 AddCheckeredImagesToDecodeQueue( | 769 AddCheckeredImagesToDecodeQueue( |
| 765 prioritized_tile, raster_color_space, | 770 prioritized_tile, raster_color_space, |
| 771 CheckerImageTracker::DecodeType::kRaster, | |
| 766 &work_to_schedule.checker_image_decode_queue); | 772 &work_to_schedule.checker_image_decode_queue); |
| 767 } | 773 } |
| 768 } else { | 774 } else { |
| 769 // Creating the raster task here will acquire resources, but | 775 // Creating the raster task here will acquire resources, but |
| 770 // this resource usage has already been accounted for above. | 776 // this resource usage has already been accounted for above. |
| 771 tile->raster_task_ = | 777 tile->raster_task_ = |
| 772 CreateRasterTask(prioritized_tile, client_->GetRasterColorSpace(), | 778 CreateRasterTask(prioritized_tile, client_->GetRasterColorSpace(), |
| 773 &work_to_schedule.checker_image_decode_queue); | 779 &work_to_schedule.checker_image_decode_queue); |
| 774 } | 780 } |
| 775 | 781 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 798 break; | 804 break; |
| 799 | 805 |
| 800 if (!prioritized_tile.should_decode_checkered_images_for_tile()) | 806 if (!prioritized_tile.should_decode_checkered_images_for_tile()) |
| 801 continue; | 807 continue; |
| 802 | 808 |
| 803 Tile* tile = prioritized_tile.tile(); | 809 Tile* tile = prioritized_tile.tile(); |
| 804 if (tile->draw_info().is_checker_imaged() || | 810 if (tile->draw_info().is_checker_imaged() || |
| 805 tile->raster_task_scheduled_with_checker_images()) { | 811 tile->raster_task_scheduled_with_checker_images()) { |
| 806 AddCheckeredImagesToDecodeQueue( | 812 AddCheckeredImagesToDecodeQueue( |
| 807 prioritized_tile, raster_color_space, | 813 prioritized_tile, raster_color_space, |
| 814 CheckerImageTracker::DecodeType::kRaster, | |
| 808 &work_to_schedule.checker_image_decode_queue); | 815 &work_to_schedule.checker_image_decode_queue); |
| 809 } | 816 } |
| 810 } | 817 } |
| 811 } | 818 } |
| 812 | 819 |
| 813 UMA_HISTOGRAM_BOOLEAN("TileManager.ExceededMemoryBudget", | 820 UMA_HISTOGRAM_BOOLEAN("TileManager.ExceededMemoryBudget", |
| 814 !had_enough_memory_to_schedule_tiles_needed_now); | 821 !had_enough_memory_to_schedule_tiles_needed_now); |
| 815 did_oom_on_last_assign_ = !had_enough_memory_to_schedule_tiles_needed_now; | 822 did_oom_on_last_assign_ = !had_enough_memory_to_schedule_tiles_needed_now; |
| 816 | 823 |
| 817 memory_stats_from_last_assign_.total_budget_in_bytes = | 824 memory_stats_from_last_assign_.total_budget_in_bytes = |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 867 if (checker_image_tracker_.ShouldCheckerImage(draw_image, tree)) | 874 if (checker_image_tracker_.ShouldCheckerImage(draw_image, tree)) |
| 868 checkered_images->push_back(draw_image.paint_image()); | 875 checkered_images->push_back(draw_image.paint_image()); |
| 869 else | 876 else |
| 870 sync_decoded_images->push_back(draw_image); | 877 sync_decoded_images->push_back(draw_image); |
| 871 } | 878 } |
| 872 } | 879 } |
| 873 | 880 |
| 874 void TileManager::AddCheckeredImagesToDecodeQueue( | 881 void TileManager::AddCheckeredImagesToDecodeQueue( |
| 875 const PrioritizedTile& prioritized_tile, | 882 const PrioritizedTile& prioritized_tile, |
| 876 const gfx::ColorSpace& raster_color_space, | 883 const gfx::ColorSpace& raster_color_space, |
| 884 CheckerImageTracker::DecodeType decode_type, | |
| 877 CheckerImageTracker::ImageDecodeQueue* image_decode_queue) { | 885 CheckerImageTracker::ImageDecodeQueue* image_decode_queue) { |
| 878 Tile* tile = prioritized_tile.tile(); | 886 Tile* tile = prioritized_tile.tile(); |
| 879 std::vector<DrawImage> images_in_tile; | 887 std::vector<DrawImage> images_in_tile; |
| 880 prioritized_tile.raster_source()->GetDiscardableImagesInRect( | 888 prioritized_tile.raster_source()->GetDiscardableImagesInRect( |
| 881 tile->enclosing_layer_rect(), tile->raster_transform().scale(), | 889 tile->enclosing_layer_rect(), tile->raster_transform().scale(), |
| 882 raster_color_space, &images_in_tile); | 890 raster_color_space, &images_in_tile); |
| 883 WhichTree tree = tile->tiling()->tree(); | 891 WhichTree tree = tile->tiling()->tree(); |
| 884 | 892 |
| 885 for (auto& draw_image : images_in_tile) { | 893 for (auto& draw_image : images_in_tile) { |
| 886 if (checker_image_tracker_.ShouldCheckerImage(draw_image, tree)) | 894 if (checker_image_tracker_.ShouldCheckerImage(draw_image, tree)) { |
| 887 image_decode_queue->push_back(draw_image.paint_image()); | 895 image_decode_queue->push_back(CheckerImageTracker::ImageDecodeRequest( |
| 896 draw_image.paint_image(), decode_type)); | |
| 897 } | |
| 888 } | 898 } |
| 889 } | 899 } |
| 890 | 900 |
| 891 void TileManager::ScheduleTasks( | 901 void TileManager::ScheduleTasks(PrioritizedWorkToSchedule work_to_schedule) { |
| 892 const PrioritizedWorkToSchedule& work_to_schedule) { | |
| 893 const std::vector<PrioritizedTile>& tiles_that_need_to_be_rasterized = | 902 const std::vector<PrioritizedTile>& tiles_that_need_to_be_rasterized = |
| 894 work_to_schedule.tiles_to_raster; | 903 work_to_schedule.tiles_to_raster; |
| 895 TRACE_EVENT1("cc", "TileManager::ScheduleTasks", "count", | 904 TRACE_EVENT1("cc", "TileManager::ScheduleTasks", "count", |
| 896 tiles_that_need_to_be_rasterized.size()); | 905 tiles_that_need_to_be_rasterized.size()); |
| 897 | 906 |
| 898 DCHECK(did_check_for_completed_tasks_since_last_schedule_tasks_); | 907 DCHECK(did_check_for_completed_tasks_since_last_schedule_tasks_); |
| 899 | 908 |
| 900 if (!has_scheduled_tile_tasks_) { | 909 if (!has_scheduled_tile_tasks_) { |
| 901 TRACE_EVENT_ASYNC_BEGIN0("cc", "ScheduledTasks", this); | 910 TRACE_EVENT_ASYNC_BEGIN0("cc", "ScheduledTasks", this); |
| 902 } | 911 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 962 tile->required_for_draw() || tile->required_for_activation() || | 971 tile->required_for_draw() || tile->required_for_activation() || |
| 963 prioritized_tile.priority().priority_bin == TilePriority::NOW; | 972 prioritized_tile.priority().priority_bin == TilePriority::NOW; |
| 964 InsertNodesForRasterTask(&graph_, task, task->dependencies(), priority++, | 973 InsertNodesForRasterTask(&graph_, task, task->dependencies(), priority++, |
| 965 use_foreground_category); | 974 use_foreground_category); |
| 966 } | 975 } |
| 967 | 976 |
| 968 const std::vector<PrioritizedTile>& tiles_to_process_for_images = | 977 const std::vector<PrioritizedTile>& tiles_to_process_for_images = |
| 969 work_to_schedule.tiles_to_process_for_images; | 978 work_to_schedule.tiles_to_process_for_images; |
| 970 std::vector<DrawImage> new_locked_images; | 979 std::vector<DrawImage> new_locked_images; |
| 971 for (const PrioritizedTile& prioritized_tile : tiles_to_process_for_images) { | 980 for (const PrioritizedTile& prioritized_tile : tiles_to_process_for_images) { |
| 972 Tile* tile = prioritized_tile.tile(); | 981 std::vector<DrawImage> sync_decoded_images; |
| 982 std::vector<PaintImage> checkered_images; | |
| 983 PartitionImagesForCheckering(prioritized_tile, raster_color_space, | |
| 984 &sync_decoded_images, &checkered_images); | |
| 973 | 985 |
| 974 // TODO(khushalsagar): Send these images to the ImageDecodeService, through | 986 // Add the sync decoded images to |new_locked_images| so they can be added |
| 975 // the CheckerImageTracker as well. See crbug.com/691087. | 987 // to the task graph. |
| 976 std::vector<DrawImage> images; | 988 new_locked_images.insert(new_locked_images.end(), |
| 977 prioritized_tile.raster_source()->GetDiscardableImagesInRect( | 989 sync_decoded_images.begin(), |
| 978 tile->enclosing_layer_rect(), tile->raster_transform().scale(), | 990 sync_decoded_images.end()); |
| 979 raster_color_space, &images); | 991 |
| 980 new_locked_images.insert(new_locked_images.end(), images.begin(), | 992 // For checkered-images, send them to the decode service. |
| 981 images.end()); | 993 for (auto& image : checkered_images) { |
| 994 work_to_schedule.checker_image_decode_queue.push_back( | |
| 995 CheckerImageTracker::ImageDecodeRequest( | |
| 996 std::move(image), CheckerImageTracker::DecodeType::kPreDecode)); | |
| 997 } | |
| 982 } | 998 } |
| 983 | 999 |
| 984 // TODO(vmpstr): SOON is misleading here, but these images can come from | 1000 // TODO(vmpstr): SOON is misleading here, but these images can come from |
| 985 // several diffent tiles. Rethink what we actually want to trace here. Note | 1001 // several diffent tiles. Rethink what we actually want to trace here. Note |
| 986 // that I'm using SOON, since it can't be NOW (these are prepaint). | 1002 // that I'm using SOON, since it can't be NOW (these are prepaint). |
| 987 ImageDecodeCache::TracingInfo tracing_info( | 1003 ImageDecodeCache::TracingInfo tracing_info( |
| 988 prepare_tiles_count_, TilePriority::SOON, | 1004 prepare_tiles_count_, TilePriority::SOON, |
| 989 ImageDecodeCache::TaskType::kInRaster); | 1005 ImageDecodeCache::TaskType::kInRaster); |
| 990 std::vector<scoped_refptr<TileTask>> new_locked_image_tasks = | 1006 std::vector<scoped_refptr<TileTask>> new_locked_image_tasks = |
| 991 image_controller_.SetPredecodeImages(std::move(new_locked_images), | 1007 image_controller_.SetPredecodeImages(std::move(new_locked_images), |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1096 std::vector<PaintImage> checkered_images; | 1112 std::vector<PaintImage> checkered_images; |
| 1097 PartitionImagesForCheckering(prioritized_tile, color_space, | 1113 PartitionImagesForCheckering(prioritized_tile, color_space, |
| 1098 &sync_decoded_images, &checkered_images); | 1114 &sync_decoded_images, &checkered_images); |
| 1099 for (const auto& image : checkered_images) { | 1115 for (const auto& image : checkered_images) { |
| 1100 playback_settings.images_to_skip.insert(image.sk_image()->uniqueID()); | 1116 playback_settings.images_to_skip.insert(image.sk_image()->uniqueID()); |
| 1101 | 1117 |
| 1102 // This can be the case for tiles on the active tree that will be replaced | 1118 // This can be the case for tiles on the active tree that will be replaced |
| 1103 // or are occluded on the pending tree. While we still need to continue | 1119 // or are occluded on the pending tree. While we still need to continue |
| 1104 // skipping images for these tiles, we don't need to decode them since | 1120 // skipping images for these tiles, we don't need to decode them since |
| 1105 // they will not be required on the next active tree. | 1121 // they will not be required on the next active tree. |
| 1106 if (prioritized_tile.should_decode_checkered_images_for_tile()) | 1122 if (prioritized_tile.should_decode_checkered_images_for_tile()) { |
| 1107 checker_image_decode_queue->push_back(image); | 1123 checker_image_decode_queue->push_back( |
| 1124 CheckerImageTracker::ImageDecodeRequest( | |
| 1125 image, CheckerImageTracker::DecodeType::kRaster)); | |
| 1126 } | |
| 1108 } | 1127 } |
| 1109 } | 1128 } |
| 1110 | 1129 |
| 1111 // We can skip the image hijack canvas if we have no images, or no images to | 1130 // We can skip the image hijack canvas if we have no images, or no images to |
| 1112 // skip during raster. | 1131 // skip during raster. |
| 1113 playback_settings.use_image_hijack_canvas = | 1132 playback_settings.use_image_hijack_canvas = |
| 1114 !sync_decoded_images.empty() || !playback_settings.images_to_skip.empty(); | 1133 !sync_decoded_images.empty() || !playback_settings.images_to_skip.empty(); |
| 1115 | 1134 |
| 1116 bool has_checker_images = !playback_settings.images_to_skip.empty(); | 1135 bool has_checker_images = !playback_settings.images_to_skip.empty(); |
| 1117 tile->set_raster_task_scheduled_with_checker_images(has_checker_images); | 1136 tile->set_raster_task_scheduled_with_checker_images(has_checker_images); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1296 !signals_.did_notify_all_tile_tasks_completed) { | 1315 !signals_.did_notify_all_tile_tasks_completed) { |
| 1297 signals_.all_tile_tasks_completed = false; | 1316 signals_.all_tile_tasks_completed = false; |
| 1298 if (!has_scheduled_tile_tasks_) { | 1317 if (!has_scheduled_tile_tasks_) { |
| 1299 TRACE_EVENT0( | 1318 TRACE_EVENT0( |
| 1300 TRACE_DISABLED_BY_DEFAULT("cc.debug"), | 1319 TRACE_DISABLED_BY_DEFAULT("cc.debug"), |
| 1301 "TileManager::CheckAndIssueSignals - all tile tasks completed"); | 1320 "TileManager::CheckAndIssueSignals - all tile tasks completed"); |
| 1302 signals_.did_notify_all_tile_tasks_completed = true; | 1321 signals_.did_notify_all_tile_tasks_completed = true; |
| 1303 client_->NotifyAllTileTasksCompleted(); | 1322 client_->NotifyAllTileTasksCompleted(); |
| 1304 } | 1323 } |
| 1305 } | 1324 } |
| 1325 | |
| 1326 // Allow decodes for rasterized tiles if all required for draw/activate tiles | |
| 1327 // are done. And pre-decode tiles once all tile tasks are done. | |
|
vmpstr
2017/06/22 16:57:57
Can you elaborate again to just say that the order
Khushal
2017/06/22 20:11:51
Done.
| |
| 1328 if (signals_.did_notify_all_tile_tasks_completed) { | |
| 1329 checker_image_tracker_.SetMaxDecodePriorityAllowed( | |
| 1330 CheckerImageTracker::DecodeType::kPreDecode); | |
| 1331 } else if (signals_.did_notify_ready_to_activate && | |
| 1332 signals_.did_notify_ready_to_draw) { | |
| 1333 checker_image_tracker_.SetMaxDecodePriorityAllowed( | |
| 1334 CheckerImageTracker::DecodeType::kRaster); | |
| 1335 } | |
| 1306 } | 1336 } |
| 1307 | 1337 |
| 1308 void TileManager::CheckIfMoreTilesNeedToBePrepared() { | 1338 void TileManager::CheckIfMoreTilesNeedToBePrepared() { |
| 1309 tile_task_manager_->CheckForCompletedTasks(); | 1339 tile_task_manager_->CheckForCompletedTasks(); |
| 1310 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; | 1340 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; |
| 1311 | 1341 |
| 1312 // When OOM, keep re-assigning memory until we reach a steady state | 1342 // When OOM, keep re-assigning memory until we reach a steady state |
| 1313 // where top-priority tiles are initialized. | 1343 // where top-priority tiles are initialized. |
| 1314 PrioritizedWorkToSchedule work_to_schedule = AssignGpuMemoryToTiles(); | 1344 PrioritizedWorkToSchedule work_to_schedule = AssignGpuMemoryToTiles(); |
| 1315 | 1345 |
| 1316 // Inform the client that will likely require a draw if the highest priority | 1346 // Inform the client that will likely require a draw if the highest priority |
| 1317 // tile that will be rasterized is required for draw. | 1347 // tile that will be rasterized is required for draw. |
| 1318 client_->SetIsLikelyToRequireADraw( | 1348 client_->SetIsLikelyToRequireADraw( |
| 1319 !work_to_schedule.tiles_to_raster.empty() && | 1349 !work_to_schedule.tiles_to_raster.empty() && |
| 1320 work_to_schedule.tiles_to_raster.front().tile()->required_for_draw()); | 1350 work_to_schedule.tiles_to_raster.front().tile()->required_for_draw()); |
| 1321 | 1351 |
| 1322 // |tiles_that_need_to_be_rasterized| will be empty when we reach a | 1352 // |tiles_that_need_to_be_rasterized| will be empty when we reach a |
| 1323 // steady memory state. Keep scheduling tasks until we reach this state. | 1353 // steady memory state. Keep scheduling tasks until we reach this state. |
| 1324 if (!work_to_schedule.tiles_to_raster.empty()) { | 1354 if (!work_to_schedule.tiles_to_raster.empty()) { |
| 1325 ScheduleTasks(work_to_schedule); | 1355 ScheduleTasks(std::move(work_to_schedule)); |
| 1326 return; | 1356 return; |
| 1327 } | 1357 } |
| 1328 | 1358 |
| 1329 // If we're not in SMOOTHNESS_TAKES_PRIORITY mode, we should unlock all | 1359 // If we're not in SMOOTHNESS_TAKES_PRIORITY mode, we should unlock all |
| 1330 // images since we're technically going idle here at least for this frame. | 1360 // images since we're technically going idle here at least for this frame. |
| 1331 if (global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY) { | 1361 if (global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY) { |
| 1332 image_controller_.SetPredecodeImages(std::vector<DrawImage>(), | 1362 image_controller_.SetPredecodeImages(std::vector<DrawImage>(), |
| 1333 ImageDecodeCache::TracingInfo()); | 1363 ImageDecodeCache::TracingInfo()); |
| 1334 locked_image_tasks_.clear(); | 1364 locked_image_tasks_.clear(); |
| 1335 } | 1365 } |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1656 all_tile_tasks_completed = false; | 1686 all_tile_tasks_completed = false; |
| 1657 did_notify_all_tile_tasks_completed = false; | 1687 did_notify_all_tile_tasks_completed = false; |
| 1658 } | 1688 } |
| 1659 | 1689 |
| 1660 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1690 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
| 1661 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1691 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
| 1662 PrioritizedWorkToSchedule&& other) = default; | 1692 PrioritizedWorkToSchedule&& other) = default; |
| 1663 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1693 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
| 1664 | 1694 |
| 1665 } // namespace cc | 1695 } // namespace cc |
| OLD | NEW |