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