All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::CompositionManager Class Reference

Composition manager. More...

#include <kanzi/resource/composition_manager.hpp>

Public Member Functions

 CompositionManager (ResourceManager *resourceManager)
 Constructor. More...
 
virtual ~CompositionManager ()
 Destructor. More...
 
virtual FramebufferSharedPtr acquireTemporaryCompositionTarget (unsigned int width, unsigned int height, bool alpha, bool depth, bool stencil)
 Request a frame buffer. More...
 
FramebufferSharedPtr createPersistentCompositionTarget (unsigned int widht, unsigned int height, bool alpha, bool depth, bool stencil)
 Create a framebuffer. More...
 
virtual void releaseTemporaryCompositionTarget (FramebufferSharedPtr framebuffer)
 Release an earlier framebuffer. More...
 
ResourceManagergetResourceManager () const
 Access resource manager owning this composition manager. More...
 
void purge ()
 Purge all allocated temporary composition targets. More...
 

Static Public Member Functions

static bool framebufferMatches (const Framebuffer &framebuffer, unsigned int width, unsigned int height, bool alpha, bool depth, bool stencil, float downScaleLimit=0.25f)
 Check if a given framebuffer is an acceptable match for given requirements. More...
 

Detailed Description

Composition manager.

Used for storing and managing composition targets and keeping track of their use. The rationale is to minimize memory used by composition targets.

Constructor & Destructor Documentation

kanzi::CompositionManager::CompositionManager ( ResourceManager resourceManager)
inlineexplicit

Constructor.

Parameters
resourceManagerResource manager owning this composition manager.
virtual kanzi::CompositionManager::~CompositionManager ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual FramebufferSharedPtr kanzi::CompositionManager::acquireTemporaryCompositionTarget ( unsigned int  width,
unsigned int  height,
bool  alpha,
bool  depth,
bool  stencil 
)
virtual

Request a frame buffer.

Parameters
widthRequested width.
heightRequested height.
alphaIs alpha channel requested?
depthIs depth buffer requested?
stencilIs stencil buffer requested?
Returns
Framebuffer that fulfills the requirements.
FramebufferSharedPtr kanzi::CompositionManager::createPersistentCompositionTarget ( unsigned int  widht,
unsigned int  height,
bool  alpha,
bool  depth,
bool  stencil 
)

Create a framebuffer.

Parameters
widthRequested width.
heightRequested height.
alphaAlpha channel requirement.
depthDepth buffer requirement.
stencilStencil buffer requirement.
Returns
Shared pointer to render target.
virtual void kanzi::CompositionManager::releaseTemporaryCompositionTarget ( FramebufferSharedPtr  framebuffer)
virtual

Release an earlier framebuffer.

This, released framebuffer may be re-used by successive requests.

Parameters
framebufferFramebuffer to release.
ResourceManager* kanzi::CompositionManager::getResourceManager ( ) const
inline

Access resource manager owning this composition manager.

Returns
Resource manager.
static bool kanzi::CompositionManager::framebufferMatches ( const Framebuffer framebuffer,
unsigned int  width,
unsigned int  height,
bool  alpha,
bool  depth,
bool  stencil,
float  downScaleLimit = 0.25f 
)
static

Check if a given framebuffer is an acceptable match for given requirements.

Parameters
framebufferFramebuffer to test.
widthRequested width.
heightRequested height.
alphaAlpha channel requirement.
depthDepth buffer requirement.
stencilStencil buffer requirement.
Returns
True if acceptable, false if not.
void kanzi::CompositionManager::purge ( )

Purge all allocated temporary composition targets.


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