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

#include <blit_pass_gles.h>

Inheritance diagram for impeller::BlitPassGLES:
impeller::BlitPass

Public Member Functions

 ~BlitPassGLES () 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 CommandBufferGLES
 

Additional Inherited Members

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

Detailed Description

Definition at line 18 of file blit_pass_gles.h.

Constructor & Destructor Documentation

◆ ~BlitPassGLES()

impeller::BlitPassGLES::~BlitPassGLES ( )
overridedefault

Member Function Documentation

◆ EncodeCommands()

bool impeller::BlitPassGLES::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 74 of file blit_pass_gles.cc.

75 {
76 if (!IsValid()) {
77 return false;
78 }
79 if (commands_.empty()) {
80 return true;
81 }
82
83 std::shared_ptr<const BlitPassGLES> shared_this = shared_from_this();
84 return reactor_->AddOperation([transients_allocator,
85 blit_pass = std::move(shared_this),
86 label = label_](const auto& reactor) {
87 auto result = EncodeCommandsInReactor(transients_allocator, reactor,
88 blit_pass->commands_, label);
89 FML_CHECK(result) << "Must be able to encode GL commands without error.";
90 });
91}
bool IsValid() const override
GAsyncResult * result
#define FML_CHECK(condition)
Definition logging.h:85
bool EncodeCommandsInReactor(const std::shared_ptr< Allocator > &transients_allocator, const ReactorGLES &reactor, const std::vector< std::unique_ptr< BlitEncodeGLES > > &commands, const std::string &label)

◆ IsValid()

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

Implements impeller::BlitPass.

Definition at line 25 of file blit_pass_gles.cc.

25 {
26 return is_valid_;
27}

◆ OnCopyBufferToTextureCommand()

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

Implements impeller::BlitPass.

Definition at line 59 of file blit_pass_gles.h.

62 {
64 return false;
65 }
#define IMPELLER_UNIMPLEMENTED
Definition config.h:25

◆ OnCopyTextureToBufferCommand()

bool impeller::BlitPassGLES::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 112 of file blit_pass_gles.cc.

117 {
118 auto command = std::make_unique<BlitCopyTextureToBufferCommandGLES>();
119 command->label = label;
120 command->source = std::move(source);
121 command->destination = std::move(destination);
122 command->source_region = source_region;
123 command->destination_offset = destination_offset;
124
125 commands_.emplace_back(std::move(command));
126 return true;
127}
SkBitmap source
Definition examples.cpp:28
list command
Definition valgrind.py:24

◆ OnCopyTextureToTextureCommand()

bool impeller::BlitPassGLES::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 94 of file blit_pass_gles.cc.

99 {
100 auto command = std::make_unique<BlitCopyTextureToTextureCommandGLES>();
101 command->label = label;
102 command->source = std::move(source);
103 command->destination = std::move(destination);
104 command->source_region = source_region;
105 command->destination_origin = destination_origin;
106
107 commands_.emplace_back(std::move(command));
108 return true;
109}

◆ OnGenerateMipmapCommand()

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

Implements impeller::BlitPass.

Definition at line 130 of file blit_pass_gles.cc.

131 {
132 auto command = std::make_unique<BlitGenerateMipmapCommandGLES>();
133 command->label = label;
134 command->texture = std::move(texture);
135
136 commands_.emplace_back(std::move(command));
137 return true;
138}
FlTexture * texture

◆ OnSetLabel()

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

Implements impeller::BlitPass.

Definition at line 30 of file blit_pass_gles.cc.

30 {
31 label_ = std::move(label);
32}

Friends And Related Symbol Documentation

◆ CommandBufferGLES

friend class CommandBufferGLES
friend

Definition at line 25 of file blit_pass_gles.h.


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