Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
impeller
renderer
backend
metal
allocator_mtl.h
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_ALLOCATOR_MTL_H_
6
#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_ALLOCATOR_MTL_H_
7
8
#include <Metal/Metal.h>
9
10
#include "flutter/fml/macros.h"
11
#include "
impeller/core/allocator.h
"
12
13
namespace
impeller
{
14
15
class
AllocatorMTL
final :
public
Allocator
{
16
public
:
17
AllocatorMTL
();
18
19
// |Allocator|
20
~AllocatorMTL
()
override
;
21
22
private
:
23
friend
class
ContextMTL
;
24
25
id<MTLDevice> device_;
26
std::string allocator_label_;
27
bool
supports_memoryless_targets_ =
false
;
28
bool
supports_uma_ =
false
;
29
bool
is_valid_ =
false
;
30
ISize
max_texture_supported_;
31
32
AllocatorMTL
(id<MTLDevice>
device
, std::string label);
33
34
// |Allocator|
35
bool
IsValid()
const
;
36
37
// |Allocator|
38
std::shared_ptr<DeviceBuffer>
OnCreateBuffer
(
39
const
DeviceBufferDescriptor
& desc)
override
;
40
41
// |Allocator|
42
std::shared_ptr<Texture>
OnCreateTexture
(
43
const
TextureDescriptor
& desc)
override
;
44
45
// |Allocator|
46
uint16_t
MinimumBytesPerRow
(
PixelFormat
format
)
const override
;
47
48
// |Allocator|
49
ISize
GetMaxTextureSizeSupported
()
const override
;
50
51
AllocatorMTL
(
const
AllocatorMTL
&) =
delete
;
52
53
AllocatorMTL
& operator=(
const
AllocatorMTL
&) =
delete
;
54
};
55
56
}
// namespace impeller
57
58
#endif
// FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_ALLOCATOR_MTL_H_
allocator.h
impeller::AllocatorMTL
Definition
allocator_mtl.h:15
impeller::AllocatorMTL::OnCreateTexture
std::shared_ptr< Texture > OnCreateTexture(const TextureDescriptor &desc) override
Definition
allocator_mtl.mm:192
impeller::AllocatorMTL::OnCreateBuffer
std::shared_ptr< DeviceBuffer > OnCreateBuffer(const DeviceBufferDescriptor &desc) override
Definition
allocator_mtl.mm:174
impeller::AllocatorMTL::AllocatorMTL
AllocatorMTL()
impeller::AllocatorMTL::~AllocatorMTL
~AllocatorMTL() override
impeller::AllocatorMTL::GetMaxTextureSizeSupported
ISize GetMaxTextureSizeSupported() const override
Definition
allocator_mtl.mm:227
impeller::AllocatorMTL::MinimumBytesPerRow
uint16_t MinimumBytesPerRow(PixelFormat format) const override
Minimum value for row_bytes on a Texture. The row bytes parameter of that method must be aligned to t...
Definition
allocator_mtl.mm:222
impeller::Allocator
An object that allocates device memory.
Definition
allocator.h:22
impeller::ContextMTL
Definition
context_mtl.h:37
device
VkDevice device
Definition
main.cc:53
format
uint32_t uint32_t * format
Definition
fl_texture_registrar_test.cc:41
impeller
Definition
texture.h:18
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition
formats.h:100
impeller::DeviceBufferDescriptor
Definition
device_buffer_descriptor.h:14
impeller::TSize< int64_t >
impeller::TextureDescriptor
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
Definition
texture_descriptor.h:37
Generated on Fri Apr 26 2024 06:14:12 for Flutter Engine by
1.9.8