Chromium Code Reviews| 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> |
| 11 #include <limits> | 11 #include <limits> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/json/json_writer.h" | 15 #include "base/json/json_writer.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
| 19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
| 20 #include "base/numerics/safe_conversions.h" | 20 #include "base/numerics/safe_conversions.h" |
| 21 #include "base/optional.h" | 21 #include "base/optional.h" |
| 22 #include "base/threading/thread_checker.h" | 22 #include "base/threading/thread_checker.h" |
| 23 #include "base/trace_event/trace_event_argument.h" | 23 #include "base/trace_event/trace_event_argument.h" |
| 24 #include "cc/base/histograms.h" | 24 #include "cc/base/histograms.h" |
| 25 #include "cc/base/scale_translate2d.h" | |
| 25 #include "cc/debug/devtools_instrumentation.h" | 26 #include "cc/debug/devtools_instrumentation.h" |
| 26 #include "cc/debug/frame_viewer_instrumentation.h" | 27 #include "cc/debug/frame_viewer_instrumentation.h" |
| 27 #include "cc/debug/traced_value.h" | 28 #include "cc/debug/traced_value.h" |
| 28 #include "cc/layers/picture_layer_impl.h" | 29 #include "cc/layers/picture_layer_impl.h" |
| 29 #include "cc/raster/raster_buffer.h" | 30 #include "cc/raster/raster_buffer.h" |
| 30 #include "cc/raster/task_category.h" | 31 #include "cc/raster/task_category.h" |
| 31 #include "cc/tiles/tile.h" | 32 #include "cc/tiles/tile.h" |
| 32 #include "ui/gfx/geometry/rect_conversions.h" | 33 #include "ui/gfx/geometry/rect_conversions.h" |
| 33 | 34 |
| 34 namespace cc { | 35 namespace cc { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 DCHECK(raster_source_.get()); | 120 DCHECK(raster_source_.get()); |
| 120 DCHECK(raster_buffer_); | 121 DCHECK(raster_buffer_); |
| 121 | 122 |
| 122 frame_viewer_instrumentation::ScopedRasterTask raster_task( | 123 frame_viewer_instrumentation::ScopedRasterTask raster_task( |
| 123 tile_tracing_id_, tile_resolution_, source_frame_number_, layer_id_); | 124 tile_tracing_id_, tile_resolution_, source_frame_number_, layer_id_); |
| 124 ScopedRasterTaskTimer timer(is_gpu_rasterization_); | 125 ScopedRasterTaskTimer timer(is_gpu_rasterization_); |
| 125 timer.SetArea(content_rect_.size().GetArea()); | 126 timer.SetArea(content_rect_.size().GetArea()); |
| 126 | 127 |
| 127 DCHECK(raster_source_); | 128 DCHECK(raster_source_); |
| 128 | 129 |
| 130 DCHECK_EQ(raster_scales_.width(), raster_scales_.height()); | |
|
enne (OOO)
2017/01/03 22:53:16
Similarly here, I think you should change this to
trchen
2017/01/14 01:06:37
Done.
| |
| 129 raster_buffer_->Playback(raster_source_.get(), content_rect_, | 131 raster_buffer_->Playback(raster_source_.get(), content_rect_, |
| 130 invalid_content_rect_, new_content_id_, | 132 invalid_content_rect_, new_content_id_, |
| 131 raster_scales_, playback_settings_); | 133 ScaleTranslate2d(raster_scales_.width(), gfx::Vecto r2dF()), playback_settings_); |
| 132 } | 134 } |
| 133 | 135 |
| 134 // Overridden from TileTask: | 136 // Overridden from TileTask: |
| 135 void OnTaskCompleted() override { | 137 void OnTaskCompleted() override { |
| 136 DCHECK(origin_thread_checker_.CalledOnValidThread()); | 138 DCHECK(origin_thread_checker_.CalledOnValidThread()); |
| 137 | 139 |
| 138 // Here calling state().IsCanceled() is thread-safe, because this task is | 140 // Here calling state().IsCanceled() is thread-safe, because this task is |
| 139 // already concluded as FINISHED or CANCELLED and no longer will be worked | 141 // already concluded as FINISHED or CANCELLED and no longer will be worked |
| 140 // upon by task graph runner. | 142 // upon by task graph runner. |
| 141 tile_manager_->OnRasterTaskCompleted(std::move(raster_buffer_), tile_, | 143 tile_manager_->OnRasterTaskCompleted(std::move(raster_buffer_), tile_, |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1340 all_tile_tasks_completed = false; | 1342 all_tile_tasks_completed = false; |
| 1341 did_notify_all_tile_tasks_completed = false; | 1343 did_notify_all_tile_tasks_completed = false; |
| 1342 } | 1344 } |
| 1343 | 1345 |
| 1344 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1346 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
| 1345 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1347 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
| 1346 PrioritizedWorkToSchedule&& other) = default; | 1348 PrioritizedWorkToSchedule&& other) = default; |
| 1347 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1349 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
| 1348 | 1350 |
| 1349 } // namespace cc | 1351 } // namespace cc |
| OLD | NEW |