| Index: cc/raster/tile_task_runner.h
|
| diff --git a/cc/raster/tile_task_runner.h b/cc/raster/tile_task_runner.h
|
| index fe0457506e3ab21db26c0f290d443e6d049d57c8..7622871a906ab10c7134d9a18fc3abac8e603e24 100644
|
| --- a/cc/raster/tile_task_runner.h
|
| +++ b/cc/raster/tile_task_runner.h
|
| @@ -19,6 +19,13 @@ class RasterTask;
|
| class Resource;
|
| class RasterBuffer;
|
|
|
| +enum TaskType : TaskTypeId {
|
| + TASK_TYPE_DEFAULT = kDefaultTaskTypeId,
|
| + TASK_TYPE_RASTER,
|
| + TASK_TYPE_IMAGE_DECODE,
|
| + TASK_TYPE_IMAGE_UPLOAD
|
| +};
|
| +
|
| class CC_EXPORT TileTaskClient {
|
| public:
|
| virtual std::unique_ptr<RasterBuffer> AcquireBufferForRaster(
|
| @@ -35,14 +42,6 @@ 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;
|
|
|
| @@ -50,7 +49,6 @@ class CC_EXPORT TileTask : public Task {
|
| TileTask();
|
| ~TileTask() override;
|
|
|
| - bool did_schedule_;
|
| bool did_complete_;
|
| };
|
|
|
| @@ -91,13 +89,13 @@ class CC_EXPORT RasterTask : public TileTask {
|
| };
|
|
|
| // 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.
|
| +// The client can call CollectCompletedTasks() at any time to process
|
| +// all completed tasks at the moment that have finished running or cancelled.
|
| class CC_EXPORT TileTaskRunner {
|
| public:
|
| // Tells the worker pool to shutdown after canceling all previously scheduled
|
| // tasks. Reply callbacks are still guaranteed to run when
|
| - // CheckForCompletedTasks() is called.
|
| + // CollectCompletedTasks() is called.
|
| virtual void Shutdown() = 0;
|
|
|
| // Schedule running of tile tasks in |graph| and all dependencies.
|
| @@ -107,8 +105,8 @@ class CC_EXPORT TileTaskRunner {
|
| // ScheduleTasks().
|
| virtual void ScheduleTasks(TaskGraph* graph) = 0;
|
|
|
| - // Check for completed tasks and dispatch reply callbacks.
|
| - virtual void CheckForCompletedTasks() = 0;
|
| + // Collect completed tasks.
|
| + virtual void CollectCompletedTasks(Task::Vector* completed_tasks) = 0;
|
|
|
| // Returns the format to use for the tiles.
|
| virtual ResourceFormat GetResourceFormat(bool must_support_alpha) const = 0;
|
| @@ -116,6 +114,9 @@ class CC_EXPORT TileTaskRunner {
|
| // Determine if the resource requires swizzling.
|
| virtual bool GetResourceRequiresSwizzle(bool must_support_alpha) const = 0;
|
|
|
| + // TODO(prashant.n): This will be removed soon. Don't use this.
|
| + virtual TileTaskClient* AsTileTaskClient() = 0;
|
| +
|
| protected:
|
| // Check if resource format matches output format.
|
| static bool ResourceFormatRequiresSwizzle(ResourceFormat format);
|
|
|