Flutter Engine
The Flutter Engine
|
An implementation of the [RenderTargetAllocator] that caches all allocated texture data for one frame. More...
#include <render_target_cache.h>
Public Member Functions | |
RenderTargetCache (std::shared_ptr< Allocator > allocator) | |
~RenderTargetCache ()=default | |
void | Start () override |
Mark the beginning of a frame workload. More... | |
void | End () override |
Mark the end of a frame workload. More... | |
RenderTarget | CreateOffscreen (const Context &context, ISize size, int mip_count, const std::string &label="Offscreen", RenderTarget::AttachmentConfig color_attachment_config=RenderTarget::kDefaultColorAttachmentConfig, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr) override |
RenderTarget | CreateOffscreenMSAA (const Context &context, ISize size, int mip_count, const std::string &label="Offscreen MSAA", RenderTarget::AttachmentConfigMSAA color_attachment_config=RenderTarget::kDefaultColorAttachmentConfigMSAA, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_msaa_texture=nullptr, const std::shared_ptr< Texture > &existing_color_resolve_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr) override |
size_t | CachedTextureCount () const |
std::vector< RenderTargetData >::const_iterator | GetRenderTargetDataBegin () const |
Visible for testing. More... | |
std::vector< RenderTargetData >::const_iterator | GetRenderTargetDataEnd () const |
Visible for testing. More... | |
Public Member Functions inherited from impeller::RenderTargetAllocator | |
RenderTargetAllocator (std::shared_ptr< Allocator > allocator) | |
virtual | ~RenderTargetAllocator ()=default |
virtual RenderTarget | CreateOffscreen (const Context &context, ISize size, int mip_count, const std::string &label="Offscreen", RenderTarget::AttachmentConfig color_attachment_config=RenderTarget::kDefaultColorAttachmentConfig, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr) |
virtual RenderTarget | CreateOffscreenMSAA (const Context &context, ISize size, int mip_count, const std::string &label="Offscreen MSAA", RenderTarget::AttachmentConfigMSAA color_attachment_config=RenderTarget::kDefaultColorAttachmentConfigMSAA, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_msaa_texture=nullptr, const std::shared_ptr< Texture > &existing_color_resolve_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr) |
virtual void | Start () |
Mark the beginning of a frame workload. More... | |
virtual void | End () |
Mark the end of a frame workload. More... | |
An implementation of the [RenderTargetAllocator] that caches all allocated texture data for one frame.
Any textures unused after a frame are immediately discarded.
Definition at line 16 of file render_target_cache.h.
|
explicit |
Definition at line 10 of file render_target_cache.cc.
|
default |
size_t impeller::RenderTargetCache::CachedTextureCount | ( | ) | const |
Definition at line 129 of file render_target_cache.cc.
|
overridevirtual |
Reimplemented from impeller::RenderTargetAllocator.
Definition at line 30 of file render_target_cache.cc.
|
overridevirtual |
Reimplemented from impeller::RenderTargetAllocator.
Definition at line 78 of file render_target_cache.cc.
|
overridevirtual |
Mark the end of a frame workload.
This may be used to deallocate any unused textures.
Reimplemented from impeller::RenderTargetAllocator.
Definition at line 19 of file render_target_cache.cc.
|
inline |
Visible for testing.
Definition at line 73 of file render_target_cache.h.
|
inline |
Visible for testing.
Definition at line 79 of file render_target_cache.h.
|
overridevirtual |
Mark the beginning of a frame workload.
This may be used to reset any tracking state on whether or not a particular texture instance is still in use.
Reimplemented from impeller::RenderTargetAllocator.
Definition at line 13 of file render_target_cache.cc.