| Flutter Impeller |

Public Member Functions | List of all members
impeller::BlitCopyTextureToTextureCommandMTL Struct Reference

`#include <blit_command_mtl.h>`

Inheritance diagram for impeller::BlitCopyTextureToTextureCommandMTL:

## Public Member Functions
| ~BlitCopyTextureToTextureCommandMTL () override
std::string | GetLabel () const override
bool | Encode (id< MTLBlitCommandEncoder > encoder) const override
Public Member Functions inherited from impeller::BlitEncodeMTL
virtual | ~BlitEncodeMTL ()

## Additional Inherited Members
Static Public Member Functions inherited from impeller::BackendCast< BlitEncodeMTL, BlitCommand >
static BlitEncodeMTL & | Cast (BlitCommand &base)
static const BlitEncodeMTL & | Cast (const BlitCommand &base)
static BlitEncodeMTL * | Cast (BlitCommand *base)
static const BlitEncodeMTL * | Cast (const BlitCommand *base)
Public Attributes inherited from impeller::BlitCopyTextureToTextureCommand
std::shared_ptr< Texture > | source
std::shared_ptr< Texture > | destination
IRect | source_region
IPoint | destination_origin
Public Attributes inherited from impeller::BlitCommand
std::string | label

## Detailed Description

Definition at line 24 of file blit_command_mtl.h.

## Constructor & Destructor Documentation

## ◆ ~BlitCopyTextureToTextureCommandMTL()

impeller::BlitCopyTextureToTextureCommandMTL::~BlitCopyTextureToTextureCommandMTL | ( |  | ) |
| override default

## Member Function Documentation

## ◆ Encode()

bool impeller::BlitCopyTextureToTextureCommandMTL::Encode | ( | id< MTLBlitCommandEncoder > | encoder | ) | const
| override virtual

Implements impeller::BlitEncodeMTL.

Definition at line 21 of file blit_command_mtl.mm.

22 {
23 auto source_mtl = TextureMTL::Cast(*source).GetMTLTexture();
24 if (!source_mtl) {
25 return false;
26 }
27
28 auto destination_mtl = TextureMTL::Cast(*destination).GetMTLTexture();
29 if (!destination_mtl) {
30 return false;
31 }
32
33 auto source_origin_mtl =
34 MTLOriginMake(source_region.origin.x, source_region.origin.y, 0);
35 auto source_size_mtl =
36 MTLSizeMake(source_region.size.width, source_region.size.height, 1);
37 auto destination_origin_mtl =
38 MTLOriginMake(destination_origin.x, destination_origin.y, 0);
39
40 [encoder copyFromTexture:source_mtl
41 sourceSlice:0
42 sourceLevel:0
43 sourceOrigin:source_origin_mtl
44 sourceSize:source_size_mtl
45 toTexture:destination_mtl
46 destinationSlice:0
47 destinationLevel:0
48 destinationOrigin:destination_origin_mtl];
49
50 return true;
51 };

References impeller::BackendCast< TextureMTL, Texture >::Cast(), impeller::BlitCopyTextureToTextureCommand::destination_origin, impeller::TextureMTL::GetMTLTexture(), impeller::TSize< T >::height, impeller::TRect< T >::origin, impeller::TRect< T >::size, impeller::BlitCopyTextureToTextureCommand::source_region, impeller::TSize< T >::width, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ GetLabel()

std::string impeller::BlitCopyTextureToTextureCommandMTL::GetLabel | ( |  | ) | const
| override virtual

Implements impeller::BlitEncodeMTL.

Definition at line 17 of file blit_command_mtl.mm.

17 {
18 return label;
19 }

References impeller::BlitCommand::label.

The documentation for this struct was generated from the following files:

- impeller/renderer/backend/metal/blit_command_mtl.h
- impeller/renderer/backend/metal/blit_command_mtl.mm

impeller::TRect::size
TSize< Type > size
Definition: rect.h:24
impeller::TPoint::y
Type y
Definition: point.h:24
impeller::TextureMTL::GetMTLTexture
id< MTLTexture > GetMTLTexture() const
Definition: texture_mtl.mm:100
impeller::BlitCopyTextureToTextureCommand::destination_origin
IPoint destination_origin
Definition: blit_command.h:21
impeller::BlitCommand::label
std::string label
Definition: blit_command.h:14
impeller::TRect::origin
TPoint< Type > origin
Definition: rect.h:23
impeller::TSize::width
Type width
Definition: size.h:21
impeller::TPoint::x
Type x
Definition: point.h:23
impeller::BackendCast< TextureMTL, Texture >::Cast
static TextureMTL & Cast(Texture &base)
Definition: backend_cast.h:14
impeller::BlitCopyTextureToTextureCommand::source_region
IRect source_region
Definition: blit_command.h:20
impeller::TSize::height
Type height
Definition: size.h:22