| 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_TEST_FAKE_TILE_TASK_MANAGER_H_ | 5 #ifndef CC_TEST_FAKE_TILE_TASK_MANAGER_H_ |
| 6 #define CC_TEST_FAKE_TILE_TASK_MANAGER_H_ | 6 #define CC_TEST_FAKE_TILE_TASK_MANAGER_H_ |
| 7 | 7 |
| 8 #include "cc/test/fake_raster_buffer_provider.h" | 8 #include "cc/test/fake_raster_buffer_provider.h" |
| 9 #include "cc/tiles/tile_task_manager.h" | 9 #include "cc/tiles/tile_task_manager.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 // This class immediately cancels the scheduled work, i.e. in ScheduleTasks() | 13 // This class immediately cancels the scheduled work, i.e. in ScheduleTasks() |
| 14 // it cancels all the tasks. | 14 // it cancels all the tasks. |
| 15 class FakeTileTaskManagerImpl : public TileTaskManager { | 15 class FakeTileTaskManagerImpl : public TileTaskManager { |
| 16 public: | 16 public: |
| 17 FakeTileTaskManagerImpl(); | 17 FakeTileTaskManagerImpl(); |
| 18 // Ctor for custom raster buffer provider. | |
| 19 FakeTileTaskManagerImpl( | |
| 20 std::unique_ptr<RasterBufferProvider> raster_buffer_provider); | |
| 21 ~FakeTileTaskManagerImpl() override; | 18 ~FakeTileTaskManagerImpl() override; |
| 22 | 19 |
| 23 // Overridden from TileTaskManager: | 20 // Overridden from TileTaskManager: |
| 24 void ScheduleTasks(TaskGraph* graph) override; | 21 void ScheduleTasks(TaskGraph* graph) override; |
| 25 void CheckForCompletedTasks() override; | 22 void CheckForCompletedTasks() override; |
| 26 void Shutdown() override; | 23 void Shutdown() override; |
| 27 RasterBufferProvider* GetRasterBufferProvider() const override; | |
| 28 | 24 |
| 29 protected: | 25 protected: |
| 30 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; | |
| 31 Task::Vector completed_tasks_; | 26 Task::Vector completed_tasks_; |
| 32 }; | 27 }; |
| 33 | 28 |
| 34 } // namespace cc | 29 } // namespace cc |
| 35 | 30 |
| 36 #endif // CC_TEST_FAKE_TILE_TASK_MANAGER_H_ | 31 #endif // CC_TEST_FAKE_TILE_TASK_MANAGER_H_ |
| OLD | NEW |