Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
RecordingPriv.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 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_RecordingPriv_DEFINED
9#define skgpu_graphite_RecordingPriv_DEFINED
10
12
13namespace skgpu::graphite {
14
15class Context;
16class Task;
17class Surface;
18
20public:
21 bool hasVolatileLazyProxies() const;
24
25 bool hasNonVolatileLazyProxies() const;
27
29
30 bool addCommands(Context*, CommandBuffer*, Surface* targetSurface, SkIVector targetTranslation);
31 // This will eventually lead to adding a Usage Ref on the CommandBuffer. For now that is fine
32 // since the only Resource's we are reffing here are Buffers. However, if we ever want to track
33 // Textures or GPU only Buffers as well, we should keep a second list for Refs that we want to
34 // put CommandBuffer refs on.
35 void addResourceRef(sk_sp<Resource> resource);
36 void addTask(sk_sp<Task> task);
37 void addTasks(TaskList&& tasks);
38
39 uint32_t recorderID() const { return fRecording->fRecorderID; }
40 uint32_t uniqueID() const { return fRecording->fUniqueID; }
41
42#if defined(GRAPHITE_TEST_UTILS)
43 bool isTargetProxyInstantiated() const;
44 int numVolatilePromiseImages() const;
45 int numNonVolatilePromiseImages() const;
46 bool hasTasks() const;
47#endif
48
49private:
50 explicit RecordingPriv(Recording* recorder) : fRecording(recorder) {}
51 RecordingPriv& operator=(const RecordingPriv&) = delete;
52
53 // No taking addresses of this type.
54 const RecordingPriv* operator&() const = delete;
55 RecordingPriv* operator&() = delete;
56
57 Recording* fRecording;
58
59 friend class Recording; // to construct/copy this type.
60};
61
63 return RecordingPriv(this);
64}
65
66} // namespace skgpu::graphite
67
68#endif // skgpu_graphite_RecordingPriv_DEFINED
bool instantiateVolatileLazyProxies(ResourceProvider *)
Definition Recording.cpp:94
bool hasNonVolatileLazyProxies() const
Definition Recording.cpp:71
void addTask(sk_sp< Task > task)
bool instantiateNonVolatileLazyProxies(ResourceProvider *)
Definition Recording.cpp:75
bool addCommands(Context *, CommandBuffer *, Surface *targetSurface, SkIVector targetTranslation)
void addResourceRef(sk_sp< Resource > resource)
void addTasks(TaskList &&tasks)
friend class RecordingPriv
Definition Recording.h:41
Definition DM.cpp:1161