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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 prioritized_tile.raster_source()->GetDiscardableImagesInRect( | 979 prioritized_tile.raster_source()->GetDiscardableImagesInRect( |
980 tile->enclosing_layer_rect(), tile->raster_transform().scale(), | 980 tile->enclosing_layer_rect(), tile->raster_transform().scale(), |
981 raster_color_space, &images); | 981 raster_color_space, &images); |
982 new_locked_images.insert(new_locked_images.end(), images.begin(), | 982 new_locked_images.insert(new_locked_images.end(), images.begin(), |
983 images.end()); | 983 images.end()); |
984 } | 984 } |
985 | 985 |
986 // TODO(vmpstr): SOON is misleading here, but these images can come from | 986 // TODO(vmpstr): SOON is misleading here, but these images can come from |
987 // several diffent tiles. Rethink what we actually want to trace here. Note | 987 // several diffent tiles. Rethink what we actually want to trace here. Note |
988 // that I'm using SOON, since it can't be NOW (these are prepaint). | 988 // that I'm using SOON, since it can't be NOW (these are prepaint). |
989 ImageDecodeCache::TracingInfo tracing_info(prepare_tiles_count_, | 989 ImageDecodeCache::TracingInfo tracing_info( |
990 TilePriority::SOON); | 990 prepare_tiles_count_, TilePriority::SOON, |
| 991 ImageDecodeCache::TaskType::kInRaster); |
991 std::vector<scoped_refptr<TileTask>> new_locked_image_tasks = | 992 std::vector<scoped_refptr<TileTask>> new_locked_image_tasks = |
992 image_controller_.SetPredecodeImages(std::move(new_locked_images), | 993 image_controller_.SetPredecodeImages(std::move(new_locked_images), |
993 tracing_info); | 994 tracing_info); |
994 for (auto& task : new_locked_image_tasks) { | 995 for (auto& task : new_locked_image_tasks) { |
995 auto decode_it = std::find_if(graph_.nodes.begin(), graph_.nodes.end(), | 996 auto decode_it = std::find_if(graph_.nodes.begin(), graph_.nodes.end(), |
996 [&task](const TaskGraph::Node& node) { | 997 [&task](const TaskGraph::Node& node) { |
997 return node.task == task.get(); | 998 return node.task == task.get(); |
998 }); | 999 }); |
999 // If this task is already in the graph, then we don't have to insert it. | 1000 // If this task is already in the graph, then we don't have to insert it. |
1000 if (decode_it != graph_.nodes.end()) | 1001 if (decode_it != graph_.nodes.end()) |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 playback_settings.use_image_hijack_canvas = | 1115 playback_settings.use_image_hijack_canvas = |
1115 !sync_decoded_images.empty() || !playback_settings.images_to_skip.empty(); | 1116 !sync_decoded_images.empty() || !playback_settings.images_to_skip.empty(); |
1116 | 1117 |
1117 bool has_checker_images = !playback_settings.images_to_skip.empty(); | 1118 bool has_checker_images = !playback_settings.images_to_skip.empty(); |
1118 tile->set_raster_task_scheduled_with_checker_images(has_checker_images); | 1119 tile->set_raster_task_scheduled_with_checker_images(has_checker_images); |
1119 if (has_checker_images) | 1120 if (has_checker_images) |
1120 num_of_tiles_with_checker_images_++; | 1121 num_of_tiles_with_checker_images_++; |
1121 | 1122 |
1122 // Get the tasks for the required images. | 1123 // Get the tasks for the required images. |
1123 ImageDecodeCache::TracingInfo tracing_info( | 1124 ImageDecodeCache::TracingInfo tracing_info( |
1124 prepare_tiles_count_, prioritized_tile.priority().priority_bin); | 1125 prepare_tiles_count_, prioritized_tile.priority().priority_bin, |
| 1126 ImageDecodeCache::TaskType::kInRaster); |
1125 image_controller_.GetTasksForImagesAndRef(&sync_decoded_images, &decode_tasks, | 1127 image_controller_.GetTasksForImagesAndRef(&sync_decoded_images, &decode_tasks, |
1126 tracing_info); | 1128 tracing_info); |
1127 | 1129 |
1128 std::unique_ptr<RasterBuffer> raster_buffer = | 1130 std::unique_ptr<RasterBuffer> raster_buffer = |
1129 raster_buffer_provider_->AcquireBufferForRaster( | 1131 raster_buffer_provider_->AcquireBufferForRaster( |
1130 resource, resource_content_id, tile->invalidated_id()); | 1132 resource, resource_content_id, tile->invalidated_id()); |
1131 return make_scoped_refptr(new RasterTaskImpl( | 1133 return make_scoped_refptr(new RasterTaskImpl( |
1132 this, tile, resource, prioritized_tile.raster_source(), playback_settings, | 1134 this, tile, resource, prioritized_tile.raster_source(), playback_settings, |
1133 prioritized_tile.priority().resolution, invalidated_rect, | 1135 prioritized_tile.priority().resolution, invalidated_rect, |
1134 prepare_tiles_count_, std::move(raster_buffer), &decode_tasks, | 1136 prepare_tiles_count_, std::move(raster_buffer), &decode_tasks, |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 all_tile_tasks_completed = false; | 1658 all_tile_tasks_completed = false; |
1657 did_notify_all_tile_tasks_completed = false; | 1659 did_notify_all_tile_tasks_completed = false; |
1658 } | 1660 } |
1659 | 1661 |
1660 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1662 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
1661 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1663 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
1662 PrioritizedWorkToSchedule&& other) = default; | 1664 PrioritizedWorkToSchedule&& other) = default; |
1663 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1665 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
1664 | 1666 |
1665 } // namespace cc | 1667 } // namespace cc |
OLD | NEW |