| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 scoped_refptr<RasterSource> raster_source, | 50 scoped_refptr<RasterSource> raster_source, |
| 51 const gfx::Rect& content_rect, | 51 const gfx::Rect& content_rect, |
| 52 const gfx::Rect& invalid_content_rect, | 52 const gfx::Rect& invalid_content_rect, |
| 53 float contents_scale, | 53 float contents_scale, |
| 54 const RasterSource::PlaybackSettings& playback_settings, | 54 const RasterSource::PlaybackSettings& playback_settings, |
| 55 TileResolution tile_resolution, | 55 TileResolution tile_resolution, |
| 56 int layer_id, | 56 int layer_id, |
| 57 uint64_t source_prepare_tiles_id, | 57 uint64_t source_prepare_tiles_id, |
| 58 Tile* tile, | 58 Tile* tile, |
| 59 uint64_t new_content_id, | 59 uint64_t new_content_id, |
| 60 uint64_t previous_content_id, | |
| 61 uint64_t resource_content_id, | |
| 62 int source_frame_number, | 60 int source_frame_number, |
| 63 std::unique_ptr<RasterBuffer> raster_buffer, | 61 std::unique_ptr<RasterBuffer> raster_buffer, |
| 64 TileTask::Vector* dependencies, | 62 TileTask::Vector* dependencies, |
| 65 bool supports_concurrent_execution) | 63 bool supports_concurrent_execution) |
| 66 : TileTask(supports_concurrent_execution, dependencies), | 64 : TileTask(supports_concurrent_execution, dependencies), |
| 67 tile_manager_(tile_manager), | 65 tile_manager_(tile_manager), |
| 68 resource_(resource), | 66 resource_(resource), |
| 69 raster_source_(std::move(raster_source)), | 67 raster_source_(std::move(raster_source)), |
| 70 content_rect_(content_rect), | 68 content_rect_(content_rect), |
| 71 invalid_content_rect_(invalid_content_rect), | 69 invalid_content_rect_(invalid_content_rect), |
| 72 contents_scale_(contents_scale), | 70 contents_scale_(contents_scale), |
| 73 playback_settings_(playback_settings), | 71 playback_settings_(playback_settings), |
| 74 tile_resolution_(tile_resolution), | 72 tile_resolution_(tile_resolution), |
| 75 layer_id_(layer_id), | 73 layer_id_(layer_id), |
| 76 source_prepare_tiles_id_(source_prepare_tiles_id), | 74 source_prepare_tiles_id_(source_prepare_tiles_id), |
| 77 tile_(tile), | 75 tile_(tile), |
| 78 new_content_id_(new_content_id), | 76 new_content_id_(new_content_id), |
| 79 previous_content_id_(previous_content_id), | |
| 80 resource_content_id_(resource_content_id), | |
| 81 source_frame_number_(source_frame_number), | 77 source_frame_number_(source_frame_number), |
| 82 raster_buffer_(std::move(raster_buffer)) {} | 78 raster_buffer_(std::move(raster_buffer)) {} |
| 83 | 79 |
| 84 // Overridden from Task: | 80 // Overridden from Task: |
| 85 void RunOnWorkerThread() override { | 81 void RunOnWorkerThread() override { |
| 86 TRACE_EVENT1("cc", "RasterizerTaskImpl::RunOnWorkerThread", | 82 TRACE_EVENT1("cc", "RasterizerTaskImpl::RunOnWorkerThread", |
| 87 "source_prepare_tiles_id", source_prepare_tiles_id_); | 83 "source_prepare_tiles_id", source_prepare_tiles_id_); |
| 88 | 84 |
| 89 DCHECK(raster_source_.get()); | 85 DCHECK(raster_source_.get()); |
| 90 DCHECK(raster_buffer_); | 86 DCHECK(raster_buffer_); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 116 scoped_refptr<RasterSource> raster_source_; | 112 scoped_refptr<RasterSource> raster_source_; |
| 117 gfx::Rect content_rect_; | 113 gfx::Rect content_rect_; |
| 118 gfx::Rect invalid_content_rect_; | 114 gfx::Rect invalid_content_rect_; |
| 119 float contents_scale_; | 115 float contents_scale_; |
| 120 RasterSource::PlaybackSettings playback_settings_; | 116 RasterSource::PlaybackSettings playback_settings_; |
| 121 TileResolution tile_resolution_; | 117 TileResolution tile_resolution_; |
| 122 int layer_id_; | 118 int layer_id_; |
| 123 uint64_t source_prepare_tiles_id_; | 119 uint64_t source_prepare_tiles_id_; |
| 124 Tile* tile_; | 120 Tile* tile_; |
| 125 uint64_t new_content_id_; | 121 uint64_t new_content_id_; |
| 126 uint64_t previous_content_id_; | |
| 127 uint64_t resource_content_id_; | |
| 128 int source_frame_number_; | 122 int source_frame_number_; |
| 129 std::unique_ptr<RasterBuffer> raster_buffer_; | 123 std::unique_ptr<RasterBuffer> raster_buffer_; |
| 130 | 124 |
| 131 DISALLOW_COPY_AND_ASSIGN(RasterTaskImpl); | 125 DISALLOW_COPY_AND_ASSIGN(RasterTaskImpl); |
| 132 }; | 126 }; |
| 133 | 127 |
| 134 TaskCategory TaskCategoryForTileTask(TileTask* task, | 128 TaskCategory TaskCategoryForTileTask(TileTask* task, |
| 135 bool use_foreground_category) { | 129 bool use_foreground_category) { |
| 136 if (!task->supports_concurrent_execution()) | 130 if (!task->supports_concurrent_execution()) |
| 137 return TASK_CATEGORY_NONCONCURRENT_FOREGROUND; | 131 return TASK_CATEGORY_NONCONCURRENT_FOREGROUND; |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 | 933 |
| 940 bool supports_concurrent_execution = !use_gpu_rasterization_; | 934 bool supports_concurrent_execution = !use_gpu_rasterization_; |
| 941 std::unique_ptr<RasterBuffer> raster_buffer = | 935 std::unique_ptr<RasterBuffer> raster_buffer = |
| 942 tile_task_manager_->GetRasterBufferProvider()->AcquireBufferForRaster( | 936 tile_task_manager_->GetRasterBufferProvider()->AcquireBufferForRaster( |
| 943 resource, resource_content_id, tile->invalidated_id()); | 937 resource, resource_content_id, tile->invalidated_id()); |
| 944 return make_scoped_refptr(new RasterTaskImpl( | 938 return make_scoped_refptr(new RasterTaskImpl( |
| 945 this, resource, prioritized_tile.raster_source(), tile->content_rect(), | 939 this, resource, prioritized_tile.raster_source(), tile->content_rect(), |
| 946 tile->invalidated_content_rect(), tile->contents_scale(), | 940 tile->invalidated_content_rect(), tile->contents_scale(), |
| 947 playback_settings, prioritized_tile.priority().resolution, | 941 playback_settings, prioritized_tile.priority().resolution, |
| 948 tile->layer_id(), prepare_tiles_count_, tile, tile->id(), | 942 tile->layer_id(), prepare_tiles_count_, tile, tile->id(), |
| 949 tile->invalidated_id(), resource_content_id, tile->source_frame_number(), | 943 tile->source_frame_number(), std::move(raster_buffer), &decode_tasks, |
| 950 std::move(raster_buffer), &decode_tasks, supports_concurrent_execution)); | 944 supports_concurrent_execution)); |
| 951 } | 945 } |
| 952 | 946 |
| 953 void TileManager::OnRasterTaskCompleted( | 947 void TileManager::OnRasterTaskCompleted( |
| 954 std::unique_ptr<RasterBuffer> raster_buffer, | 948 std::unique_ptr<RasterBuffer> raster_buffer, |
| 955 Tile* tile, | 949 Tile* tile, |
| 956 Resource* resource, | 950 Resource* resource, |
| 957 bool was_canceled) { | 951 bool was_canceled) { |
| 958 DCHECK(tile); | 952 DCHECK(tile); |
| 959 DCHECK(tiles_.find(tile->id()) != tiles_.end()); | 953 DCHECK(tiles_.find(tile->id()) != tiles_.end()); |
| 960 tile_task_manager_->GetRasterBufferProvider()->ReleaseBufferForRaster( | 954 tile_task_manager_->GetRasterBufferProvider()->ReleaseBufferForRaster( |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 void TileManager::Signals::reset() { | 1276 void TileManager::Signals::reset() { |
| 1283 ready_to_activate = false; | 1277 ready_to_activate = false; |
| 1284 did_notify_ready_to_activate = false; | 1278 did_notify_ready_to_activate = false; |
| 1285 ready_to_draw = false; | 1279 ready_to_draw = false; |
| 1286 did_notify_ready_to_draw = false; | 1280 did_notify_ready_to_draw = false; |
| 1287 all_tile_tasks_completed = false; | 1281 all_tile_tasks_completed = false; |
| 1288 did_notify_all_tile_tasks_completed = false; | 1282 did_notify_all_tile_tasks_completed = false; |
| 1289 } | 1283 } |
| 1290 | 1284 |
| 1291 } // namespace cc | 1285 } // namespace cc |
| OLD | NEW |