Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
mtl
MtlMemoryAllocatorImpl.mm
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
#include "
src/gpu/mtl/MtlMemoryAllocatorImpl.h
"
9
10
namespace
skgpu
{
11
12
sk_sp<MtlMemoryAllocator>
MtlMemoryAllocatorImpl::Make
(id<MTLDevice>
device
) {
13
return
sk_sp<MtlMemoryAllocator>
(
new
MtlMemoryAllocatorImpl
(
device
));
14
}
15
16
id<MTLBuffer>
MtlMemoryAllocatorImpl::newBufferWithLength
(NSUInteger
length
,
17
MTLResourceOptions
options
,
18
sk_sp<MtlAlloc>
* allocation) {
19
// TODO: suballocate and fill in Alloc
20
allocation->
reset
(
new
Alloc
());
21
return
[fDevice
newBufferWithLength
:
length
options
:
options
];
22
}
23
24
id<MTLTexture>
MtlMemoryAllocatorImpl::newTextureWithDescriptor
(MTLTextureDescriptor* texDesc,
25
sk_sp<MtlAlloc>
* allocation) {
26
// TODO: suballocate and fill in Alloc
27
allocation->
reset
(
new
Alloc
());
28
return
[fDevice
newTextureWithDescriptor
:texDesc];
29
}
30
31
}
// namespace skgpu
options
const char * options
Definition
CommonFlagsConfig.cpp:43
MtlMemoryAllocatorImpl.h
sk_sp
Definition
SkRefCnt.h:220
sk_sp::reset
void reset(T *ptr=nullptr)
Definition
SkRefCnt.h:310
skgpu::MtlMemoryAllocatorImpl::Alloc
Definition
MtlMemoryAllocatorImpl.h:29
skgpu::MtlMemoryAllocatorImpl
Definition
MtlMemoryAllocatorImpl.h:18
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