Chromium Code Reviews| Index: cc/raster/tile_task_runner.h |
| diff --git a/cc/raster/tile_task_runner.h b/cc/raster/tile_task_runner.h |
| index 103da1fa275522ddedb57c3ca5330574e933bbcd..7c64e0b24c065781a62be13cc2bce633e8ba6b55 100644 |
| --- a/cc/raster/tile_task_runner.h |
| +++ b/cc/raster/tile_task_runner.h |
| @@ -5,7 +5,6 @@ |
| #ifndef CC_RASTER_TILE_TASK_RUNNER_H_ |
| #define CC_RASTER_TILE_TASK_RUNNER_H_ |
| -#include <bitset> |
| #include <vector> |
| #include "base/callback.h" |
| @@ -76,74 +75,22 @@ class CC_EXPORT RasterTask : public TileTask { |
| ImageDecodeTask::Vector dependencies_; |
| }; |
| -// kNumberOfTaskSets must be greater or equal to the number of values in |
| -// TileManager::NamedTaskSet. |
| -// TODO(reveman): Use template specialization to make it easy for client code to |
| -// check at compile time that the number of supported task sets is correct. |
| -static const size_t kNumberOfTaskSets = 3; |
| -typedef size_t TaskSet; |
| -typedef std::bitset<kNumberOfTaskSets> TaskSetCollection; |
| - |
| -class CC_EXPORT TileTaskRunnerClient { |
| - public: |
| - virtual void DidFinishRunningTileTasks(TaskSet task_set) = 0; |
| - |
| - protected: |
| - virtual ~TileTaskRunnerClient() {} |
| -}; |
| - |
| -struct CC_EXPORT TileTaskQueue { |
| - struct CC_EXPORT Item { |
| - class TaskComparator { |
| - public: |
| - explicit TaskComparator(const RasterTask* task) : task_(task) {} |
| - |
| - bool operator()(const Item& item) const { return item.task == task_; } |
| - |
| - private: |
| - const RasterTask* task_; |
| - }; |
| - |
| - typedef std::vector<Item> Vector; |
| - |
| - Item(RasterTask* task, const TaskSetCollection& task_sets); |
| - ~Item(); |
| - |
| - RasterTask* task; |
| - TaskSetCollection task_sets; |
| - }; |
| - |
| - TileTaskQueue(); |
| - ~TileTaskQueue(); |
| - |
| - void Swap(TileTaskQueue* other); |
| - void Reset(); |
| - |
| - Item::Vector items; |
| -}; |
| - |
| -// This interface can be used to schedule and run tile tasks. The client will |
| -// be notified asynchronously when the set of tasks marked as "required for |
| -// activation" have finished running, when tasks marked "required for draw" |
| -// have finished running, and when all scheduled tasks have finished running. |
| +// 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 { |
|
reveman
2015/11/26 00:18:30
This interface doesn't really provide anything but
ericrk
2015/11/30 23:52:16
Are you suggesting moving the scheduling logic to
reveman
2015/12/02 05:22:54
Yea, but let's save that for a follow up.
|
| public: |
| - // Set the client instance to be notified when finished running tasks. |
| - virtual void SetClient(TileTaskRunnerClient* client) = 0; |
| - |
| // Tells the worker pool to shutdown after canceling all previously scheduled |
| // tasks. Reply callbacks are still guaranteed to run when |
| // CheckForCompletedTasks() is called. |
| virtual void Shutdown() = 0; |
| - // Schedule running of tile tasks in |queue| and all dependencies. |
| - // Previously scheduled tasks that are not in |queue| will be canceled unless |
| + // Schedule running of tile tasks in |graph| and all dependencies. |
| + // Previously scheduled tasks that are not in |graph| will be canceled unless |
| // already running. Once scheduled, reply callbacks are guaranteed to run for |
| // all tasks even if they later get canceled by another call to |
| // ScheduleTasks(). |
| - virtual void ScheduleTasks(TileTaskQueue* queue) = 0; |
| + virtual void ScheduleTasks(scoped_ptr<TaskGraph> graph) = 0; |
| // Check for completed tasks and dispatch reply callbacks. |
| virtual void CheckForCompletedTasks() = 0; |