Composition manager. More...
#include <kanzi/core.ui/platform/graphics_backend/gl/composition_manager.hpp>
Public Member Functions | |
| CompositionManager (ResourceManager *resourceManager) | |
| Constructor. More... | |
| virtual | ~CompositionManager () |
| Destructor. More... | |
| void | initialize (Renderer &renderer) |
| Initialize composition manager. More... | |
| virtual TextureSharedPtr | acquireTemporaryCompositionTarget (unsigned int width, unsigned int height, bool alpha, bool depth, bool stencil) |
| Request a frame buffer. More... | |
| TextureSharedPtr | createPersistentCompositionTarget (unsigned int width, unsigned int height, GraphicsFormat colorFormat, GraphicsFormat depthStencilFormat, Sampler::AddressingMode addressingMode) |
| Create a persistent composition target. More... | |
| TextureSharedPtr | createPersistentCompositionTarget (unsigned int width, unsigned int height, GraphicsFormat colorFormat, GraphicsFormat depthStencilFormat) |
| Create a persistent composition target. More... | |
| TextureSharedPtr | createPersistentCompositionTarget (unsigned int width, unsigned int height, bool alpha, bool depth, bool stencil) |
| Create a persistent composition target. More... | |
| virtual void | releaseTemporaryCompositionTarget (TextureSharedPtr framebuffer) |
| Release an earlier framebuffer. More... | |
| ResourceManager * | getResourceManager () const |
| Access resource manager owning this composition manager. More... | |
| GraphicsFormat | getDepthFormat () const |
| Gets depth format. More... | |
| GraphicsFormat | getDepthStencilFormat () const |
| Gets depth + stencil format. More... | |
| GraphicsFormat | getStencilFormat () const |
| Gets stencil format. More... | |
| bool | compositionTargetMatches (const Texture &texture, unsigned int width, unsigned int height, GraphicsFormat colorFormat, GraphicsFormat depthStencilFormat, Sampler::AddressingMode addressingMode, float downScaleLimit) |
| Checks if a given framebuffer is an acceptable match for given requirements. More... | |
| bool | compositionTargetMatches (const Texture &texture, unsigned int width, unsigned int height, GraphicsFormat colorFormat, GraphicsFormat depthStencilFormat) |
| Checks if a given framebuffer is an acceptable match for given requirements. More... | |
| bool | compositionTargetMatches (const Texture &texture, unsigned int width, unsigned int height, bool alpha, bool depth, bool stencil, float downScaleLimit) |
| Checks if a given framebuffer is an acceptable match for given requirements. More... | |
| bool | compositionTargetMatches (const Texture &texture, unsigned int width, unsigned int height, bool alpha, bool depth, bool stencil) |
| Checks if a given framebuffer is an acceptable match for given requirements. More... | |
| void | clear () |
| Remove all allocated temporary composition targets. More... | |
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.
|
explicit |
|
inlinevirtual |
Destructor.
|
virtual |
Request a frame buffer.
| width | Requested width. |
| height | Requested height. |
| alpha | Is alpha channel requested? |
| depth | Is depth buffer requested? |
| stencil | Is stencil buffer requested? |
| TextureSharedPtr kanzi::CompositionManager::createPersistentCompositionTarget | ( | unsigned int | width, |
| unsigned int | height, | ||
| GraphicsFormat | colorFormat, | ||
| GraphicsFormat | depthStencilFormat, | ||
| Sampler::AddressingMode | addressingMode | ||
| ) |
Create a persistent composition target.
Caller has ownership of this composition target, it is not stored within the composition manager.
| width | Requested width. |
| height | Requested height. |
| colorFormat | Color buffer format. |
| depthStencilFormat | Depth/stencil buffer format. |
| addressingMode | Addressing mode (wrap/clamp/etc.). |
|
inline |
Create a persistent composition target.
Caller has ownership of this composition target, it is not stored within the composition manager.
| width | Requested width. |
| height | Requested height. |
| colorFormat | Color buffer format. |
| depthStencilFormat | Depth/stencil buffer format. |
| TextureSharedPtr kanzi::CompositionManager::createPersistentCompositionTarget | ( | unsigned int | width, |
| unsigned int | height, | ||
| bool | alpha, | ||
| bool | depth, | ||
| bool | stencil | ||
| ) |
Create a persistent composition target.
Caller has ownership of this composition target, it is not stored within the composition manager. Determines color, depth and stencil formats from on/off boolean values.
| width | Requested width. |
| height | Requested height. |
| alpha | Alpha channel requirement. |
| depth | Depth buffer requirement. |
| stencil | Stencil buffer requirement. |
|
virtual |
Release an earlier framebuffer.
This, released framebuffer may be re-used by successive requests.
| framebuffer | Framebuffer to release. |
|
inline |
Access resource manager owning this composition manager.
|
inline |
Gets depth format.
|
inline |
Gets depth + stencil format.
|
inline |
Gets stencil format.
| bool kanzi::CompositionManager::compositionTargetMatches | ( | const Texture & | texture, |
| unsigned int | width, | ||
| unsigned int | height, | ||
| GraphicsFormat | colorFormat, | ||
| GraphicsFormat | depthStencilFormat, | ||
| Sampler::AddressingMode | addressingMode, | ||
| float | downScaleLimit | ||
| ) |
Checks if a given framebuffer is an acceptable match for given requirements.
| texture | Composition target to test. |
| width | Requested width. |
| height | Requested height. |
| colorFormat | Color buffer format. |
| depthStencilFormat | Depth/stencil buffer format. |
| downScaleLimit | Limit for matching against smaller composition targets. |
| addressingMode | Addressing mode (wrap/clamp/etc.). |
|
inline |
Checks if a given framebuffer is an acceptable match for given requirements.
Tolerance for how much smaller composition targets are accepted is determined automatically.
| texture | Composition target to test. |
| width | Requested width. |
| height | Requested height. |
| colorFormat | Color buffer format. |
| depthStencilFormat | Depth/stencil buffer format. |
| bool kanzi::CompositionManager::compositionTargetMatches | ( | const Texture & | texture, |
| unsigned int | width, | ||
| unsigned int | height, | ||
| bool | alpha, | ||
| bool | depth, | ||
| bool | stencil, | ||
| float | downScaleLimit | ||
| ) |
Checks if a given framebuffer is an acceptable match for given requirements.
Determines color, depth and stencil formats from on/off boolean values.
| texture | Composition target to test. |
| width | Requested width. |
| height | Requested height. |
| alpha | Alpha channel requirement. |
| depth | Depth buffer requirement. |
| stencil | Stencil buffer requirement. |
| downScaleLimit | Limit for matching against smaller composition targets. |
|
inline |
Checks if a given framebuffer is an acceptable match for given requirements.
Determines color, depth and stencil formats from on/off boolean values. Tolerance for how much smaller composition targets are accepted is determined automatically.
| texture | Composition target to test. |
| width | Requested width. |
| height | Requested height. |
| alpha | Alpha channel requirement. |
| depth | Depth buffer requirement. |
| stencil | Stencil buffer requirement. |
| void kanzi::CompositionManager::clear | ( | ) |
Remove all allocated temporary composition targets.