Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / cc / raster / bitmap_tile_task_worker_pool.h
blob3df206a09bdc25d1b463c1e4bd4bb6ee2e15888e
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.
5 #ifndef CC_RASTER_BITMAP_TILE_TASK_WORKER_POOL_H_
6 #define CC_RASTER_BITMAP_TILE_TASK_WORKER_POOL_H_
8 #include "base/memory/weak_ptr.h"
9 #include "base/values.h"
10 #include "cc/raster/tile_task_runner.h"
11 #include "cc/raster/tile_task_worker_pool.h"
13 namespace base {
14 namespace trace_event {
15 class ConvertableToTraceFormat;
19 namespace cc {
20 class ResourceProvider;
22 class CC_EXPORT BitmapTileTaskWorkerPool : public TileTaskWorkerPool,
23 public TileTaskRunner,
24 public TileTaskClient {
25 public:
26 ~BitmapTileTaskWorkerPool() override;
28 static scoped_ptr<TileTaskWorkerPool> Create(
29 base::SequencedTaskRunner* task_runner,
30 TaskGraphRunner* task_graph_runner,
31 ResourceProvider* resource_provider);
33 // Overridden from TileTaskWorkerPool:
34 TileTaskRunner* AsTileTaskRunner() override;
36 // Overridden from TileTaskRunner:
37 void SetClient(TileTaskRunnerClient* client) override;
38 void Shutdown() override;
39 void ScheduleTasks(TileTaskQueue* queue) override;
40 void CheckForCompletedTasks() override;
41 ResourceFormat GetResourceFormat() const override;
42 bool GetResourceRequiresSwizzle() const override;
44 // Overridden from TileTaskClient:
45 scoped_ptr<RasterBuffer> AcquireBufferForRaster(
46 const Resource* resource,
47 uint64_t resource_content_id,
48 uint64_t previous_content_id) override;
49 void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
51 protected:
52 BitmapTileTaskWorkerPool(base::SequencedTaskRunner* task_runner,
53 TaskGraphRunner* task_graph_runner,
54 ResourceProvider* resource_provider);
56 private:
57 void OnTaskSetFinished(TaskSet task_set);
58 scoped_refptr<base::trace_event::ConvertableToTraceFormat> StateAsValue()
59 const;
61 scoped_refptr<base::SequencedTaskRunner> task_runner_;
62 TaskGraphRunner* task_graph_runner_;
63 const NamespaceToken namespace_token_;
64 TileTaskRunnerClient* client_;
65 ResourceProvider* resource_provider_;
67 TaskSetCollection tasks_pending_;
69 scoped_refptr<TileTask> task_set_finished_tasks_[kNumberOfTaskSets];
71 // Task graph used when scheduling tasks and vector used to gather
72 // completed tasks.
73 TaskGraph graph_;
74 Task::Vector completed_tasks_;
76 base::WeakPtrFactory<BitmapTileTaskWorkerPool>
77 task_set_finished_weak_ptr_factory_;
79 DISALLOW_COPY_AND_ASSIGN(BitmapTileTaskWorkerPool);
82 } // namespace cc
84 #endif // CC_RASTER_BITMAP_TILE_TASK_WORKER_POOL_H_