Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
impeller
renderer
backend
metal
device_buffer_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_DEVICE_BUFFER_MTL_H_
6
#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_DEVICE_BUFFER_MTL_H_
7
8
#include <Metal/Metal.h>
9
10
#include "flutter/fml/macros.h"
11
#include "
impeller/base/backend_cast.h
"
12
#include "
impeller/core/device_buffer.h
"
13
14
namespace
impeller
{
15
16
class
DeviceBufferMTL
final
17
:
public
DeviceBuffer
,
18
public
BackendCast
<DeviceBufferMTL, DeviceBuffer> {
19
public
:
20
DeviceBufferMTL
();
21
22
// |DeviceBuffer|
23
~DeviceBufferMTL
()
override
;
24
25
id<MTLBuffer>
GetMTLBuffer
()
const
;
26
27
private
:
28
friend
class
AllocatorMTL
;
29
30
const
id<MTLBuffer> buffer_;
31
const
MTLStorageMode storage_mode_;
32
33
DeviceBufferMTL
(
DeviceBufferDescriptor
desc,
34
id<MTLBuffer>
buffer
,
35
MTLStorageMode storage_mode);
36
37
// |DeviceBuffer|
38
uint8_t*
OnGetContents
()
const override
;
39
40
// |DeviceBuffer|
41
std::shared_ptr<Texture>
AsTexture
(
Allocator
& allocator,
42
const
TextureDescriptor
& descriptor,
43
uint16_t row_bytes)
const override
;
44
45
// |DeviceBuffer|
46
bool
OnCopyHostBuffer
(
const
uint8_t*
source
,
47
Range
source_range,
48
size_t
offset
)
override
;
49
50
// |DeviceBuffer|
51
bool
SetLabel
(
const
std::string& label)
override
;
52
53
// |DeviceBuffer|
54
bool
SetLabel
(
const
std::string& label,
Range
range)
override
;
55
56
// |DeviceBuffer|
57
void
Flush
(std::optional<Range> range)
const override
;
58
59
DeviceBufferMTL
(
const
DeviceBufferMTL
&) =
delete
;
60
61
DeviceBufferMTL
& operator=(
const
DeviceBufferMTL
&) =
delete
;
62
};
63
64
}
// namespace impeller
65
66
#endif
// FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_DEVICE_BUFFER_MTL_H_
backend_cast.h
impeller::AllocatorMTL
Definition
allocator_mtl.h:15
impeller::Allocator
An object that allocates device memory.
Definition
allocator.h:22
impeller::BackendCast
Definition
backend_cast.h:11
impeller::DeviceBufferMTL
Definition
device_buffer_mtl.h:18
impeller::DeviceBufferMTL::DeviceBufferMTL
DeviceBufferMTL()
impeller::DeviceBufferMTL::~DeviceBufferMTL
~DeviceBufferMTL() override
impeller::DeviceBufferMTL::OnGetContents
uint8_t * OnGetContents() const override
Definition
device_buffer_mtl.mm:25
impeller::DeviceBufferMTL::SetLabel
bool SetLabel(const std::string &label) override
Definition
device_buffer_mtl.mm:91
impeller::DeviceBufferMTL::GetMTLBuffer
id< MTLBuffer > GetMTLBuffer() const
Definition
device_buffer_mtl.mm:21
impeller::DeviceBufferMTL::Flush
void Flush(std::optional< Range > range) const override
Definition
device_buffer_mtl.mm:81
impeller::DeviceBufferMTL::OnCopyHostBuffer
bool OnCopyHostBuffer(const uint8_t *source, Range source_range, size_t offset) override
Definition
device_buffer_mtl.mm:56
impeller::DeviceBufferMTL::AsTexture
std::shared_ptr< Texture > AsTexture(Allocator &allocator, const TextureDescriptor &descriptor, uint16_t row_bytes) const override
Definition
device_buffer_mtl.mm:32
impeller::DeviceBuffer
Definition
device_buffer.h:19
source
SkBitmap source
Definition
examples.cpp:28
buffer
static const uint8_t buffer[]
Definition
fl_pixel_buffer_texture_test.cc:44
device_buffer.h
impeller
Definition
texture.h:18
offset
Point offset
Definition
stroke_path_geometry.cc:256
impeller::DeviceBufferDescriptor
Definition
device_buffer_descriptor.h:14
impeller::Range
Definition
range.h:14
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