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

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

Issue 2563743004: [3/5] Add translated rasterization support for RasterBuffer & below (Closed)
Patch Set: rebase 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>
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/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/base/scale_translate2d.h"
26 #include "cc/debug/traced_value.h" 27 #include "cc/debug/traced_value.h"
27 #include "cc/layers/picture_layer_impl.h" 28 #include "cc/layers/picture_layer_impl.h"
28 #include "cc/raster/raster_buffer.h" 29 #include "cc/raster/raster_buffer.h"
29 #include "cc/raster/task_category.h" 30 #include "cc/raster/task_category.h"
30 #include "cc/tiles/frame_viewer_instrumentation.h" 31 #include "cc/tiles/frame_viewer_instrumentation.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 {
35 namespace { 36 namespace {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(raster_source_.get(), content_rect_,
130 invalid_content_rect_, new_content_id_, 131 invalid_content_rect_, new_content_id_,
131 raster_scale_, playback_settings_); 132 ScaleTranslate2d(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
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