Index: cc/test/fake_tile_manager.cc |
diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc |
index 94ca37b18904e7360f2430b787ceb8e0bf3be178..768e518052631a0e83fb0b4798e0f1c04ca15ee8 100644 |
--- a/cc/test/fake_tile_manager.cc |
+++ b/cc/test/fake_tile_manager.cc |
@@ -13,60 +13,13 @@ |
#include "base/lazy_instance.h" |
#include "base/thread_task_runner_handle.h" |
#include "cc/raster/raster_buffer.h" |
-#include "cc/raster/tile_task_worker_pool.h" |
+#include "cc/test/fake_tile_task_manager.h" |
namespace cc { |
namespace { |
-class FakeTileTaskWorkerPoolImpl : public TileTaskWorkerPool, |
- public RasterBufferProvider { |
- public: |
- // Overridden from TileTaskWorkerPool: |
- void Shutdown() override {} |
- void ScheduleTasks(TaskGraph* graph) override { |
- for (const auto& node : graph->nodes) { |
- TileTask* task = static_cast<TileTask*>(node.task); |
- |
- task->WillSchedule(); |
- task->ScheduleOnOriginThread(this); |
- task->DidSchedule(); |
- |
- completed_tasks_.push_back(task); |
- } |
- } |
- void CheckForCompletedTasks() override { |
- for (TileTask::Vector::iterator it = completed_tasks_.begin(); |
- it != completed_tasks_.end(); ++it) { |
- TileTask* task = it->get(); |
- |
- task->WillComplete(); |
- task->CompleteOnOriginThread(this); |
- task->DidComplete(); |
- } |
- completed_tasks_.clear(); |
- } |
- ResourceFormat GetResourceFormat(bool must_support_alpha) const override { |
- return RGBA_8888; |
- } |
- bool GetResourceRequiresSwizzle(bool must_support_alpha) const override { |
- return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); |
- } |
- RasterBufferProvider* AsRasterBufferProvider() override { return this; } |
- |
- // Overridden from RasterBufferProvider: |
- std::unique_ptr<RasterBuffer> AcquireBufferForRaster( |
- const Resource* resource, |
- uint64_t resource_content_id, |
- uint64_t previous_content_id) override { |
- return nullptr; |
- } |
- void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override {} |
- |
- private: |
- TileTask::Vector completed_tasks_; |
-}; |
-base::LazyInstance<FakeTileTaskWorkerPoolImpl> g_fake_tile_task_worker_pool = |
+base::LazyInstance<FakeTileTaskManagerImpl> g_fake_tile_task_manager = |
LAZY_INSTANCE_INITIALIZER; |
} // namespace |
@@ -76,9 +29,9 @@ FakeTileManager::FakeTileManager(TileManagerClient* client) |
base::ThreadTaskRunnerHandle::Get(), |
std::numeric_limits<size_t>::max(), |
false /* use_partial_raster */) { |
- SetResources(nullptr, g_fake_tile_task_worker_pool.Pointer(), |
- &image_decode_controller_, std::numeric_limits<size_t>::max(), |
- false /* use_gpu_rasterization */); |
+ SetResources( |
+ nullptr, &image_decode_controller_, g_fake_tile_task_manager.Pointer(), |
+ std::numeric_limits<size_t>::max(), false /* use_gpu_rasterization */); |
} |
FakeTileManager::FakeTileManager(TileManagerClient* client, |
@@ -87,8 +40,9 @@ FakeTileManager::FakeTileManager(TileManagerClient* client, |
base::ThreadTaskRunnerHandle::Get(), |
std::numeric_limits<size_t>::max(), |
false /* use_partial_raster */) { |
- SetResources(resource_pool, g_fake_tile_task_worker_pool.Pointer(), |
- &image_decode_controller_, std::numeric_limits<size_t>::max(), |
+ SetResources(resource_pool, &image_decode_controller_, |
+ g_fake_tile_task_manager.Pointer(), |
+ std::numeric_limits<size_t>::max(), |
false /* use_gpu_rasterization */); |
} |