• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #include "include/gpu/graphite/Recording.h"
12 
13 namespace skgpu::graphite {
14 
15 class Context;
16 class Task;
17 class Surface;
18 
19 class RecordingPriv {
20 public:
21     bool hasVolatileLazyProxies() const;
22     bool instantiateVolatileLazyProxies(ResourceProvider*);
23     void deinstantiateVolatileLazyProxies();
24 
25     bool hasNonVolatileLazyProxies() const;
26     bool instantiateNonVolatileLazyProxies(ResourceProvider*);
27 
28 #if GRAPHITE_TEST_UTILS
29     int numVolatilePromiseImages() const;
30     int numNonVolatilePromiseImages() const;
31     bool hasTasks() const;
32 #endif
33 
34     bool addCommands(Context*, CommandBuffer*, Surface* replaySurface, SkIVector replayTranslation);
35     void addResourceRef(sk_sp<Resource> resource);
36     void addTask(sk_sp<Task> task);
37 
38 private:
RecordingPriv(Recording * recorder)39     explicit RecordingPriv(Recording* recorder) : fRecording(recorder) {}
40     RecordingPriv& operator=(const RecordingPriv&) = delete;
41 
42     // No taking addresses of this type.
43     const RecordingPriv* operator&() const = delete;
44     RecordingPriv* operator&() = delete;
45 
46     Recording* fRecording;
47 
48     friend class Recording;  // to construct/copy this type.
49 };
50 
priv()51 inline RecordingPriv Recording::priv() {
52     return RecordingPriv(this);
53 }
54 
55 } // namespace skgpu::graphite
56 
57 #endif // skgpu_graphite_RecordingPriv_DEFINED
58