Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
graphite
task
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
11
#include "
src/gpu/graphite/ScratchResourceManager.h
"
12
#include "
src/gpu/graphite/task/Task.h
"
13
#include "
src/gpu/graphite/task/TaskList.h
"
14
15
namespace
skgpu::graphite
{
16
17
class
TextureProxy;
18
19
/**
20
* DrawTask is a collection of subtasks that are executed in order to produce some intended
21
* image in the DrawTask's target. As such, at least one of its subtasks will either be a
22
* RenderPassTask, ComputeTask or CopyXToTextureTask that directly modify the target.
23
*/
24
class
DrawTask
final :
public
Task
,
private
ScratchResourceManager::PendingUseListener
{
25
public
:
26
explicit
DrawTask
(
sk_sp<TextureProxy>
target
);
27
~DrawTask
()
override
;
28
29
Status
prepareResources
(
ResourceProvider
*,
30
ScratchResourceManager
*,
31
const
RuntimeEffectDictionary
*)
override
;
32
33
Status
addCommands
(
Context
*,
CommandBuffer
*,
ReplayTargetData
)
override
;
34
35
private
:
36
friend
class
DrawContext
;
// for "addTask"
37
38
// DrawTask is modified directly by DrawContext for efficiency, but its task list will be
39
// fixed once DrawContext snaps the task.
40
void
addTask(
sk_sp<Task>
task) { fChildTasks.
add
(std::move(task)); }
41
bool
hasTasks()
const
{
return
fChildTasks.
hasTasks
(); }
42
43
void
onUseCompleted(ScratchResourceManager*)
override
;
44
45
sk_sp<TextureProxy>
fTarget;
46
TaskList fChildTasks;
47
48
// Once there is one DrawTask for a scratch device, whether or not the target is instantaited
49
// will be equivalent to whether or not prepareResources() has been called already if the task
50
// is referenced multiple times in a Recording. Right now, however, a scratch device can still
51
// produce several DrawTasks (in which case they will see an instantiated proxy so should still
52
// prepare their own resources instead of discarding themselves).
53
bool
fPrepared =
false
;
54
};
55
56
}
// namespace skgpu::graphite
57
58
#endif
// skgpu_graphite_task_DrawTask_DEFINED
ScratchResourceManager.h
TaskList.h
Task.h
sk_sp
Definition:
SkRefCnt.h:220
skgpu::graphite::CommandBuffer
Definition:
CommandBuffer.h:38
skgpu::graphite::Context
Definition:
Context.h:43
skgpu::graphite::DrawContext
Definition:
DrawContext.h:44
skgpu::graphite::DrawTask
Definition:
DrawTask.h:24
skgpu::graphite::DrawTask::prepareResources
Status prepareResources(ResourceProvider *, ScratchResourceManager *, const RuntimeEffectDictionary *) override
Definition:
DrawTask.cpp:20
skgpu::graphite::DrawTask::~DrawTask
~DrawTask() override
skgpu::graphite::DrawTask::DrawTask
DrawTask(sk_sp< TextureProxy > target)
Definition:
DrawTask.cpp:16
skgpu::graphite::DrawTask::addCommands
Status addCommands(Context *, CommandBuffer *, ReplayTargetData) override
Definition:
DrawTask.cpp:65
skgpu::graphite::ResourceProvider
Definition:
ResourceProvider.h:50
skgpu::graphite::RuntimeEffectDictionary
Definition:
RuntimeEffectDictionary.h:22
skgpu::graphite::ScratchResourceManager::PendingUseListener
Definition:
ScratchResourceManager.h:129
skgpu::graphite::ScratchResourceManager
Definition:
ScratchResourceManager.h:75
skgpu::graphite::TaskList::hasTasks
bool hasTasks() const
Definition:
TaskList.h:30
skgpu::graphite::TaskList::add
void add(TaskList &&tasks)
Definition:
TaskList.h:25
skgpu::graphite::Task
Definition:
Task.h:23
skgpu::graphite::Task::Status
Status
Definition:
Task.h:31
target
uint32_t * target
Definition:
fl_texture_registrar_test.cc:40
skgpu::graphite
Definition:
BoundsManagerBench.cpp:27
skgpu::graphite::Task::ReplayTargetData
Definition:
Task.h:26
Generated on Sun Jun 23 2024 21:56:28 for Flutter Engine by
1.9.4