| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RASTER_BITMAP_TILE_TASK_WORKER_POOL_H_ | 5 #ifndef CC_RASTER_BITMAP_TILE_TASK_WORKER_POOL_H_ |
| 6 #define CC_RASTER_BITMAP_TILE_TASK_WORKER_POOL_H_ | 6 #define CC_RASTER_BITMAP_TILE_TASK_WORKER_POOL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "cc/raster/tile_task_worker_pool.h" | 12 #include "cc/raster/tile_task_worker_pool.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 namespace trace_event { | 15 namespace trace_event { |
| 16 class ConvertableToTraceFormat; | 16 class ConvertableToTraceFormat; |
| 17 } | 17 } |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace cc { | 20 namespace cc { |
| 21 class ResourceProvider; | 21 class ResourceProvider; |
| 22 | 22 |
| 23 class CC_EXPORT BitmapTileTaskWorkerPool : public TileTaskWorkerPool, | 23 class CC_EXPORT BitmapTileTaskWorkerPool : public TileTaskWorkerPool, |
| 24 public RasterBufferProvider { | 24 public RasterBufferProvider { |
| 25 public: | 25 public: |
| 26 ~BitmapTileTaskWorkerPool() override; | 26 ~BitmapTileTaskWorkerPool() override; |
| 27 | 27 |
| 28 static std::unique_ptr<TileTaskWorkerPool> Create( | 28 static std::unique_ptr<TileTaskWorkerPool> Create( |
| 29 base::SequencedTaskRunner* task_runner, | |
| 30 TaskGraphRunner* task_graph_runner, | |
| 31 ResourceProvider* resource_provider); | 29 ResourceProvider* resource_provider); |
| 32 | 30 |
| 33 // Overridden from TileTaskWorkerPool: | 31 // Overridden from TileTaskWorkerPool: |
| 34 void Shutdown() override; | 32 void BarrierToSyncResources() override; |
| 35 void ScheduleTasks(TaskGraph* graph) override; | |
| 36 void CheckForCompletedTasks() override; | |
| 37 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; | 33 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; |
| 38 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; | 34 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; |
| 39 RasterBufferProvider* AsRasterBufferProvider() override; | 35 RasterBufferProvider* AsRasterBufferProvider() override; |
| 40 | 36 |
| 41 // Overridden from RasterBufferProvider: | 37 // Overridden from RasterBufferProvider: |
| 42 std::unique_ptr<RasterBuffer> AcquireBufferForRaster( | 38 std::unique_ptr<RasterBuffer> AcquireBufferForRaster( |
| 43 const Resource* resource, | 39 const Resource* resource, |
| 44 uint64_t resource_content_id, | 40 uint64_t resource_content_id, |
| 45 uint64_t previous_content_id) override; | 41 uint64_t previous_content_id) override; |
| 46 void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override; | 42 void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override; |
| 47 | 43 |
| 48 protected: | 44 protected: |
| 49 BitmapTileTaskWorkerPool(base::SequencedTaskRunner* task_runner, | 45 explicit BitmapTileTaskWorkerPool(ResourceProvider* resource_provider); |
| 50 TaskGraphRunner* task_graph_runner, | |
| 51 ResourceProvider* resource_provider); | |
| 52 | 46 |
| 53 private: | 47 private: |
| 54 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> StateAsValue() | 48 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> StateAsValue() |
| 55 const; | 49 const; |
| 56 | 50 |
| 57 scoped_refptr<base::SequencedTaskRunner> task_runner_; | |
| 58 TaskGraphRunner* task_graph_runner_; | |
| 59 const NamespaceToken namespace_token_; | |
| 60 ResourceProvider* resource_provider_; | 51 ResourceProvider* resource_provider_; |
| 61 | 52 |
| 62 Task::Vector completed_tasks_; | |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(BitmapTileTaskWorkerPool); | 53 DISALLOW_COPY_AND_ASSIGN(BitmapTileTaskWorkerPool); |
| 65 }; | 54 }; |
| 66 | 55 |
| 67 } // namespace cc | 56 } // namespace cc |
| 68 | 57 |
| 69 #endif // CC_RASTER_BITMAP_TILE_TASK_WORKER_POOL_H_ | 58 #endif // CC_RASTER_BITMAP_TILE_TASK_WORKER_POOL_H_ |
| OLD | NEW |