FastUIDraw
Classes | Public Member Functions | Protected Member Functions | List of all members
fastuidraw::PainterEngine Class Referenceabstract

A PainterEngine provides an interface to create Painter Backend derived objects. More...

#include <painter_engine.hpp>

Inheritance diagram for fastuidraw::PainterEngine:
Inheritance graph
[legend]

Classes

class  ConfigurationBase
 A ConfigurationBase holds properties common to all Painter Backend objects returned by PainterEngine::create_backend() from a fixed PainterEngine. More...
 
class  PerformanceHints
 PerformanceHints provides miscellaneous data about Painter Backend objects returned by PainterEngine::create_backend() from a fixed PainterEngine. More...
 

Public Member Functions

ColorStopAtlascolorstop_atlas (void) const
 
const ConfigurationBaseconfiguration_base (void) const
 
virtual reference_counted_ptr< PainterBackendcreate_backend (void) const =0
 
virtual reference_counted_ptr< PainterSurfacecreate_surface (ivec2 dims, enum PainterSurface::render_type_t render_type)=0
 
const PainterShaderSetdefault_shaders (void) const
 
GlyphAtlasglyph_atlas (void) const
 
GlyphCacheglyph_cache (void) const
 
const PerformanceHintshints (void) const
 
ImageAtlasimage_atlas (void) const
 
PainterShaderRegistrarpainter_shader_registrar (void) const
 
template<typename T >
void register_shader (const T &v)
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Protected Member Functions

 PainterEngine (reference_counted_ptr< GlyphAtlas > glyph_atlas, reference_counted_ptr< ImageAtlas > image_atlas, reference_counted_ptr< ColorStopAtlas > colorstop_atlas, reference_counted_ptr< PainterShaderRegistrar > shader_registrar, const ConfigurationBase &config, const PainterShaderSet &pdefault_shaders)
 
PerformanceHintsset_hints (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
static void add_reference (const reference_counted_base< T, Counter > *p)
 
static void remove_reference (const reference_counted_base< T, Counter > *p)
 

Detailed Description

A PainterEngine provides an interface to create Painter Backend derived objects.

Definition at line 42 of file painter_engine.hpp.

Constructor & Destructor Documentation

◆ PainterEngine()

fastuidraw::PainterEngine::PainterEngine ( reference_counted_ptr< GlyphAtlas glyph_atlas,
reference_counted_ptr< ImageAtlas image_atlas,
reference_counted_ptr< ColorStopAtlas colorstop_atlas,
reference_counted_ptr< PainterShaderRegistrar shader_registrar,
const ConfigurationBase config,
const PainterShaderSet pdefault_shaders 
)
protected

Ctor.

Parameters
glyph_atlasGlyphAtlas for glyphs drawn by each Painter Backend returned by create_backend() of the created PainterEngine
image_atlasImageAtlas for images drawn by each Painter Backend returned by create_backend() of the created PainterEngine
colorstop_atlasColorStopAtlas for color stop sequences drawn by each Painter Backend returned by create_backend() of the created PainterEngine
shader_registrarPainterShaderRegistrar used by each Painter Backend returned by create_backend() of the created PainterEngine
configConfigurationBase for each Painter Backend returned by create_backend() of the created PainterEngine
pdefault_shadersdefault shaders for each Painter Backend returned by create_backend() of the created PainterEngine; shaders are registered at construction of the created PainterEngine

Member Function Documentation

◆ colorstop_atlas()

ColorStopAtlas& fastuidraw::PainterEngine::colorstop_atlas ( void  ) const

Returns a reference to the ColorStopAtlas of this PainterEngine. All color stops used by all brushes of each Painter Backend made from this PainterEngine must live on colorstop_atlas().

◆ configuration_base()

const ConfigurationBase& fastuidraw::PainterEngine::configuration_base ( void  ) const

Returns the ConfigurationBase passed in the ctor.

◆ create_backend()

virtual reference_counted_ptr<PainterBackend> fastuidraw::PainterEngine::create_backend ( void  ) const
pure virtual

To be implemented by a derived class to create a Painter Backend object. All Painter Backend objects created by create_backend() from the same PainterEngine share the same

Implemented in fastuidraw::gl::PainterEngineGL.

◆ create_surface()

virtual reference_counted_ptr<PainterSurface> fastuidraw::PainterEngine::create_surface ( ivec2  dims,
enum PainterSurface::render_type_t  render_type 
)
pure virtual

To be implemented by a derived class to create a Surface with its own backing that is useable by any Painter Backend object that this PainterEngine returns in create_backend()

Parameters
dimsthe dimensions of the backing store of the returned Surface
render_typethe render type of the surface (i.e. is it a color buffer or deferred coverage buffer).

Implemented in fastuidraw::gl::PainterEngineGL.

◆ default_shaders()

const PainterShaderSet& fastuidraw::PainterEngine::default_shaders ( void  ) const

Returns the PainterShaderSet for the backend. Returned values will already be registered to the PainterShaderRegistrar returned by painter_shader_registrar().

◆ glyph_atlas()

GlyphAtlas& fastuidraw::PainterEngine::glyph_atlas ( void  ) const

Returns a reference to the GlyphAtlas of this PainterEngine. All glyphs used by each Painter made from this PainterEngine must live on glyph_atlas().

◆ glyph_cache()

GlyphCache& fastuidraw::PainterEngine::glyph_cache ( void  ) const

Returns a handle to the GlyphCache made from glyph_atlas().

◆ hints()

const PerformanceHints& fastuidraw::PainterEngine::hints ( void  ) const

Returns the PerformanceHints for the PainterBackend, may only be called after on_begin() has been called atleast once. The value returned is expected to stay constant once on_begin() has been called.

◆ image_atlas()

ImageAtlas& fastuidraw::PainterEngine::image_atlas ( void  ) const

Returns a reference to the ImageAtlas of this PainterEngine. All images used by each Painter Backend made from this PainterEngine must live on image_atlas().

◆ painter_shader_registrar()

PainterShaderRegistrar& fastuidraw::PainterEngine::painter_shader_registrar ( void  ) const

Returns the PainterShaderRegistrar of this PainterEngine. Use this return value to add custom shaders. NOTE: shaders added within a thread are not useable by a Painter Backend made from this PainterEngine within that thread until the next call to its PainterBackend::begin().

◆ register_shader()

template<typename T >
void fastuidraw::PainterEngine::register_shader ( const T &  v)
inline

Provided as a conveniance, equivalent to

Parameters
vshade value to register to painter_shader_registrar()

Definition at line 255 of file painter_engine.hpp.

◆ set_hints()

PerformanceHints& fastuidraw::PainterEngine::set_hints ( void  )
protected

To be accessed by a derived class in its ctor to set the performance hint values for itself.


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