Flutter Engine
The Flutter Engine
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
24 id<MTLBuffer> mtlBuffer() const { return fBuffer.get(); }
25
26private:
27 MtlBuffer(const MtlSharedContext*, size_t size, sk_cfp<id<MTLBuffer>>);
28
29 void onMap() override;
30 void onUnmap() override;
31
32 void freeGpuData() override;
33
34 void setBackendLabel(char const* label) override;
35
36 sk_cfp<id<MTLBuffer>> fBuffer;
37};
38
39} // namespace skgpu::graphite
40
41#endif // skgpu_graphite_MtlBuffer_DEFINED
42
GLenum type
size_t size() const
Definition: Buffer.h:19
id< MTLBuffer > mtlBuffer() const
Definition: MtlBuffer.h:24
static sk_sp< Buffer > Make(const MtlSharedContext *, size_t size, BufferType type, AccessPattern)
Definition: MtlBuffer.mm:15