Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
mtl
MtlMemoryAllocatorImpl.h
Go to the documentation of this file.
1
/*
2
* Copyright 2021 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_MtlMemoryAllocatorImpl_DEFINED
9
#define skgpu_MtlMemoryAllocatorImpl_DEFINED
10
11
#include "
include/core/SkRefCnt.h
"
12
#include "
include/gpu/mtl/MtlMemoryAllocator.h
"
13
14
#import <Metal/Metal.h>
15
16
namespace
skgpu
{
17
18
class
MtlMemoryAllocatorImpl
:
public
MtlMemoryAllocator {
19
public
:
20
static
sk_sp<MtlMemoryAllocator>
Make
(id<MTLDevice>);
21
22
~MtlMemoryAllocatorImpl
()
override
{}
23
24
id<MTLBuffer>
newBufferWithLength
(NSUInteger
length
, MTLResourceOptions
options
,
25
sk_sp<skgpu::MtlAlloc>
* allocation)
override
;
26
id<MTLTexture>
newTextureWithDescriptor
(MTLTextureDescriptor* texDesc,
27
sk_sp<skgpu::MtlAlloc>
* allocation)
override
;
28
29
class
Alloc
:
public
MtlAlloc {
30
public
:
31
Alloc
() {}
32
~Alloc
()
override
{
33
// TODO: free allocation
34
}
35
private
:
36
friend
class
MtlMemoryAllocatorImpl
;
37
// TODO: allocation data goes here
38
};
39
40
private
:
41
MtlMemoryAllocatorImpl
(id<MTLDevice>
device
) : fDevice(
device
) {}
42
43
id<MTLDevice> fDevice;
44
};
45
46
}
// namespace skgpu
47
48
#endif
// skgpu_MtlMemoryAllocatorImpl_DEFINED
options
const char * options
Definition
CommonFlagsConfig.cpp:43
MtlMemoryAllocator.h
SkRefCnt.h
sk_sp
Definition
SkRefCnt.h:220
skgpu::MtlMemoryAllocatorImpl::Alloc
Definition
MtlMemoryAllocatorImpl.h:29
skgpu::MtlMemoryAllocatorImpl::Alloc::~Alloc
~Alloc() override
Definition
MtlMemoryAllocatorImpl.h:32
skgpu::MtlMemoryAllocatorImpl::Alloc::Alloc
Alloc()
Definition
MtlMemoryAllocatorImpl.h:31
skgpu::MtlMemoryAllocatorImpl
Definition
MtlMemoryAllocatorImpl.h:18
skgpu::MtlMemoryAllocatorImpl::~MtlMemoryAllocatorImpl
~MtlMemoryAllocatorImpl() override
Definition
MtlMemoryAllocatorImpl.h:22
skgpu::MtlMemoryAllocatorImpl::newTextureWithDescriptor
id< MTLTexture > newTextureWithDescriptor(MTLTextureDescriptor *texDesc, sk_sp< skgpu::MtlAlloc > *allocation) override
Definition
MtlMemoryAllocatorImpl.mm:24
skgpu::MtlMemoryAllocatorImpl::newBufferWithLength
id< MTLBuffer > newBufferWithLength(NSUInteger length, MTLResourceOptions options, sk_sp< skgpu::MtlAlloc > *allocation) override
Definition
MtlMemoryAllocatorImpl.mm:16
skgpu::MtlMemoryAllocatorImpl::Make
static sk_sp< MtlMemoryAllocator > Make(id< MTLDevice >)
Definition
MtlMemoryAllocatorImpl.mm:12
device
VkDevice device
Definition
main.cc:53
length
size_t length
Definition
key_event_handler.cc:41
skgpu
Definition
GpuTools.h:21
Generated on Fri Apr 26 2024 06:17:21 for Flutter Engine by
1.9.8