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_TILE_TASK_H_ | 5 #ifndef CC_RASTER_TILE_TASK_H_ |
6 #define CC_RASTER_TILE_TASK_H_ | 6 #define CC_RASTER_TILE_TASK_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "cc/raster/task.h" | 10 #include "cc/raster/task.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 class RasterBufferProvider; | 13 class RasterBufferProvider; |
14 | 14 |
15 class CC_EXPORT TileTask : public Task { | 15 class CC_EXPORT TileTask : public Task { |
16 public: | 16 public: |
17 typedef std::vector<scoped_refptr<TileTask>> Vector; | 17 typedef std::vector<scoped_refptr<TileTask>> Vector; |
18 | 18 |
19 enum class Type : uint16_t { DEFAULT, RASTER, IMAGE_DECODE, IMAGE_UPLOAD }; | |
reveman
2016/05/18 16:20:31
why are we not adding the virtual functions we nee
prashant.n
2016/05/18 16:45:38
Do you mean to say - something like following?
IsR
reveman
2016/05/18 17:16:48
No, this is not what I meant. Something seems off
| |
20 | |
19 const TileTask::Vector& dependencies() const { return dependencies_; } | 21 const TileTask::Vector& dependencies() const { return dependencies_; } |
20 | 22 |
23 Type type() const { return type_; } | |
24 | |
21 // Indicates whether this TileTask can be run at the same time as other tasks | 25 // Indicates whether this TileTask can be run at the same time as other tasks |
22 // in the task graph. If false, this task will be scheduled with | 26 // in the task graph. If false, this task will be scheduled with |
23 // TASK_CATEGORY_NONCONCURRENT_FOREGROUND. | 27 // TASK_CATEGORY_NONCONCURRENT_FOREGROUND. |
24 bool supports_concurrent_execution() const { | 28 bool supports_concurrent_execution() const { |
25 return supports_concurrent_execution_; | 29 return supports_concurrent_execution_; |
26 } | 30 } |
27 | 31 |
28 virtual void ScheduleOnOriginThread(RasterBufferProvider* provider) = 0; | |
29 virtual void CompleteOnOriginThread(RasterBufferProvider* provider) = 0; | |
30 | |
31 void WillSchedule(); | |
32 void DidSchedule(); | |
33 bool HasBeenScheduled() const; | |
34 | |
35 void WillComplete(); | |
36 void DidComplete(); | |
37 bool HasCompleted() const; | |
38 | |
39 protected: | 32 protected: |
40 explicit TileTask(bool supports_concurrent_execution); | 33 explicit TileTask(Type type, bool supports_concurrent_execution); |
41 TileTask(bool supports_concurrent_execution, TileTask::Vector* dependencies); | 34 TileTask(Type type, |
35 bool supports_concurrent_execution, | |
36 TileTask::Vector* dependencies); | |
42 ~TileTask() override; | 37 ~TileTask() override; |
43 | 38 |
39 const Type type_; | |
44 const bool supports_concurrent_execution_; | 40 const bool supports_concurrent_execution_; |
45 TileTask::Vector dependencies_; | 41 TileTask::Vector dependencies_; |
46 bool did_schedule_; | |
47 bool did_complete_; | |
48 }; | 42 }; |
49 | 43 |
50 } // namespace cc | 44 } // namespace cc |
51 | 45 |
52 #endif // CC_RASTER_TILE_TASK_H_ | 46 #endif // CC_RASTER_TILE_TASK_H_ |
OLD | NEW |