Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: cc/tiles/tile_manager.cc

Issue 2797583002: cc: Add color space to image decode caches (Closed)
Patch Set: Fix perf test compile Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 const std::vector<PrioritizedTile>& tiles_to_process_for_images = 856 const std::vector<PrioritizedTile>& tiles_to_process_for_images =
857 work_to_schedule.tiles_to_process_for_images; 857 work_to_schedule.tiles_to_process_for_images;
858 std::vector<DrawImage> new_locked_images; 858 std::vector<DrawImage> new_locked_images;
859 for (const PrioritizedTile& prioritized_tile : tiles_to_process_for_images) { 859 for (const PrioritizedTile& prioritized_tile : tiles_to_process_for_images) {
860 Tile* tile = prioritized_tile.tile(); 860 Tile* tile = prioritized_tile.tile();
861 861
862 // TODO(khushalsagar): Send these images to the ImageDecodeService, through 862 // TODO(khushalsagar): Send these images to the ImageDecodeService, through
863 // the CheckerImageTracker as well. See crbug.com/691087. 863 // the CheckerImageTracker as well. See crbug.com/691087.
864 std::vector<DrawImage> images; 864 std::vector<DrawImage> images;
865 prioritized_tile.raster_source()->GetDiscardableImagesInRect( 865 prioritized_tile.raster_source()->GetDiscardableImagesInRect(
866 tile->enclosing_layer_rect(), tile->contents_scale(), &images); 866 tile->enclosing_layer_rect(), tile->contents_scale(),
867 raster_color_space, &images);
867 new_locked_images.insert(new_locked_images.end(), images.begin(), 868 new_locked_images.insert(new_locked_images.end(), images.begin(),
868 images.end()); 869 images.end());
869 } 870 }
870 871
871 // TODO(vmpstr): SOON is misleading here, but these images can come from 872 // TODO(vmpstr): SOON is misleading here, but these images can come from
872 // several diffent tiles. Rethink what we actually want to trace here. Note 873 // several diffent tiles. Rethink what we actually want to trace here. Note
873 // that I'm using SOON, since it can't be NOW (these are prepaint). 874 // that I'm using SOON, since it can't be NOW (these are prepaint).
874 ImageDecodeCache::TracingInfo tracing_info(prepare_tiles_count_, 875 ImageDecodeCache::TracingInfo tracing_info(prepare_tiles_count_,
875 TilePriority::SOON); 876 TilePriority::SOON);
876 std::vector<scoped_refptr<TileTask>> new_locked_image_tasks = 877 std::vector<scoped_refptr<TileTask>> new_locked_image_tasks =
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 playback_settings.skip_images = 961 playback_settings.skip_images =
961 prioritized_tile.priority().resolution == LOW_RESOLUTION; 962 prioritized_tile.priority().resolution == LOW_RESOLUTION;
962 963
963 // Create and queue all image decode tasks that this tile depends on. 964 // Create and queue all image decode tasks that this tile depends on.
964 TileTask::Vector decode_tasks; 965 TileTask::Vector decode_tasks;
965 std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()]; 966 std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()];
966 ImageIdFlatSet images_to_skip; 967 ImageIdFlatSet images_to_skip;
967 images.clear(); 968 images.clear();
968 if (!playback_settings.skip_images) { 969 if (!playback_settings.skip_images) {
969 prioritized_tile.raster_source()->GetDiscardableImagesInRect( 970 prioritized_tile.raster_source()->GetDiscardableImagesInRect(
970 tile->enclosing_layer_rect(), tile->contents_scale(), &images); 971 tile->enclosing_layer_rect(), tile->contents_scale(), color_space,
972 &images);
971 checker_image_tracker_.FilterImagesForCheckeringForTile( 973 checker_image_tracker_.FilterImagesForCheckeringForTile(
972 &images, &images_to_skip, prioritized_tile.tile()->tiling()->tree()); 974 &images, &images_to_skip, prioritized_tile.tile()->tiling()->tree());
973 } 975 }
974 976
975 // We can skip the image hijack canvas if we have no images, or no images to 977 // We can skip the image hijack canvas if we have no images, or no images to
976 // skip during raster. 978 // skip during raster.
977 playback_settings.use_image_hijack_canvas = 979 playback_settings.use_image_hijack_canvas =
978 !images.empty() || !images_to_skip.empty(); 980 !images.empty() || !images_to_skip.empty();
979 playback_settings.images_to_skip = std::move(images_to_skip); 981 playback_settings.images_to_skip = std::move(images_to_skip);
980 982
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 all_tile_tasks_completed = false; 1434 all_tile_tasks_completed = false;
1433 did_notify_all_tile_tasks_completed = false; 1435 did_notify_all_tile_tasks_completed = false;
1434 } 1436 }
1435 1437
1436 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; 1438 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default;
1437 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( 1439 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule(
1438 PrioritizedWorkToSchedule&& other) = default; 1440 PrioritizedWorkToSchedule&& other) = default;
1439 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; 1441 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default;
1440 1442
1441 } // namespace cc 1443 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698