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 11 matching lines...) Expand all Loading... |
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/devtools_instrumentation.h" | 24 #include "cc/base/devtools_instrumentation.h" |
25 #include "cc/base/histograms.h" | 25 #include "cc/base/histograms.h" |
26 #include "cc/debug/traced_value.h" | 26 #include "cc/debug/traced_value.h" |
27 #include "cc/layers/picture_layer_impl.h" | 27 #include "cc/layers/picture_layer_impl.h" |
28 #include "cc/raster/raster_buffer.h" | 28 #include "cc/raster/raster_buffer.h" |
29 #include "cc/raster/task_category.h" | 29 #include "cc/raster/task_category.h" |
30 #include "cc/tiles/frame_viewer_instrumentation.h" | 30 #include "cc/tiles/frame_viewer_instrumentation.h" |
31 #include "cc/tiles/tile.h" | 31 #include "cc/tiles/tile.h" |
| 32 #include "ui/gfx/geometry/axis_transform2d.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 { |
35 namespace { | 36 namespace { |
36 | 37 |
37 // Flag to indicate whether we should try and detect that | 38 // Flag to indicate whether we should try and detect that |
38 // a tile is of solid color. | 39 // a tile is of solid color. |
39 const bool kUseColorEstimator = true; | 40 const bool kUseColorEstimator = true; |
40 | 41 |
41 // TODO(enne): remove this histogram and its monitoring in M58 once there is | 42 // TODO(enne): remove this histogram and its monitoring in M58 once there is |
(...skipping 77 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 |
129 raster_buffer_->Playback(raster_source_.get(), content_rect_, | 130 raster_buffer_->Playback( |
130 invalid_content_rect_, new_content_id_, | 131 raster_source_.get(), content_rect_, invalid_content_rect_, |
131 raster_scale_, playback_settings_); | 132 new_content_id_, gfx::AxisTransform2d(raster_scale_, gfx::Vector2dF()), |
| 133 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_id_, | 143 tile_manager_->OnRasterTaskCompleted(std::move(raster_buffer_), tile_id_, |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |