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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 const std::vector<PrioritizedTile>& tiles_to_process_for_images = | 858 const std::vector<PrioritizedTile>& tiles_to_process_for_images = |
859 work_to_schedule.tiles_to_process_for_images; | 859 work_to_schedule.tiles_to_process_for_images; |
860 std::vector<DrawImage> new_locked_images; | 860 std::vector<DrawImage> new_locked_images; |
861 for (const PrioritizedTile& prioritized_tile : tiles_to_process_for_images) { | 861 for (const PrioritizedTile& prioritized_tile : tiles_to_process_for_images) { |
862 Tile* tile = prioritized_tile.tile(); | 862 Tile* tile = prioritized_tile.tile(); |
863 | 863 |
864 // TODO(khushalsagar): Send these images to the ImageDecodeService, through | 864 // TODO(khushalsagar): Send these images to the ImageDecodeService, through |
865 // the CheckerImageTracker as well. See crbug.com/691087. | 865 // the CheckerImageTracker as well. See crbug.com/691087. |
866 std::vector<DrawImage> images; | 866 std::vector<DrawImage> images; |
867 prioritized_tile.raster_source()->GetDiscardableImagesInRect( | 867 prioritized_tile.raster_source()->GetDiscardableImagesInRect( |
868 tile->enclosing_layer_rect(), tile->contents_scale(), &images); | 868 tile->enclosing_layer_rect(), tile->contents_scale(), |
| 869 raster_color_space, &images); |
869 new_locked_images.insert(new_locked_images.end(), images.begin(), | 870 new_locked_images.insert(new_locked_images.end(), images.begin(), |
870 images.end()); | 871 images.end()); |
871 } | 872 } |
872 | 873 |
873 // TODO(vmpstr): SOON is misleading here, but these images can come from | 874 // TODO(vmpstr): SOON is misleading here, but these images can come from |
874 // several diffent tiles. Rethink what we actually want to trace here. Note | 875 // several diffent tiles. Rethink what we actually want to trace here. Note |
875 // that I'm using SOON, since it can't be NOW (these are prepaint). | 876 // that I'm using SOON, since it can't be NOW (these are prepaint). |
876 ImageDecodeCache::TracingInfo tracing_info(prepare_tiles_count_, | 877 ImageDecodeCache::TracingInfo tracing_info(prepare_tiles_count_, |
877 TilePriority::SOON); | 878 TilePriority::SOON); |
878 std::vector<scoped_refptr<TileTask>> new_locked_image_tasks = | 879 std::vector<scoped_refptr<TileTask>> new_locked_image_tasks = |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 playback_settings.skip_images = | 963 playback_settings.skip_images = |
963 prioritized_tile.priority().resolution == LOW_RESOLUTION; | 964 prioritized_tile.priority().resolution == LOW_RESOLUTION; |
964 | 965 |
965 // Create and queue all image decode tasks that this tile depends on. | 966 // Create and queue all image decode tasks that this tile depends on. |
966 TileTask::Vector decode_tasks; | 967 TileTask::Vector decode_tasks; |
967 std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()]; | 968 std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()]; |
968 ImageIdFlatSet images_to_skip; | 969 ImageIdFlatSet images_to_skip; |
969 images.clear(); | 970 images.clear(); |
970 if (!playback_settings.skip_images) { | 971 if (!playback_settings.skip_images) { |
971 prioritized_tile.raster_source()->GetDiscardableImagesInRect( | 972 prioritized_tile.raster_source()->GetDiscardableImagesInRect( |
972 tile->enclosing_layer_rect(), tile->contents_scale(), &images); | 973 tile->enclosing_layer_rect(), tile->contents_scale(), color_space, |
| 974 &images); |
973 checker_image_tracker_.FilterImagesForCheckeringForTile( | 975 checker_image_tracker_.FilterImagesForCheckeringForTile( |
974 &images, &images_to_skip, prioritized_tile.tile()->tiling()->tree()); | 976 &images, &images_to_skip, prioritized_tile.tile()->tiling()->tree()); |
975 } | 977 } |
976 | 978 |
977 // We can skip the image hijack canvas if we have no images, or no images to | 979 // We can skip the image hijack canvas if we have no images, or no images to |
978 // skip during raster. | 980 // skip during raster. |
979 playback_settings.use_image_hijack_canvas = | 981 playback_settings.use_image_hijack_canvas = |
980 !images.empty() || !images_to_skip.empty(); | 982 !images.empty() || !images_to_skip.empty(); |
981 playback_settings.images_to_skip = std::move(images_to_skip); | 983 playback_settings.images_to_skip = std::move(images_to_skip); |
982 | 984 |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 all_tile_tasks_completed = false; | 1436 all_tile_tasks_completed = false; |
1435 did_notify_all_tile_tasks_completed = false; | 1437 did_notify_all_tile_tasks_completed = false; |
1436 } | 1438 } |
1437 | 1439 |
1438 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1440 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
1439 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1441 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
1440 PrioritizedWorkToSchedule&& other) = default; | 1442 PrioritizedWorkToSchedule&& other) = default; |
1441 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1443 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
1442 | 1444 |
1443 } // namespace cc | 1445 } // namespace cc |
OLD | NEW |