Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
graphite
task
Task.h
Go to the documentation of this file.
1
/*
2
* Copyright 2021 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_Task_DEFINED
9
#define skgpu_graphite_task_Task_DEFINED
10
11
#include "
include/core/SkPoint.h
"
12
#include "
include/core/SkRefCnt.h
"
13
14
namespace
skgpu::graphite
{
15
16
class
CommandBuffer;
17
class
Context
;
18
class
ResourceProvider
;
19
class
RuntimeEffectDictionary;
20
class
Texture;
21
22
class
Task
:
public
SkRefCnt
{
23
public
:
24
// Holds a render target and translation to use in the task's work, if necessary.
25
struct
ReplayTargetData
{
26
const
Texture
*
fTarget
;
27
SkIVector
fTranslation
;
28
};
29
30
enum class
Status
{
31
// The task step (prepareResources or addCommands) succeeded, proceed to the next task.
32
// If the Recording is replayed, this task should be executed again.
33
kSuccess
,
34
// The task step succeeded, but it was a one-time-only operation and should be removed from
35
// the task list. If this is returned from prepareResources(), the task is removed before
36
// addCommands() will ever be called. If this is returned from addCommands(), it will not
37
// be part of any replayed Recording, but any added commands from the first call will be
38
// executed once.
39
//
40
// NOTE: If a task step needs to be conditionally processed but repeatable, it should
41
// internally skip work and still return kSuccess instead of kDiscard.
42
kDiscard
,
43
// The step failed and cannot be recovered so the Recording is invalidated.
44
kFail
45
};
46
47
// Instantiate and prepare any Resources that must happen while the Task is still on the
48
// Recorder.
49
virtual
Status
prepareResources
(
ResourceProvider
*,
const
RuntimeEffectDictionary
*) = 0;
50
51
// Returns true on success; false on failure.
52
virtual
Status
addCommands
(
Context
*,
CommandBuffer
*,
ReplayTargetData
) = 0;
53
};
54
55
}
// namespace skgpu::graphite
56
57
#endif
// skgpu_graphite_task_Task_DEFINED
SkPoint.h
SkRefCnt.h
SkRefCnt
Definition
SkRefCnt.h:119
skgpu::graphite::CommandBuffer
Definition
CommandBuffer.h:38
skgpu::graphite::Context
Definition
Context.h:43
skgpu::graphite::ResourceProvider
Definition
ResourceProvider.h:50
skgpu::graphite::RuntimeEffectDictionary
Definition
RuntimeEffectDictionary.h:22
skgpu::graphite::Task
Definition
Task.h:22
skgpu::graphite::Task::addCommands
virtual Status addCommands(Context *, CommandBuffer *, ReplayTargetData)=0
skgpu::graphite::Task::Status
Status
Definition
Task.h:30
skgpu::graphite::Task::Status::kDiscard
@ kDiscard
skgpu::graphite::Task::Status::kFail
@ kFail
skgpu::graphite::Task::Status::kSuccess
@ kSuccess
skgpu::graphite::Task::prepareResources
virtual Status prepareResources(ResourceProvider *, const RuntimeEffectDictionary *)=0
skgpu::graphite::Texture
Definition
Texture.h:24
skresources::ResourceProvider
Definition
SkResources.h:150
skgpu::graphite
Definition
BoundsManagerBench.cpp:27
Context
Definition
SerialProcsTest.cpp:126
SkIPoint
Definition
SkPoint_impl.h:28
skgpu::graphite::Task::ReplayTargetData
Definition
Task.h:25
skgpu::graphite::Task::ReplayTargetData::fTarget
const Texture * fTarget
Definition
Task.h:26
skgpu::graphite::Task::ReplayTargetData::fTranslation
SkIVector fTranslation
Definition
Task.h:27
Generated on Fri Apr 26 2024 06:17:20 for Flutter Engine by
1.9.8