OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_RASTER_GPU_TILE_TASK_WORKER_POOL_H_ | |
6 #define CC_RASTER_GPU_TILE_TASK_WORKER_POOL_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "base/macros.h" | |
11 #include "cc/raster/tile_task_worker_pool.h" | |
12 | |
13 namespace cc { | |
14 class ContextProvider; | |
15 class GpuRasterizer; | |
16 class ResourceProvider; | |
17 | |
18 class CC_EXPORT GpuTileTaskWorkerPool : public TileTaskWorkerPool, | |
19 public RasterBufferProvider { | |
20 public: | |
21 ~GpuTileTaskWorkerPool() override; | |
22 | |
23 static std::unique_ptr<TileTaskWorkerPool> Create( | |
24 base::SequencedTaskRunner* task_runner, | |
25 TaskGraphRunner* task_graph_runner, | |
26 ContextProvider* context_provider, | |
27 ResourceProvider* resource_provider, | |
28 bool use_distance_field_text, | |
29 int gpu_rasterization_msaa_sample_count); | |
30 | |
31 // Overridden from TileTaskWorkerPool: | |
32 void Shutdown() override; | |
33 void ScheduleTasks(TaskGraph* graph) override; | |
34 void CheckForCompletedTasks() override; | |
35 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; | |
36 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; | |
37 RasterBufferProvider* AsRasterBufferProvider() override; | |
38 | |
39 // Overridden from RasterBufferProvider: | |
40 std::unique_ptr<RasterBuffer> AcquireBufferForRaster( | |
41 const Resource* resource, | |
42 uint64_t resource_content_id, | |
43 uint64_t previous_content_id) override; | |
44 void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override; | |
45 | |
46 private: | |
47 GpuTileTaskWorkerPool(base::SequencedTaskRunner* task_runner, | |
48 TaskGraphRunner* task_graph_runner, | |
49 ContextProvider* context_provider, | |
50 ResourceProvider* resource_provider, | |
51 bool use_distance_field_text, | |
52 int gpu_rasterization_msaa_sample_count); | |
53 | |
54 void CompleteTasks(const Task::Vector& tasks); | |
55 | |
56 scoped_refptr<base::SequencedTaskRunner> task_runner_; | |
57 TaskGraphRunner* task_graph_runner_; | |
58 const NamespaceToken namespace_token_; | |
59 std::unique_ptr<GpuRasterizer> rasterizer_; | |
60 | |
61 Task::Vector completed_tasks_; | |
62 | |
63 DISALLOW_COPY_AND_ASSIGN(GpuTileTaskWorkerPool); | |
64 }; | |
65 | |
66 } // namespace cc | |
67 | |
68 #endif // CC_RASTER_GPU_TILE_TASK_WORKER_POOL_H_ | |
OLD | NEW |