#include <TaskList.h>
Definition at line 20 of file TaskList.h.
◆ TaskList()
skgpu::graphite::TaskList::TaskList |
( |
| ) |
|
|
default |
◆ add() [1/2]
void skgpu::graphite::TaskList::add |
( |
sk_sp< Task > |
task | ) |
|
|
inline |
Definition at line 25 of file TaskList.h.
25{ fTasks.emplace_back(std::move(task)); }
◆ add() [2/2]
void skgpu::graphite::TaskList::add |
( |
TaskList && |
tasks | ) |
|
|
inline |
Definition at line 24 of file TaskList.h.
24{ fTasks.move_back(tasks.fTasks); }
◆ addCommands()
Definition at line 44 of file TaskList.cpp.
46 {
48 return this->visitTasks([&](
Task* task) {
49 return task->addCommands(context, commandBuffer, replayData);
50 });
51}
#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val)
◆ hasTasks()
bool skgpu::graphite::TaskList::hasTasks |
( |
| ) |
const |
|
inline |
Definition at line 29 of file TaskList.h.
29{ return !fTasks.empty(); }
◆ prepareResources()
Definition at line 36 of file TaskList.cpp.
37 {
39 return this->visitTasks([&](
Task* task) {
40 return task->prepareResources(resourceProvider, runtimeDict);
41 });
42}
◆ reset()
void skgpu::graphite::TaskList::reset |
( |
| ) |
|
|
inline |
◆ size()
int skgpu::graphite::TaskList::size |
( |
| ) |
const |
|
inline |
Definition at line 28 of file TaskList.h.
28{ return fTasks.size(); }
◆ visitTasks()
template<typename Fn >
Status skgpu::graphite::TaskList::visitTasks |
( |
Fn |
fn | ) |
|
Definition at line 16 of file TaskList.cpp.
16 {
17 int discardCount = 0;
19 if (!task) {
20 discardCount++;
21 continue;
22 }
23
24 Status status = fn(task.get());
25 if (status == Status::kFail) {
26 return Status::kFail;
27 } else if (status == Status::kDiscard) {
28 task.reset();
29 discardCount++;
30 }
31 }
32
33 return discardCount == fTasks.size() ? Status::kDiscard : Status::kSuccess;
34}
The documentation for this class was generated from the following files: