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_TILE_TASK_RUNNER_H_ | |
6 #define CC_RASTER_TILE_TASK_RUNNER_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include <vector> | |
11 | |
12 #include "base/callback.h" | |
13 #include "cc/raster/task_graph_runner.h" | |
14 #include "cc/resources/resource_format.h" | |
15 | |
16 namespace cc { | |
17 | |
18 enum TaskType : TaskTypeId { | |
19 TASK_TYPE_DEFAULT = kDefaultTaskTypeId, | |
20 TASK_TYPE_RASTER, | |
21 TASK_TYPE_IMAGE_DECODE, | |
22 TASK_TYPE_IMAGE_UPLOAD | |
23 }; | |
24 | |
25 class CC_EXPORT TileTask : public Task { | |
26 public: | |
27 typedef std::vector<scoped_refptr<TileTask>> Vector; | |
28 | |
29 void DidComplete(); | |
30 bool HasCompleted() const; | |
31 | |
32 protected: | |
33 TileTask(); | |
34 ~TileTask() override; | |
35 | |
36 bool did_complete_; | |
37 }; | |
38 | |
39 class CC_EXPORT ImageDecodeTask : public TileTask { | |
40 public: | |
41 typedef std::vector<scoped_refptr<ImageDecodeTask>> Vector; | |
42 | |
43 // Indicates whether this ImageDecodeTask can be run at the same time as | |
44 // other tasks in the task graph. If false, this task will be scheduled with | |
45 // TASK_CATEGORY_NONCONCURRENT_FOREGROUND. The base implementation always | |
46 // returns true. | |
47 virtual bool SupportsConcurrentExecution() const; | |
48 | |
49 // Returns an optional task which this task depends on. May be null. | |
50 const scoped_refptr<ImageDecodeTask>& dependency() { return dependency_; } | |
51 | |
52 protected: | |
53 ImageDecodeTask(); | |
54 explicit ImageDecodeTask(scoped_refptr<ImageDecodeTask> dependency); | |
55 ~ImageDecodeTask() override; | |
56 | |
57 private: | |
58 scoped_refptr<ImageDecodeTask> dependency_; | |
59 }; | |
60 | |
61 class CC_EXPORT RasterTask : public TileTask { | |
62 public: | |
63 typedef std::vector<scoped_refptr<RasterTask>> Vector; | |
64 | |
65 const ImageDecodeTask::Vector& dependencies() const { return dependencies_; } | |
66 | |
67 protected: | |
68 explicit RasterTask(ImageDecodeTask::Vector* dependencies); | |
69 ~RasterTask() override; | |
70 | |
71 private: | |
72 ImageDecodeTask::Vector dependencies_; | |
73 }; | |
74 | |
75 } // namespace cc | |
76 | |
77 #endif // CC_RASTER_TILE_TASK_RUNNER_H_ | |
OLD | NEW |