Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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.get(); }
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
70 const SkBitmap&,
71 Mipmapped = skgpu::Mipmapped::kNo);
72
73 uint32_t uniqueID() const { return fRecorder->fUniqueID; }
74
75#if defined(SK_DEBUG)
76 uint32_t nextRecordingID() const { return fRecorder->fNextRecordingID; }
77#endif
78
79 size_t getResourceCacheLimit() const;
80
81#if defined(GRAPHITE_TEST_UTILS)
82 bool deviceIsRegistered(Device*) const;
83 ResourceCache* resourceCache() { return fRecorder->fResourceProvider->resourceCache(); }
84 // used by the Context that created this Recorder to set a back pointer
85 void setContext(Context*);
86 Context* context() { return fRecorder->fContext; }
87#endif
88
89private:
90 explicit RecorderPriv(Recorder* recorder) : fRecorder(recorder) {}
91 RecorderPriv& operator=(const RecorderPriv&) = delete;
92
93 // No taking addresses of this type.
94 const RecorderPriv* operator&() const = delete;
95 RecorderPriv* operator&() = delete;
96
97 Recorder* fRecorder;
98
99 friend class Recorder; // to construct/copy this type.
100};
101
103 return RecorderPriv(this);
104}
105
106inline const RecorderPriv Recorder::priv() const { // NOLINT(readability-const-return-type)
107 return RecorderPriv(const_cast<Recorder*>(this));
108}
109
110} // namespace skgpu::graphite
111
112#endif // skgpu_graphite_RecorderPriv_DEFINED
ShaderCodeDictionary * shaderCodeDictionary()
TokenTracker * tokenTracker()
const RuntimeEffectDictionary * runtimeEffectDictionary() const
RuntimeEffectDictionary * runtimeEffectDictionary()
const ShaderCodeDictionary * shaderCodeDictionary() const
TextureDataCache * textureDataCache()
size_t getResourceCacheLimit() const
Definition Recorder.cpp:547
sktext::gpu::TextBlobRedrawCoordinator * textBlobCache()
static sk_sp< TextureProxy > CreateCachedProxy(Recorder *, const SkBitmap &, Mipmapped=skgpu::Mipmapped::kNo)
Definition Recorder.cpp:536
sktext::gpu::StrikeCache * strikeCache()
Protected isProtected() const
AtlasProvider * atlasProvider()
UniformDataCache * uniformDataCache()
const Caps * caps() const
ResourceProvider * resourceProvider()
UploadBufferManager * uploadBufferManager()
const RendererProvider * rendererProvider() const
DrawBufferManager * drawBufferManager()
void add(sk_sp< Task >)
Definition Recorder.cpp:477
friend class RecorderPriv
Definition Recorder.h:207
Mipmapped
Definition GpuTypes.h:53
Protected
Definition GpuTypes.h:61