Flutter Engine
The Flutter Engine
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
ScratchResourceManager;
21
class
Texture;
22
23
class
Task
:
public
SkRefCnt
{
24
public
:
25
// Holds a render target and translation to use in the task's work, if necessary.
26
struct
ReplayTargetData
{
27
const
Texture
*
fTarget
;
28
SkIVector
fTranslation
;
29
};
30
31
enum class
Status
{
32
// The task step (prepareResources or addCommands) succeeded, proceed to the next task.
33
// If the Recording is replayed, this task should be executed again.
34
kSuccess
,
35
// The task step succeeded, but it was a one-time-only operation and should be removed from
36
// the task list. If this is returned from prepareResources(), the task is removed before
37
// addCommands() will ever be called. If this is returned from addCommands(), it will not
38
// be part of any replayed Recording, but any added commands from the first call will be
39
// executed once.
40
//
41
// NOTE: If a task step needs to be conditionally processed but repeatable, it should
42
// internally skip work and still return kSuccess instead of kDiscard.
43
kDiscard
,
44
// The step failed and cannot be recovered so the Recording is invalidated.
45
kFail
46
};
47
48
// Instantiate and prepare any Resources that must happen while the Task is still on the
49
// Recorder.
50
virtual
Status
prepareResources
(
ResourceProvider
*,
51
ScratchResourceManager
*,
52
const
RuntimeEffectDictionary
*) = 0;
53
54
// Returns true on success; false on failure.
55
virtual
Status
addCommands
(
Context
*,
CommandBuffer
*,
ReplayTargetData
) = 0;
56
};
57
58
}
// namespace skgpu::graphite
59
60
#endif
// skgpu_graphite_task_Task_DEFINED
GrLoadOp::kDiscard
@ kDiscard
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::ScratchResourceManager
Definition:
ScratchResourceManager.h:75
skgpu::graphite::Task
Definition:
Task.h:23
skgpu::graphite::Task::addCommands
virtual Status addCommands(Context *, CommandBuffer *, ReplayTargetData)=0
skgpu::graphite::Task::prepareResources
virtual Status prepareResources(ResourceProvider *, ScratchResourceManager *, const RuntimeEffectDictionary *)=0
skgpu::graphite::Task::Status
Status
Definition:
Task.h:31
skgpu::graphite::Texture
Definition:
Texture.h:24
skresources::ResourceProvider
Definition:
SkResources.h:150
kSuccess
@ kSuccess
Definition:
embedder.h:73
skgpu::graphite
Definition:
BoundsManagerBench.cpp:27
Context
Definition:
SerialProcsTest.cpp:126
SkIPoint
Definition:
SkPoint_impl.h:28
skgpu::graphite::Task::ReplayTargetData
Definition:
Task.h:26
skgpu::graphite::Task::ReplayTargetData::fTarget
const Texture * fTarget
Definition:
Task.h:27
skgpu::graphite::Task::ReplayTargetData::fTranslation
SkIVector fTranslation
Definition:
Task.h:28
Generated on Sun Jun 23 2024 21:56:28 for Flutter Engine by
1.9.4