Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
RecorderPriv.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_RecorderPriv_DEFINED
9#define skgpu_graphite_RecorderPriv_DEFINED
10
11#include <functional>
12
17
18class SkBitmap;
19class SkImage;
20
21namespace skgpu::graphite {
22
23class ShaderCodeDictionary;
24class TextureProxy;
25
27public:
28 void add(sk_sp<Task>);
30
31 const Caps* caps() const { return fRecorder->fSharedContext->caps(); }
32
33 ResourceProvider* resourceProvider() { return fRecorder->fResourceProvider; }
34
36 return fRecorder->fRuntimeEffectDict.get();
37 }
39 return fRecorder->fRuntimeEffectDict.get();
40 }
42 return fRecorder->fSharedContext->shaderCodeDictionary();
43 }
45 return fRecorder->fSharedContext->shaderCodeDictionary();
46 }
47
49 return fRecorder->fSharedContext->rendererProvider();
50 }
51
53 return fRecorder->fSharedContext->isProtected();
54 }
55
56 UniformDataCache* uniformDataCache() { return fRecorder->fUniformDataCache.get(); }
57 TextureDataCache* textureDataCache() { return fRecorder->fTextureDataCache.get(); }
58 DrawBufferManager* drawBufferManager() { return fRecorder->fDrawBufferManager.get(); }
59 UploadBufferManager* uploadBufferManager() { return fRecorder->fUploadBufferManager.get(); }
60
61 AtlasProvider* atlasProvider() { return fRecorder->fAtlasProvider.get(); }
62 TokenTracker* tokenTracker() { return fRecorder->fTokenTracker.get(); }
63 sktext::gpu::StrikeCache* strikeCache() { return fRecorder->fStrikeCache.get(); }
65 return fRecorder->fTextBlobCache.get();
66 }
68
69 // NOTE: Temporary access for DrawTask to manipulate pending read counts.
70 void addPendingRead(const TextureProxy*);
71
73 const SkBitmap&,
74 std::string_view label);
75
76 uint32_t uniqueID() const { return fRecorder->fUniqueID; }
77
78#if defined(SK_DEBUG)
79 uint32_t nextRecordingID() const { return fRecorder->fNextRecordingID; }
80#endif
81
82 size_t getResourceCacheLimit() const;
83
84#if defined(GRAPHITE_TEST_UTILS)
85 bool deviceIsRegistered(Device*) const;
86 ResourceCache* resourceCache() { return fRecorder->fResourceProvider->resourceCache(); }
87 SharedContext* sharedContext() { return fRecorder->fSharedContext.get(); }
88 // used by the Context that created this Recorder to set a back pointer
89 void setContext(Context*);
90 Context* context() { return fRecorder->fContext; }
91#endif
92
93private:
94 explicit RecorderPriv(Recorder* recorder) : fRecorder(recorder) {}
95 RecorderPriv& operator=(const RecorderPriv&) = delete;
96
97 // No taking addresses of this type.
98 const RecorderPriv* operator&() const = delete;
99 RecorderPriv* operator&() = delete;
100
101 Recorder* fRecorder;
102
103 friend class Recorder; // to construct/copy this type.
104};
105
107 return RecorderPriv(this);
108}
109
110inline const RecorderPriv Recorder::priv() const { // NOLINT(readability-const-return-type)
111 return RecorderPriv(const_cast<Recorder*>(this));
112}
113
114} // namespace skgpu::graphite
115
116#endif // skgpu_graphite_RecorderPriv_DEFINED
ShaderCodeDictionary * shaderCodeDictionary()
Definition: RecorderPriv.h:44
void addPendingRead(const TextureProxy *)
Definition: Recorder.cpp:480
TokenTracker * tokenTracker()
Definition: RecorderPriv.h:62
const RuntimeEffectDictionary * runtimeEffectDictionary() const
Definition: RecorderPriv.h:35
RuntimeEffectDictionary * runtimeEffectDictionary()
Definition: RecorderPriv.h:38
const ShaderCodeDictionary * shaderCodeDictionary() const
Definition: RecorderPriv.h:41
TextureDataCache * textureDataCache()
Definition: RecorderPriv.h:57
size_t getResourceCacheLimit() const
Definition: Recorder.cpp:557
sktext::gpu::TextBlobRedrawCoordinator * textBlobCache()
Definition: RecorderPriv.h:64
sktext::gpu::StrikeCache * strikeCache()
Definition: RecorderPriv.h:63
Protected isProtected() const
Definition: RecorderPriv.h:52
AtlasProvider * atlasProvider()
Definition: RecorderPriv.h:61
UniformDataCache * uniformDataCache()
Definition: RecorderPriv.h:56
const Caps * caps() const
Definition: RecorderPriv.h:31
ResourceProvider * resourceProvider()
Definition: RecorderPriv.h:33
static sk_sp< TextureProxy > CreateCachedProxy(Recorder *, const SkBitmap &, std::string_view label)
Definition: Recorder.cpp:544
UploadBufferManager * uploadBufferManager()
Definition: RecorderPriv.h:59
const RendererProvider * rendererProvider() const
Definition: RecorderPriv.h:48
DrawBufferManager * drawBufferManager()
Definition: RecorderPriv.h:58
void add(sk_sp< Task >)
Definition: Recorder.cpp:485
friend class RecorderPriv
Definition: Recorder.h:208
Protected
Definition: GpuTypes.h:61