Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
impeller::BlitCopyTextureToTextureCommandMTL Struct Reference

#include <blit_command_mtl.h>

Inheritance diagram for impeller::BlitCopyTextureToTextureCommandMTL:
impeller::BlitCopyTextureToTextureCommand impeller::BlitEncodeMTL impeller::BlitCommand impeller::BackendCast< BlitEncodeMTL, BlitCommand >

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 BlitEncodeMTLCast (BlitCommand &base)
 
static const BlitEncodeMTLCast (const BlitCommand &base)
 
static BlitEncodeMTLCast (BlitCommand *base)
 
static const BlitEncodeMTLCast (const BlitCommand *base)
 
- Public Attributes inherited from impeller::BlitCopyTextureToTextureCommand
std::shared_ptr< Texturesource
 
std::shared_ptr< Texturedestination
 
IRect source_region
 
IPoint destination_origin
 
- Public Attributes inherited from impeller::BlitCommand
std::string label
 

Detailed Description

Definition at line 25 of file blit_command_mtl.h.

Constructor & Destructor Documentation

◆ ~BlitCopyTextureToTextureCommandMTL()

impeller::BlitCopyTextureToTextureCommandMTL::~BlitCopyTextureToTextureCommandMTL ( )
overridedefault

Member Function Documentation

◆ Encode()

bool impeller::BlitCopyTextureToTextureCommandMTL::Encode ( id< MTLBlitCommandEncoder >  encoder) const
overridevirtual

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.GetX(), source_region.GetY(), 0);
35 auto source_size_mtl =
36 MTLSizeMake(source_region.GetWidth(), source_region.GetHeight(), 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};
static TextureMTL & Cast(Texture &base)
id< MTLTexture > GetMTLTexture() const
constexpr Type GetY() const
Returns the Y coordinate of the upper left corner, equivalent to |GetOrigin().y|.
Definition rect.h:304
constexpr Type GetHeight() const
Returns the height of the rectangle, equivalent to |GetSize().height|.
Definition rect.h:314
constexpr Type GetX() const
Returns the X coordinate of the upper left corner, equivalent to |GetOrigin().x|.
Definition rect.h:300
constexpr Type GetWidth() const
Returns the width of the rectangle, equivalent to |GetSize().width|.
Definition rect.h:308

◆ GetLabel()

std::string impeller::BlitCopyTextureToTextureCommandMTL::GetLabel ( ) const
overridevirtual

Implements impeller::BlitEncodeMTL.

Definition at line 17 of file blit_command_mtl.mm.

17 {
18 return label;
19}

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