Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
MtlBuffer.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 Google Inc.
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_MtlBuffer_DEFINED
9#define skgpu_graphite_MtlBuffer_DEFINED
10
14
15#import <Metal/Metal.h>
16
17namespace skgpu::graphite {
18class MtlSharedContext;
19
20class MtlBuffer : public Buffer {
21public:
23 size_t size,
26 std::string_view label);
27
28 id<MTLBuffer> mtlBuffer() const { return fBuffer.get(); }
29
30private:
32 size_t size,
33 sk_cfp<id<MTLBuffer>>,
34 std::string_view label);
35
36 void onMap() override;
37 void onUnmap() override;
38
39 void freeGpuData() override;
40
41 sk_cfp<id<MTLBuffer>> fBuffer;
42};
43
44} // namespace skgpu::graphite
45
46#endif // skgpu_graphite_MtlBuffer_DEFINED
47
size_t size() const
Definition Buffer.h:19
static sk_sp< Buffer > Make(const MtlSharedContext *, size_t size, BufferType type, AccessPattern, std::string_view label)
Definition MtlBuffer.mm:31
id< MTLBuffer > mtlBuffer() const
Definition MtlBuffer.h:28
void onUnmap() override
Definition MtlBuffer.mm:89
void freeGpuData() override
Definition MtlBuffer.mm:100
void onMap() override
Definition MtlBuffer.mm:78