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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
935 tile->id(), tile->invalidated_content_rect(), tile->invalidated_id(), | 935 tile->id(), tile->invalidated_content_rect(), tile->invalidated_id(), |
936 &invalidated_rect); | 936 &invalidated_rect); |
937 } | 937 } |
938 | 938 |
939 if (resource) { | 939 if (resource) { |
940 resource_content_id = tile->invalidated_id(); | 940 resource_content_id = tile->invalidated_id(); |
941 DCHECK_EQ(DetermineResourceFormat(tile), resource->format()); | 941 DCHECK_EQ(DetermineResourceFormat(tile), resource->format()); |
942 } else { | 942 } else { |
943 resource = resource_pool_->AcquireResource(tile->desired_texture_size(), | 943 resource = resource_pool_->AcquireResource(tile->desired_texture_size(), |
944 DetermineResourceFormat(tile), | 944 DetermineResourceFormat(tile), |
945 gfx::ColorSpace()); | 945 tile->color_space()); |
ccameron
2016/09/12 23:44:24
This is where we need to get the ColorSpace plumbe
| |
946 } | 946 } |
947 | 947 |
948 // For LOW_RESOLUTION tiles, we don't draw or predecode images. | 948 // For LOW_RESOLUTION tiles, we don't draw or predecode images. |
949 RasterSource::PlaybackSettings playback_settings; | 949 RasterSource::PlaybackSettings playback_settings; |
950 playback_settings.skip_images = | 950 playback_settings.skip_images = |
951 prioritized_tile.priority().resolution == LOW_RESOLUTION; | 951 prioritized_tile.priority().resolution == LOW_RESOLUTION; |
952 | 952 |
953 // Create and queue all image decode tasks that this tile depends on. | 953 // Create and queue all image decode tasks that this tile depends on. |
954 TileTask::Vector decode_tasks; | 954 TileTask::Vector decode_tasks; |
955 std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()]; | 955 std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()]; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1021 draw_info.resource_ = resource; | 1021 draw_info.resource_ = resource; |
1022 draw_info.contents_swizzled_ = DetermineResourceRequiresSwizzle(tile); | 1022 draw_info.contents_swizzled_ = DetermineResourceRequiresSwizzle(tile); |
1023 | 1023 |
1024 DCHECK(draw_info.IsReadyToDraw()); | 1024 DCHECK(draw_info.IsReadyToDraw()); |
1025 draw_info.set_was_ever_ready_to_draw(); | 1025 draw_info.set_was_ever_ready_to_draw(); |
1026 | 1026 |
1027 client_->NotifyTileStateChanged(tile); | 1027 client_->NotifyTileStateChanged(tile); |
1028 } | 1028 } |
1029 | 1029 |
1030 ScopedTilePtr TileManager::CreateTile(const Tile::CreateInfo& info, | 1030 ScopedTilePtr TileManager::CreateTile(const Tile::CreateInfo& info, |
1031 const gfx::ColorSpace& color_space, | |
1031 int layer_id, | 1032 int layer_id, |
1032 int source_frame_number, | 1033 int source_frame_number, |
1033 int flags) { | 1034 int flags) { |
1034 // We need to have a tile task worker pool to do anything meaningful with | 1035 // We need to have a tile task worker pool to do anything meaningful with |
1035 // tiles. | 1036 // tiles. |
1036 DCHECK(tile_task_manager_); | 1037 DCHECK(tile_task_manager_); |
1037 ScopedTilePtr tile( | 1038 ScopedTilePtr tile( |
1038 new Tile(this, info, layer_id, source_frame_number, flags)); | 1039 new Tile(this, info, color_space, layer_id, source_frame_number, flags)); |
1039 DCHECK(tiles_.find(tile->id()) == tiles_.end()); | 1040 DCHECK(tiles_.find(tile->id()) == tiles_.end()); |
1040 | 1041 |
1041 tiles_[tile->id()] = tile.get(); | 1042 tiles_[tile->id()] = tile.get(); |
1042 return tile; | 1043 return tile; |
1043 } | 1044 } |
1044 | 1045 |
1045 void TileManager::SetTileTaskManagerForTesting( | 1046 void TileManager::SetTileTaskManagerForTesting( |
1046 TileTaskManager* tile_task_manager) { | 1047 TileTaskManager* tile_task_manager) { |
1047 tile_task_manager_ = tile_task_manager; | 1048 tile_task_manager_ = tile_task_manager; |
1048 } | 1049 } |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1330 all_tile_tasks_completed = false; | 1331 all_tile_tasks_completed = false; |
1331 did_notify_all_tile_tasks_completed = false; | 1332 did_notify_all_tile_tasks_completed = false; |
1332 } | 1333 } |
1333 | 1334 |
1334 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1335 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
1335 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1336 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
1336 PrioritizedWorkToSchedule&& other) = default; | 1337 PrioritizedWorkToSchedule&& other) = default; |
1337 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1338 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
1338 | 1339 |
1339 } // namespace cc | 1340 } // namespace cc |
OLD | NEW |