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,
39 std::move(p_render_ready_fence))) {}
57 size_t max_entries = 3u);
97 void Push(std::shared_ptr<AHBTextureSourceVK>
texture,
109 const std::weak_ptr<Context> context_;
111 const size_t max_entries_;
112 bool is_valid_ =
false;
114 std::deque<PoolEntry> pool_ IPLR_GUARDED_BY(pool_mutex_);
Maintains a bounded pool of hardware buffer backed texture sources that can be used as swapchain imag...
AHBTexturePoolVK & operator=(const AHBTexturePoolVK &)=delete
PoolEntry Pop()
Pops an texture source from the pool. If the pool is empty, a new texture source is created and retur...
AHBTexturePoolVK(std::weak_ptr< Context > context, android::HardwareBufferDescriptor desc, size_t max_entries=3u)
Create a new (empty) texture pool.
void PerformGC()
Perform an explicit GC of the pool items. This happens implicitly when a texture source us pushed int...
AHBTexturePoolVK(const AHBTexturePoolVK &)=delete
bool IsValid() const
If the pool can create and pool hardware buffer backed texture sources. The only reason valid texture...
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.
A texture source that wraps an instance of AHardwareBuffer.
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.
#define IPLR_REQUIRES(...)