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

Unified Diff: cc/raster/tile_task_runner.h

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/raster/tile_task_runner.h
diff --git a/cc/raster/tile_task_runner.h b/cc/raster/tile_task_runner.h
index 5e2f7fd1c96e96b6a4806ebdaa95badc7861d146..22c535fdb79e40351e90b0ae3adb62d811c638fb 100644
--- a/cc/raster/tile_task_runner.h
+++ b/cc/raster/tile_task_runner.h
@@ -10,77 +10,17 @@
#include <vector>
#include "base/callback.h"
+#include "cc/raster/raster_buffer.h"
+#include "cc/raster/task.h"
#include "cc/raster/task_graph_runner.h"
#include "cc/resources/resource_format.h"
namespace cc {
-class ImageDecodeTask;
-class RasterTask;
-class Resource;
-class RasterBuffer;
-
-class CC_EXPORT TileTaskClient {
- public:
- virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource,
- uint64_t resource_content_id,
- uint64_t previous_content_id) = 0;
- virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) = 0;
-
- protected:
- virtual ~TileTaskClient() {}
-};
-
-class CC_EXPORT TileTask : public Task {
- public:
- typedef std::vector<scoped_refptr<TileTask>> Vector;
-
- virtual void ScheduleOnOriginThread(TileTaskClient* client) = 0;
- virtual void CompleteOnOriginThread(TileTaskClient* client) = 0;
-
- void WillSchedule();
- void DidSchedule();
- bool HasBeenScheduled() const;
-
- void WillComplete();
- void DidComplete();
- bool HasCompleted() const;
-
- protected:
- TileTask();
- ~TileTask() override;
-
- bool did_schedule_;
- bool did_complete_;
-};
-
-class CC_EXPORT ImageDecodeTask : public TileTask {
- public:
- typedef std::vector<scoped_refptr<ImageDecodeTask>> Vector;
-
- protected:
- ImageDecodeTask();
- ~ImageDecodeTask() override;
-};
-
-class CC_EXPORT RasterTask : public TileTask {
- public:
- typedef std::vector<scoped_refptr<RasterTask>> Vector;
-
- const ImageDecodeTask::Vector& dependencies() const { return dependencies_; }
-
- protected:
- explicit RasterTask(ImageDecodeTask::Vector* dependencies);
- ~RasterTask() override;
-
- private:
- ImageDecodeTask::Vector dependencies_;
-};
// This interface can be used to schedule and run tile tasks.
// The client can call CheckForCompletedTasks() at any time to dispatch
// pending completion callbacks for all tasks that have finished running.
-class CC_EXPORT TileTaskRunner {
+class CC_EXPORT TileTaskRunner : public RasterBufferProvider {
public:
// Tells the worker pool to shutdown after canceling all previously scheduled
// tasks. Reply callbacks are still guaranteed to run when
@@ -107,7 +47,7 @@ class CC_EXPORT TileTaskRunner {
// Check if resource format matches output format.
static bool ResourceFormatRequiresSwizzle(ResourceFormat format);
- virtual ~TileTaskRunner() {}
+ ~TileTaskRunner() override {}
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698