Flutter Engine
The Flutter Engine
UploadBufferManager.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_UploadBufferManager_DEFINED
9#define skgpu_graphite_UploadBufferManager_DEFINED
10
14
15#include <string_view>
16#include <tuple>
17#include <vector>
18
19namespace skgpu::graphite {
20
21class Buffer;
22class Caps;
23class CommandBuffer;
24class Recording;
26
28public:
31
32 std::tuple<TextureUploadWriter, BindBufferInfo> getTextureUploadWriter(
33 size_t requiredBytes, size_t requiredAlignment);
34
35 // Finalizes all buffers and transfers ownership of them to a Recording.
38
39private:
40 friend class DrawBufferManager; // to access makeBindInfo
41 friend class StaticBufferManager; // to access makeBindInfo
42
43
44 std::tuple<void*/*mappedPtr*/, BindBufferInfo> makeBindInfo(size_t requiredBytes,
45 size_t requiredAlignment,
46 std::string_view label);
47
48 ResourceProvider* fResourceProvider;
49
50 sk_sp<Buffer> fReusedBuffer;
51 size_t fMinAlignment;
52 size_t fReusedBufferOffset = 0;
53
54 std::vector<sk_sp<Buffer>> fUsedBuffers;
55};
56
57} // namespace skgpu::graphite
58
59#endif // skgpu_graphite_UploadBufferManager_DEFINED
std::tuple< TextureUploadWriter, BindBufferInfo > getTextureUploadWriter(size_t requiredBytes, size_t requiredAlignment)
UploadBufferManager(ResourceProvider *, const Caps *)