Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Friends | List of all members
impeller::BlitPassVK Class Referencefinal

#include <blit_pass_vk.h>

Inheritance diagram for impeller::BlitPassVK:
impeller::BlitPass

Public Member Functions

 ~BlitPassVK () override
 
- Public Member Functions inherited from impeller::BlitPass
virtual ~BlitPass ()
 
void SetLabel (std::string label)
 
bool AddCopy (std::shared_ptr< Texture > source, std::shared_ptr< Texture > destination, std::optional< IRect > source_region=std::nullopt, IPoint destination_origin={}, std::string label="")
 Record a command to copy the contents of one texture to another texture. The blit area is limited by the intersection of the texture coverage with respect the source region and destination origin. No work is encoded into the command buffer at this time.
 
bool AddCopy (std::shared_ptr< Texture > source, std::shared_ptr< DeviceBuffer > destination, std::optional< IRect > source_region=std::nullopt, size_t destination_offset=0, std::string label="")
 Record a command to copy the contents of the buffer to the texture. No work is encoded into the command buffer at this time.
 
bool AddCopy (BufferView source, std::shared_ptr< Texture > destination, IPoint destination_origin={}, std::string label="")
 Record a command to copy the contents of the buffer to the texture. No work is encoded into the command buffer at this time.
 
bool GenerateMipmap (std::shared_ptr< Texture > texture, std::string label="")
 Record a command to generate all mip levels for a texture. No work is encoded into the command buffer at this time.
 

Private Member Functions

bool IsValid () const override
 
void OnSetLabel (std::string label) override
 
bool EncodeCommands (const std::shared_ptr< Allocator > &transients_allocator) const override
 Encode the recorded commands to the underlying command buffer.
 
bool OnCopyTextureToTextureCommand (std::shared_ptr< Texture > source, std::shared_ptr< Texture > destination, IRect source_region, IPoint destination_origin, std::string label) override
 
bool OnCopyTextureToBufferCommand (std::shared_ptr< Texture > source, std::shared_ptr< DeviceBuffer > destination, IRect source_region, size_t destination_offset, std::string label) override
 
bool OnCopyBufferToTextureCommand (BufferView source, std::shared_ptr< Texture > destination, IPoint destination_origin, std::string label) override
 
bool OnGenerateMipmapCommand (std::shared_ptr< Texture > texture, std::string label) override
 

Friends

class CommandBufferVK
 

Additional Inherited Members

- Protected Member Functions inherited from impeller::BlitPass
 BlitPass ()
 

Detailed Description

Definition at line 18 of file blit_pass_vk.h.

Constructor & Destructor Documentation

◆ ~BlitPassVK()

impeller::BlitPassVK::~BlitPassVK ( )
overridedefault

Member Function Documentation

◆ EncodeCommands()

bool impeller::BlitPassVK::EncodeCommands ( const std::shared_ptr< Allocator > &  transients_allocator) const
overrideprivatevirtual

Encode the recorded commands to the underlying command buffer.

Parameters
transients_allocatorThe transients allocator.
Returns
If the commands were encoded to the underlying command buffer.

Implements impeller::BlitPass.

Definition at line 31 of file blit_pass_vk.cc.

32 {
33 TRACE_EVENT0("impeller", "BlitPassVK::EncodeCommands");
34
35 if (!IsValid()) {
36 return false;
37 }
38
39 auto command_buffer = command_buffer_.lock();
40 if (!command_buffer) {
41 return false;
42 }
43 auto encoder = command_buffer->GetEncoder();
44 if (!encoder) {
45 return false;
46 }
47
48 for (auto& command : commands_) {
49 if (!command->Encode(*encoder)) {
50 return false;
51 }
52 }
53
54 return true;
55}
bool IsValid() const override
list command
Definition valgrind.py:24
#define TRACE_EVENT0(category_group, name)

◆ IsValid()

bool impeller::BlitPassVK::IsValid ( ) const
overrideprivatevirtual

Implements impeller::BlitPass.

Definition at line 26 of file blit_pass_vk.cc.

26 {
27 return true;
28}

◆ OnCopyBufferToTextureCommand()

bool impeller::BlitPassVK::OnCopyBufferToTextureCommand ( BufferView  source,
std::shared_ptr< Texture destination,
IPoint  destination_origin,
std::string  label 
)
overrideprivatevirtual

Implements impeller::BlitPass.

Definition at line 96 of file blit_pass_vk.cc.

100 {
101 auto command = std::make_unique<BlitCopyBufferToTextureCommandVK>();
102
103 command->source = std::move(source);
104 command->destination = std::move(destination);
105 command->destination_origin = destination_origin;
106 command->label = std::move(label);
107
108 commands_.push_back(std::move(command));
109 return true;
110}
SkBitmap source
Definition examples.cpp:28

◆ OnCopyTextureToBufferCommand()

bool impeller::BlitPassVK::OnCopyTextureToBufferCommand ( std::shared_ptr< Texture source,
std::shared_ptr< DeviceBuffer destination,
IRect  source_region,
size_t  destination_offset,
std::string  label 
)
overrideprivatevirtual

Implements impeller::BlitPass.

Definition at line 77 of file blit_pass_vk.cc.

82 {
83 auto command = std::make_unique<BlitCopyTextureToBufferCommandVK>();
84
85 command->source = std::move(source);
86 command->destination = std::move(destination);
87 command->source_region = source_region;
88 command->destination_offset = destination_offset;
89 command->label = std::move(label);
90
91 commands_.push_back(std::move(command));
92 return true;
93}

◆ OnCopyTextureToTextureCommand()

bool impeller::BlitPassVK::OnCopyTextureToTextureCommand ( std::shared_ptr< Texture source,
std::shared_ptr< Texture destination,
IRect  source_region,
IPoint  destination_origin,
std::string  label 
)
overrideprivatevirtual

Implements impeller::BlitPass.

Definition at line 58 of file blit_pass_vk.cc.

63 {
64 auto command = std::make_unique<BlitCopyTextureToTextureCommandVK>();
65
66 command->source = std::move(source);
67 command->destination = std::move(destination);
68 command->source_region = source_region;
69 command->destination_origin = destination_origin;
70 command->label = std::move(label);
71
72 commands_.push_back(std::move(command));
73 return true;
74}

◆ OnGenerateMipmapCommand()

bool impeller::BlitPassVK::OnGenerateMipmapCommand ( std::shared_ptr< Texture texture,
std::string  label 
)
overrideprivatevirtual

Implements impeller::BlitPass.

Definition at line 113 of file blit_pass_vk.cc.

114 {
115 auto command = std::make_unique<BlitGenerateMipmapCommandVK>();
116
117 command->texture = std::move(texture);
118 command->label = std::move(label);
119
120 commands_.push_back(std::move(command));
121 return true;
122}
FlTexture * texture

◆ OnSetLabel()

void impeller::BlitPassVK::OnSetLabel ( std::string  label)
overrideprivatevirtual

Implements impeller::BlitPass.

Definition at line 18 of file blit_pass_vk.cc.

18 {
19 if (label.empty()) {
20 return;
21 }
22 label_ = std::move(label);
23}

Friends And Related Symbol Documentation

◆ CommandBufferVK

friend class CommandBufferVK
friend

Definition at line 24 of file blit_pass_vk.h.


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