Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
DrawTask.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef skgpu_graphite_task_DrawTask_DEFINED
9#define skgpu_graphite_task_DrawTask_DEFINED
10
13
14namespace skgpu::graphite {
15
16class TextureProxy;
17
18/**
19 * DrawTask is a collection of subtasks that are executed in order to produce some intended
20 * image in the DrawTask's target. As such, at least one of its subtasks will either be a
21 * RenderPassTask, ComputeTask or CopyXToTextureTask that directly modify the target.
22*/
23class DrawTask final : public Task {
24public:
26 ~DrawTask() override;
27
29
31
32private:
33 friend class DrawContext; // for "addTask"
34
35 // DrawTask is modified directly by DrawContext for efficiency, but its task list will be
36 // fixed once DrawContext snaps the task.
37 void addTask(sk_sp<Task> task) { fChildTasks.add(std::move(task)); }
38 bool hasTasks() const { return fChildTasks.hasTasks(); }
39
40 sk_sp<TextureProxy> fTarget;
41 TaskList fChildTasks;
42};
43
44} // namespace skgpu::graphite
45
46#endif // skgpu_graphite_task_DrawTask_DEFINED
Status prepareResources(ResourceProvider *, const RuntimeEffectDictionary *) override
Definition DrawTask.cpp:18
Status addCommands(Context *, CommandBuffer *, ReplayTargetData) override
Definition DrawTask.cpp:23
bool hasTasks() const
Definition TaskList.h:29
void add(TaskList &&tasks)
Definition TaskList.h:24
uint32_t * target