Flutter Engine
The Flutter Engine
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
13
14namespace skgpu::graphite {
15
16class CommandBuffer;
17class Context;
19class RuntimeEffectDictionary;
20class ScratchResourceManager;
21class Texture;
22
23class Task : public SkRefCnt {
24public:
25 // Holds a render target and translation to use in the task's work, if necessary.
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.
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.
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.
52 const RuntimeEffectDictionary*) = 0;
53
54 // Returns true on success; false on failure.
56};
57
58} // namespace skgpu::graphite
59
60#endif // skgpu_graphite_task_Task_DEFINED
virtual Status addCommands(Context *, CommandBuffer *, ReplayTargetData)=0
virtual Status prepareResources(ResourceProvider *, ScratchResourceManager *, const RuntimeEffectDictionary *)=0
@ kSuccess
Definition: embedder.h:73