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

Unified Diff: cc/tiles/tile_manager_perftest.cc

Issue 1854723002: cc: Simplify task and its derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected scope of dependencies. 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
Index: cc/tiles/tile_manager_perftest.cc
diff --git a/cc/tiles/tile_manager_perftest.cc b/cc/tiles/tile_manager_perftest.cc
index cc0a41497e9ce839bf102380d67602d93614ffcd..0f51cf9a79a0ad7c45a904c2c1350a9fb6b8cc66 100644
--- a/cc/tiles/tile_manager_perftest.cc
+++ b/cc/tiles/tile_manager_perftest.cc
@@ -10,7 +10,6 @@
#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "cc/debug/lap_timer.h"
-#include "cc/raster/raster_buffer.h"
#include "cc/test/begin_frame_args_test.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host_impl.h"
@@ -37,28 +36,37 @@ static const int kTimeLimitMillis = 2000;
static const int kWarmupRuns = 5;
static const int kTimeCheckInterval = 10;
-class FakeTileTaskRunnerImpl : public TileTaskRunner, public TileTaskClient {
+class FakeTileTaskRunnerImpl : public TileTaskRunner {
public:
+ // Overridden from RasterBufferProvider:
+ scoped_ptr<RasterBuffer> AcquireBufferForRaster(
+ const Resource* resource,
+ uint64_t new_content_id,
+ uint64_t previous_content_id) override {
+ return nullptr;
+ }
+ void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override {}
+
// Overridden from TileTaskRunner:
void Shutdown() override {}
void ScheduleTasks(TaskGraph* graph) override {
for (auto& node : graph->nodes) {
- TileTask* task = static_cast<TileTask*>(node.task);
+ Task* task = node.task;
task->WillSchedule();
- task->ScheduleOnOriginThread(this);
+ task->ScheduleOnOriginThread();
task->DidSchedule();
completed_tasks_.push_back(task);
}
}
void CheckForCompletedTasks() override {
- for (TileTask::Vector::iterator it = completed_tasks_.begin();
+ for (Task::Vector::iterator it = completed_tasks_.begin();
it != completed_tasks_.end(); ++it) {
- TileTask* task = it->get();
+ Task* task = it->get();
task->WillComplete();
- task->CompleteOnOriginThread(this);
+ task->CompleteOnOriginThread();
task->DidComplete();
}
completed_tasks_.clear();
@@ -70,17 +78,8 @@ class FakeTileTaskRunnerImpl : public TileTaskRunner, public TileTaskClient {
return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha));
}
- // Overridden from TileTaskClient:
- scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource,
- uint64_t new_content_id,
- uint64_t previous_content_id) override {
- return nullptr;
- }
- void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override {}
-
private:
- TileTask::Vector completed_tasks_;
+ Task::Vector completed_tasks_;
};
base::LazyInstance<FakeTileTaskRunnerImpl> g_fake_tile_task_runner =
LAZY_INSTANCE_INITIALIZER;

Powered by Google App Engine
This is Rietveld 408576698