5 #ifndef FLUTTER_IMPELLER_RENDERER_BLIT_PASS_H_
6 #define FLUTTER_IMPELLER_RENDERER_BLIT_PASS_H_
33 void SetLabel(std::string_view label);
41 const std::shared_ptr<Texture>& texture);
49 const std::shared_ptr<Texture>& destination) = 0;
70 bool AddCopy(std::shared_ptr<Texture> source,
71 std::shared_ptr<Texture> destination,
72 std::optional<IRect> source_region = std::nullopt,
73 IPoint destination_origin = {},
74 std::string_view label =
"");
93 bool AddCopy(std::shared_ptr<Texture> source,
94 std::shared_ptr<DeviceBuffer> destination,
95 std::optional<IRect> source_region = std::nullopt,
96 size_t destination_offset = 0,
97 std::string_view label =
"");
128 std::shared_ptr<Texture> destination,
129 std::optional<IRect> destination_region = std::nullopt,
130 std::string_view label =
"",
131 uint32_t mip_level = 0,
133 bool convert_to_read =
true);
144 std::string_view label =
"");
160 std::shared_ptr<Texture> source,
161 std::shared_ptr<Texture> destination,
163 IPoint destination_origin,
164 std::string_view label) = 0;
167 std::shared_ptr<Texture> source,
168 std::shared_ptr<DeviceBuffer> destination,
170 size_t destination_offset,
171 std::string_view label) = 0;
175 std::shared_ptr<Texture> destination,
176 IRect destination_region,
177 std::string_view label,
180 bool convert_to_read) = 0;
183 std::string_view label) = 0;
Blit passes encode blit into the underlying command buffer.
void SetLabel(std::string_view label)
virtual bool EncodeCommands() const =0
Encode the recorded commands to the underlying command buffer.
bool AddCopy(std::shared_ptr< Texture > source, std::shared_ptr< Texture > destination, std::optional< IRect > source_region=std::nullopt, IPoint destination_origin={}, std::string_view label="")
Record a command to copy the contents of one texture to another texture. The blit area is limited by ...
virtual bool ResizeTexture(const std::shared_ptr< Texture > &source, const std::shared_ptr< Texture > &destination)=0
Resize the [source] texture into the [destination] texture.
virtual bool OnCopyTextureToTextureCommand(std::shared_ptr< Texture > source, std::shared_ptr< Texture > destination, IRect source_region, IPoint destination_origin, std::string_view label)=0
bool GenerateMipmap(std::shared_ptr< Texture > texture, std::string_view label="")
Record a command to generate all mip levels for a texture.
virtual bool OnGenerateMipmapCommand(std::shared_ptr< Texture > texture, std::string_view label)=0
virtual bool ConvertTextureToShaderRead(const std::shared_ptr< Texture > &texture)
If the texture is not already in a shader read internal state, then convert it to that state.
virtual bool IsValid() const =0
virtual bool OnCopyBufferToTextureCommand(BufferView source, std::shared_ptr< Texture > destination, IRect destination_region, std::string_view label, uint32_t mip_level, uint32_t slice, bool convert_to_read)=0
virtual bool OnCopyTextureToBufferCommand(std::shared_ptr< Texture > source, std::shared_ptr< DeviceBuffer > destination, IRect source_region, size_t destination_offset, std::string_view label)=0
virtual void OnSetLabel(std::string_view label)=0