| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_TILES_TILE_TASK_MANAGER_H_ | 5 #ifndef CC_TILES_TILE_TASK_MANAGER_H_ |
| 6 #define CC_TILES_TILE_TASK_MANAGER_H_ | 6 #define CC_TILES_TILE_TASK_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "cc/raster/raster_buffer_provider.h" | 10 #include "cc/raster/raster_buffer_provider.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Previously scheduled tasks that are not in |graph| will be canceled unless | 25 // Previously scheduled tasks that are not in |graph| will be canceled unless |
| 26 // already running. Once scheduled and if not canceled by next scheduling, | 26 // already running. Once scheduled and if not canceled by next scheduling, |
| 27 // tasks are guaranteed to run. | 27 // tasks are guaranteed to run. |
| 28 virtual void ScheduleTasks(TaskGraph* graph) = 0; | 28 virtual void ScheduleTasks(TaskGraph* graph) = 0; |
| 29 | 29 |
| 30 // Check for completed tasks and call OnTaskCompleted() on them. | 30 // Check for completed tasks and call OnTaskCompleted() on them. |
| 31 virtual void CheckForCompletedTasks() = 0; | 31 virtual void CheckForCompletedTasks() = 0; |
| 32 | 32 |
| 33 // Shutdown after canceling all previously scheduled tasks. | 33 // Shutdown after canceling all previously scheduled tasks. |
| 34 virtual void Shutdown() = 0; | 34 virtual void Shutdown() = 0; |
| 35 |
| 36 // Get RasterBufferProvider. |
| 37 virtual RasterBufferProvider* GetRasterBufferProvider() const = 0; |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 class CC_EXPORT TileTaskManagerImpl : public TileTaskManager { | 40 class CC_EXPORT TileTaskManagerImpl : public TileTaskManager { |
| 38 public: | 41 public: |
| 39 ~TileTaskManagerImpl() override; | 42 ~TileTaskManagerImpl() override; |
| 40 | 43 |
| 41 static std::unique_ptr<TileTaskManagerImpl> Create( | 44 static std::unique_ptr<TileTaskManagerImpl> Create( |
| 45 std::unique_ptr<RasterBufferProvider> raster_buffer_provider, |
| 42 TaskGraphRunner* task_graph_runner); | 46 TaskGraphRunner* task_graph_runner); |
| 43 | 47 |
| 44 // Overridden from TileTaskManager: | 48 // Overridden from TileTaskManager: |
| 45 void ScheduleTasks(TaskGraph* graph) override; | 49 void ScheduleTasks(TaskGraph* graph) override; |
| 46 void CheckForCompletedTasks() override; | 50 void CheckForCompletedTasks() override; |
| 47 void Shutdown() override; | 51 void Shutdown() override; |
| 52 RasterBufferProvider* GetRasterBufferProvider() const override; |
| 48 | 53 |
| 49 protected: | 54 protected: |
| 50 explicit TileTaskManagerImpl(TaskGraphRunner* task_graph_runner); | 55 TileTaskManagerImpl( |
| 56 std::unique_ptr<RasterBufferProvider> raster_buffer_provider, |
| 57 TaskGraphRunner* task_graph_runner); |
| 51 | 58 |
| 59 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; |
| 52 TaskGraphRunner* task_graph_runner_; | 60 TaskGraphRunner* task_graph_runner_; |
| 53 const NamespaceToken namespace_token_; | 61 const NamespaceToken namespace_token_; |
| 54 | 62 |
| 55 private: | 63 private: |
| 56 DISALLOW_COPY_AND_ASSIGN(TileTaskManagerImpl); | 64 DISALLOW_COPY_AND_ASSIGN(TileTaskManagerImpl); |
| 57 }; | 65 }; |
| 58 | 66 |
| 59 } // namespace cc | 67 } // namespace cc |
| 60 | 68 |
| 61 #endif // CC_TILES_TILE_TASK_MANAGER_H_ | 69 #endif // CC_TILES_TILE_TASK_MANAGER_H_ |
| OLD | NEW |