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

Unified Diff: cc/raster/tile_task_worker_pool_perftest.cc

Issue 1903733003: cc: Implement states for Task for stricter control. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@land_merge_tile_task_runner
Patch Set: feedback Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/raster/tile_task.cc ('k') | cc/raster/tile_task_worker_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/tile_task_worker_pool_perftest.cc
diff --git a/cc/raster/tile_task_worker_pool_perftest.cc b/cc/raster/tile_task_worker_pool_perftest.cc
index 7da843034eb84fd0a0801eb80d7bc130488aa3e2..46251dc9a35cbdb932f78514bc776fa0b7a5ba6c 100644
--- a/cc/raster/tile_task_worker_pool_perftest.cc
+++ b/cc/raster/tile_task_worker_pool_perftest.cc
@@ -136,7 +136,7 @@ class PerfImageDecodeTaskImpl : public TileTask {
}
void Reset() {
- did_run_ = false;
+ state().Reset();
did_complete_ = false;
}
@@ -167,7 +167,7 @@ class PerfRasterTaskImpl : public TileTask {
}
void Reset() {
- did_run_ = false;
+ state().Reset();
did_complete_ = false;
}
@@ -202,19 +202,20 @@ class TileTaskWorkerPoolPerfTestBase {
}
void CreateRasterTasks(unsigned num_raster_tasks,
- const TileTask::Vector& image_decode_tasks,
+ unsigned num_image_decode_tasks,
RasterTaskVector* raster_tasks) {
const gfx::Size size(1, 1);
for (unsigned i = 0; i < num_raster_tasks; ++i) {
+ TileTask::Vector image_decode_tasks;
+ CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks);
std::unique_ptr<ScopedResource> resource(
ScopedResource::Create(resource_provider_.get()));
resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE,
RGBA_8888);
- TileTask::Vector dependencies = image_decode_tasks;
raster_tasks->push_back(
- new PerfRasterTaskImpl(std::move(resource), &dependencies));
+ new PerfRasterTaskImpl(std::move(resource), &image_decode_tasks));
}
}
@@ -299,10 +300,8 @@ class TileTaskWorkerPoolPerfTest
void RunScheduleTasksTest(const std::string& test_name,
unsigned num_raster_tasks,
unsigned num_image_decode_tasks) {
- TileTask::Vector image_decode_tasks;
RasterTaskVector raster_tasks;
- CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks);
- CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks);
+ CreateRasterTasks(num_raster_tasks, num_image_decode_tasks, &raster_tasks);
// Avoid unnecessary heap allocations by reusing the same graph.
TaskGraph graph;
@@ -328,11 +327,9 @@ class TileTaskWorkerPoolPerfTest
unsigned num_raster_tasks,
unsigned num_image_decode_tasks) {
const size_t kNumVersions = 2;
- TileTask::Vector image_decode_tasks[kNumVersions];
RasterTaskVector raster_tasks[kNumVersions];
for (size_t i = 0; i < kNumVersions; ++i) {
- CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks[i]);
- CreateRasterTasks(num_raster_tasks, image_decode_tasks[i],
+ CreateRasterTasks(num_raster_tasks, num_image_decode_tasks,
&raster_tasks[i]);
}
@@ -361,10 +358,8 @@ class TileTaskWorkerPoolPerfTest
void RunScheduleAndExecuteTasksTest(const std::string& test_name,
unsigned num_raster_tasks,
unsigned num_image_decode_tasks) {
- TileTask::Vector image_decode_tasks;
RasterTaskVector raster_tasks;
- CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks);
- CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks);
+ CreateRasterTasks(num_raster_tasks, num_image_decode_tasks, &raster_tasks);
// Avoid unnecessary heap allocations by reusing the same graph.
TaskGraph graph;
@@ -470,10 +465,8 @@ class TileTaskWorkerPoolCommonPerfTest : public TileTaskWorkerPoolPerfTestBase,
void RunBuildTileTaskGraphTest(const std::string& test_name,
unsigned num_raster_tasks,
unsigned num_image_decode_tasks) {
- TileTask::Vector image_decode_tasks;
RasterTaskVector raster_tasks;
- CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks);
- CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks);
+ CreateRasterTasks(num_raster_tasks, num_image_decode_tasks, &raster_tasks);
// Avoid unnecessary heap allocations by reusing the same graph.
TaskGraph graph;
« no previous file with comments | « cc/raster/tile_task.cc ('k') | cc/raster/tile_task_worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698