| 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; | |
| 38 }; | 35 }; |
| 39 | 36 |
| 40 class CC_EXPORT TileTaskManagerImpl : public TileTaskManager { | 37 class CC_EXPORT TileTaskManagerImpl : public TileTaskManager { |
| 41 public: | 38 public: |
| 42 ~TileTaskManagerImpl() override; | 39 ~TileTaskManagerImpl() override; |
| 43 | 40 |
| 44 static std::unique_ptr<TileTaskManagerImpl> Create( | 41 static std::unique_ptr<TileTaskManagerImpl> Create( |
| 45 std::unique_ptr<RasterBufferProvider> raster_buffer_provider, | |
| 46 TaskGraphRunner* task_graph_runner); | 42 TaskGraphRunner* task_graph_runner); |
| 47 | 43 |
| 48 // Overridden from TileTaskManager: | 44 // Overridden from TileTaskManager: |
| 49 void ScheduleTasks(TaskGraph* graph) override; | 45 void ScheduleTasks(TaskGraph* graph) override; |
| 50 void CheckForCompletedTasks() override; | 46 void CheckForCompletedTasks() override; |
| 51 void Shutdown() override; | 47 void Shutdown() override; |
| 52 RasterBufferProvider* GetRasterBufferProvider() const override; | |
| 53 | 48 |
| 54 protected: | 49 protected: |
| 55 TileTaskManagerImpl( | 50 explicit TileTaskManagerImpl(TaskGraphRunner* task_graph_runner); |
| 56 std::unique_ptr<RasterBufferProvider> raster_buffer_provider, | |
| 57 TaskGraphRunner* task_graph_runner); | |
| 58 | 51 |
| 59 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; | |
| 60 TaskGraphRunner* task_graph_runner_; | 52 TaskGraphRunner* task_graph_runner_; |
| 61 const NamespaceToken namespace_token_; | 53 const NamespaceToken namespace_token_; |
| 62 | 54 |
| 63 private: | 55 private: |
| 64 DISALLOW_COPY_AND_ASSIGN(TileTaskManagerImpl); | 56 DISALLOW_COPY_AND_ASSIGN(TileTaskManagerImpl); |
| 65 }; | 57 }; |
| 66 | 58 |
| 67 } // namespace cc | 59 } // namespace cc |
| 68 | 60 |
| 69 #endif // CC_TILES_TILE_TASK_MANAGER_H_ | 61 #endif // CC_TILES_TILE_TASK_MANAGER_H_ |
| OLD | NEW |