Flutter Engine
The Flutter Engine
|
A texture source that wraps an instance of AHardwareBuffer. More...
#include <ahb_texture_source_vk.h>
Public Member Functions | |
AHBTextureSourceVK (const std::shared_ptr< Context > &context, struct AHardwareBuffer *hardware_buffer, const AHardwareBuffer_Desc &hardware_buffer_desc) | |
AHBTextureSourceVK (const std::shared_ptr< Context > &context, std::unique_ptr< android::HardwareBuffer > backing_store, bool is_swapchain_image) | |
~AHBTextureSourceVK () override | |
vk::Image | GetImage () const override |
Get the image handle for this texture source. More... | |
vk::ImageView | GetImageView () const override |
Retrieve the image view used for sampling/blitting/compute with this texture source. More... | |
vk::ImageView | GetRenderTargetView () const override |
Retrieve the image view used for render target attachments with this texture source. More... | |
bool | IsValid () const |
bool | IsSwapchainImage () const override |
Determines if swapchain image. That is, an image used as the root render target. More... | |
std::shared_ptr< YUVConversionVK > | GetYUVConversion () const override |
When sampling from textures whose formats are not known to Vulkan, a custom conversion is necessary to setup custom samplers. This accessor provides this conversion if one is present. Most texture source have none. More... | |
const android::HardwareBuffer * | GetBackingStore () const |
Public Member Functions inherited from impeller::TextureSourceVK | |
virtual | ~TextureSourceVK () |
const TextureDescriptor & | GetTextureDescriptor () const |
Gets the texture descriptor for this image source. More... | |
virtual vk::Image | GetImage () const =0 |
Get the image handle for this texture source. More... | |
virtual vk::ImageView | GetImageView () const =0 |
Retrieve the image view used for sampling/blitting/compute with this texture source. More... | |
virtual vk::ImageView | GetRenderTargetView () const =0 |
Retrieve the image view used for render target attachments with this texture source. More... | |
fml::Status | SetLayout (const BarrierVK &barrier) const |
Encodes the layout transition barrier to barrier.cmd_buffer for the image. More... | |
vk::ImageLayout | SetLayoutWithoutEncoding (vk::ImageLayout layout) const |
Store the layout of the image. More... | |
vk::ImageLayout | GetLayout () const |
Get the last layout assigned to the TextureSourceVK. More... | |
virtual std::shared_ptr< YUVConversionVK > | GetYUVConversion () const |
When sampling from textures whose formats are not known to Vulkan, a custom conversion is necessary to setup custom samplers. This accessor provides this conversion if one is present. Most texture source have none. More... | |
virtual bool | IsSwapchainImage () const =0 |
Determines if swapchain image. That is, an image used as the root render target. More... | |
void | SetCachedFramebuffer (const SharedHandleVK< vk::Framebuffer > &framebuffer) |
void | SetCachedRenderPass (const SharedHandleVK< vk::RenderPass > &render_pass) |
SharedHandleVK< vk::Framebuffer > | GetCachedFramebuffer () const |
SharedHandleVK< vk::RenderPass > | GetCachedRenderPass () const |
Additional Inherited Members | |
Protected Member Functions inherited from impeller::TextureSourceVK | |
TextureSourceVK (TextureDescriptor desc) | |
Protected Attributes inherited from impeller::TextureSourceVK | |
const TextureDescriptor | desc_ |
A texture source that wraps an instance of AHardwareBuffer.
The formats and conversions supported by Android Hardware Buffers are a superset of those supported by Impeller (and Vulkan for that matter). Impeller and Vulkan descriptors obtained from the these texture sources are advisory and it usually isn't possible to create copies of images and image views held in these texture sources using the inferred descriptors. The objects are meant to be used directly (either as render targets or sources for sampling), not copied.
Definition at line 32 of file ahb_texture_source_vk.h.
impeller::AHBTextureSourceVK::AHBTextureSourceVK | ( | const std::shared_ptr< Context > & | context, |
struct AHardwareBuffer * | hardware_buffer, | ||
const AHardwareBuffer_Desc & | hardware_buffer_desc | ||
) |
Definition at line 290 of file ahb_texture_source_vk.cc.
impeller::AHBTextureSourceVK::AHBTextureSourceVK | ( | const std::shared_ptr< Context > & | context, |
std::unique_ptr< android::HardwareBuffer > | backing_store, | ||
bool | is_swapchain_image | ||
) |
Definition at line 371 of file ahb_texture_source_vk.cc.
|
overridedefault |
const android::HardwareBuffer * impeller::AHBTextureSourceVK::GetBackingStore | ( | ) | const |
Definition at line 414 of file ahb_texture_source_vk.cc.
|
overridevirtual |
Get the image handle for this texture source.
Implements impeller::TextureSourceVK.
Definition at line 390 of file ahb_texture_source_vk.cc.
|
overridevirtual |
Retrieve the image view used for sampling/blitting/compute with this texture source.
Implements impeller::TextureSourceVK.
Definition at line 395 of file ahb_texture_source_vk.cc.
|
overridevirtual |
Retrieve the image view used for render target attachments with this texture source.
ImageViews used as render target attachments cannot have any mip levels. In cases where we want to generate mipmaps with the result of this texture, we need to create multiple image views.
Implements impeller::TextureSourceVK.
Definition at line 400 of file ahb_texture_source_vk.cc.
|
overridevirtual |
When sampling from textures whose formats are not known to Vulkan, a custom conversion is necessary to setup custom samplers. This accessor provides this conversion if one is present. Most texture source have none.
Reimplemented from impeller::TextureSourceVK.
Definition at line 410 of file ahb_texture_source_vk.cc.
|
overridevirtual |
Determines if swapchain image. That is, an image used as the root render target.
Implements impeller::TextureSourceVK.
Definition at line 405 of file ahb_texture_source_vk.cc.
bool impeller::AHBTextureSourceVK::IsValid | ( | ) | const |
Definition at line 385 of file ahb_texture_source_vk.cc.