5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_AHB_AHB_TEXTURE_POOL_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_AHB_AHB_TEXTURE_POOL_VK_H_
10 #include "flutter/fml/unique_fd.h"
32 std::shared_ptr<AHBTextureSourceVK>
texture;
35 explicit PoolEntry(std::shared_ptr<AHBTextureSourceVK> p_item,
36 fml::UniqueFD p_render_ready_fence = {})
39 std::move(p_render_ready_fence))) {}
96 void Push(std::shared_ptr<AHBTextureSourceVK> texture,
97 fml::UniqueFD render_ready_fence);
100 const std::weak_ptr<Context> context_;
102 bool is_valid_ =
false;
104 std::deque<PoolEntry> pool_ IPLR_GUARDED_BY(pool_mutex_);
106 std::shared_ptr<AHBTextureSourceVK> CreateTexture()
const;
Maintains a bounded pool of hardware buffer backed texture sources that can be used as swapchain imag...
PoolEntry Pop()
Pops an texture source from the pool. If the pool is empty, a new texture source is created and retur...
AHBTexturePoolVK(const AHBTexturePoolVK &)=delete
bool IsValid() const
If the pool can create and pool hardware buffer backed texture sources. The only reason valid texture...
AHBTexturePoolVK(std::weak_ptr< Context > context, android::HardwareBufferDescriptor desc)
Create a new (empty) texture pool.
void Push(std::shared_ptr< AHBTextureSourceVK > texture, fml::UniqueFD render_ready_fence)
Push a popped texture back into the pool. This also performs a GC.
AHBTexturePoolVK & operator=(const AHBTexturePoolVK &)=delete
std::shared_ptr< AHBTextureSourceVK > texture
std::shared_ptr< fml::UniqueFD > render_ready_fence
PoolEntry(std::shared_ptr< AHBTextureSourceVK > p_item, fml::UniqueFD p_render_ready_fence={})
constexpr bool IsValid() const
A descriptor use to specify hardware buffer allocations.