Flutter Impeller
impeller::RenderTargetAllocator Class Reference

a wrapper around the impeller [Allocator] instance that can be used to provide caching of allocated render target textures. More...

#include <render_target.h>

Inheritance diagram for impeller::RenderTargetAllocator:
impeller::RenderTargetCache impeller::testing::TestRenderTargetAllocator

Public Member Functions

 RenderTargetAllocator (std::shared_ptr< Allocator > allocator)
 
virtual ~RenderTargetAllocator ()=default
 
virtual std::shared_ptr< TextureCreateTexture (const TextureDescriptor &desc)
 Create a new render target texture, or recycle a previously allocated render target texture. More...
 
virtual void Start ()
 Mark the beginning of a frame workload. More...
 
virtual void End ()
 Mark the end of a frame workload. More...
 

Detailed Description

a wrapper around the impeller [Allocator] instance that can be used to provide caching of allocated render target textures.

Definition at line 22 of file render_target.h.

Constructor & Destructor Documentation

◆ RenderTargetAllocator()

impeller::RenderTargetAllocator::RenderTargetAllocator ( std::shared_ptr< Allocator allocator)
explicit

Definition at line 17 of file render_target.cc.

19  : allocator_(std::move(allocator)) {}

◆ ~RenderTargetAllocator()

virtual impeller::RenderTargetAllocator::~RenderTargetAllocator ( )
virtualdefault

Member Function Documentation

◆ CreateTexture()

std::shared_ptr< Texture > impeller::RenderTargetAllocator::CreateTexture ( const TextureDescriptor desc)
virtual

Create a new render target texture, or recycle a previously allocated render target texture.

Reimplemented in impeller::testing::TestRenderTargetAllocator, and impeller::RenderTargetCache.

Definition at line 25 of file render_target.cc.

26  {
27  return allocator_->CreateTexture(desc);
28 }

Referenced by impeller::RenderTarget::CreateOffscreen(), impeller::RenderTarget::CreateOffscreenMSAA(), impeller::RenderTargetCache::CreateTexture(), impeller::testing::TestRenderTargetAllocator::CreateTexture(), and impeller::RenderTarget::SetupStencilAttachment().

◆ End()

void impeller::RenderTargetAllocator::End ( )
virtual

Mark the end of a frame workload.

   This may be used to deallocate any unused textures. 

Reimplemented in impeller::testing::TestRenderTargetAllocator, and impeller::RenderTargetCache.

Definition at line 23 of file render_target.cc.

23 {}

Referenced by impeller::testing::TestRenderTargetAllocator::End().

◆ Start()

void impeller::RenderTargetAllocator::Start ( )
virtual

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 in impeller::testing::TestRenderTargetAllocator, and impeller::RenderTargetCache.

Definition at line 21 of file render_target.cc.

21 {}

Referenced by impeller::testing::TestRenderTargetAllocator::Start().


The documentation for this class was generated from the following files: