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

A PainterShaderRegistrar is an interface that defines the assigning of PainterShader::ID() to a PainterShader. PainterShader objects are registered to a unique PainterShaderRegistrar for their lifetime. More...

#include <painter_shader_registrar.hpp>

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

Public Member Functions

 PainterShaderRegistrar (void)
 
void register_shader (PainterItemShader *shader)
 
void register_shader (PainterItemCoverageShader *shader)
 
void register_shader (PainterBlendShader *shader)
 
void register_shader (PainterBrushShader *shader)
 
void register_shader (const PainterImageBrushShader *shader)
 
void register_shader (const PainterGradientBrushShader *shader)
 
template<typename T >
void register_shader (const reference_counted_ptr< T > &shader)
 
void register_shader (const PainterStrokeShader &p)
 
void register_shader (const PainterFillShader &p)
 
void register_shader (const PainterDashedStrokeShaderSet &p)
 
void register_shader (const PainterGlyphShader &p)
 
void register_shader (const PainterBlendShaderSet &p)
 
void register_shader (const PainterBrushShaderSet &p)
 
void register_shader (const PainterShaderSet &p)
 
unsigned int unique_id (void) const
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Protected Member Functions

virtual PainterShader::Tag absorb_blend_shader (const reference_counted_ptr< PainterBlendShader > &shader)=0
 
virtual PainterShader::Tag absorb_custom_brush_shader (const reference_counted_ptr< PainterBrushShader > &shader)=0
 
virtual PainterShader::Tag absorb_item_coverage_shader (const reference_counted_ptr< PainterItemCoverageShader > &shader)=0
 
virtual PainterShader::Tag absorb_item_shader (const reference_counted_ptr< PainterItemShader > &shader)=0
 
virtual bool blend_type_supported (enum PainterBlendShader::shader_type) const =0
 
virtual uint32_t compute_blend_sub_shader_group (const reference_counted_ptr< PainterBlendShader > &shader)=0
 
virtual uint32_t compute_custom_brush_sub_shader_group (const reference_counted_ptr< PainterBrushShader > &shader)=0
 
virtual uint32_t compute_item_coverage_sub_shader_group (const reference_counted_ptr< PainterItemCoverageShader > &shader)=0
 
virtual uint32_t compute_item_sub_shader_group (const reference_counted_ptr< PainterItemShader > &shader)=0
 
Mutexmutex (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 PainterShaderRegistrar is an interface that defines the assigning of PainterShader::ID() to a PainterShader. PainterShader objects are registered to a unique PainterShaderRegistrar for their lifetime.

Definition at line 38 of file painter_shader_registrar.hpp.

Constructor & Destructor Documentation

◆ PainterShaderRegistrar()

fastuidraw::PainterShaderRegistrar::PainterShaderRegistrar ( void  )

Ctor.

Member Function Documentation

◆ absorb_blend_shader()

virtual PainterShader::Tag fastuidraw::PainterShaderRegistrar::absorb_blend_shader ( const reference_counted_ptr< PainterBlendShader > &  shader)
protectedpure virtual

To be implemented by a derived class to take into use a blend shader. Typically this means inserting the the blend shader into a large uber shader. Returns the PainterShader::Tag to be used by the backend to identify the shader. An implementation will never be passed an object for which PainterShader::parent() is non-nullptr. In addition, mutex() will be locked on entry.

Parameters
shadershader whose Tag is to be computed

Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.

◆ absorb_custom_brush_shader()

virtual PainterShader::Tag fastuidraw::PainterShaderRegistrar::absorb_custom_brush_shader ( const reference_counted_ptr< PainterBrushShader > &  shader)
protectedpure virtual

To be implemented by a derived class to take into use a blend shader. Typically this means inserting the the blend shader into a large uber shader. Returns the PainterShader::Tag to be used by the backend to identify the shader. An implementation will never be passed an object for which PainterShader::parent() is non-nullptr. In addition, mutex() will be locked on entry.

Parameters
shadershader whose Tag is to be computed

Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.

◆ absorb_item_coverage_shader()

virtual PainterShader::Tag fastuidraw::PainterShaderRegistrar::absorb_item_coverage_shader ( const reference_counted_ptr< PainterItemCoverageShader > &  shader)
protectedpure virtual

To be implemented by a derived class to take into use an item shader. Typically this means inserting the the shader into a large uber shader. Returns the PainterShader::Tag to be used by the backend to identify the shader. An implementation will never be passed an object for which PainterShader::parent() is non-nullptr. In addition, mutex() will be locked on entry.

Parameters
shadershader whose Tag is to be computed

Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.

◆ absorb_item_shader()

virtual PainterShader::Tag fastuidraw::PainterShaderRegistrar::absorb_item_shader ( const reference_counted_ptr< PainterItemShader > &  shader)
protectedpure virtual

To be implemented by a derived class to take into use an item shader. Typically this means inserting the the shader into a large uber shader. Returns the PainterShader::Tag to be used by the backend to identify the shader. An implementation will never be passed an object for which PainterShader::parent() is non-nullptr. In addition, mutex() will be locked on entry.

Parameters
shadershader whose Tag is to be computed

Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.

◆ blend_type_supported()

virtual bool fastuidraw::PainterShaderRegistrar::blend_type_supported ( enum PainterBlendShader::shader_type  ) const
protectedpure virtual

To be implemented by a derived class to return true if and only if a PainterBlendShader objects with a given PainterBlendShader::shader_type value for PainterBlendShader::type() is supported. The return values must be unchanging for the lifetime of the PainterShaderRegistrar object.

◆ compute_blend_sub_shader_group()

virtual uint32_t fastuidraw::PainterShaderRegistrar::compute_blend_sub_shader_group ( const reference_counted_ptr< PainterBlendShader > &  shader)
protectedpure virtual

To be implemented by a derived class to compute the PainterShader::group() of a sub-shader. When called, the value of the shader's PainterShader::ID() and PainterShader::registered_to() are already set correctly. In addition, the value of PainterShader::group() is initialized to the same value as that of the PainterBlendShader::parent(). In addition, mutex() will be locked on entry.

Parameters
shadershader whose group is to be computed

Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.

◆ compute_custom_brush_sub_shader_group()

virtual uint32_t fastuidraw::PainterShaderRegistrar::compute_custom_brush_sub_shader_group ( const reference_counted_ptr< PainterBrushShader > &  shader)
protectedpure virtual

To be implemented by a derived class to compute the PainterShader::group() of a sub-shader. When called, the value of the shader's PainterShader::ID() and PainterShader::registered_to() are already set correctly. In addition, the value of PainterShader::group() is initialized to the same value as that of the PainterBrushShader::parent(). In addition, mutex() will be locked on entry.

Parameters
shadershader whose group is to be computed

Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.

◆ compute_item_coverage_sub_shader_group()

virtual uint32_t fastuidraw::PainterShaderRegistrar::compute_item_coverage_sub_shader_group ( const reference_counted_ptr< PainterItemCoverageShader > &  shader)
protectedpure virtual

To be implemented by a derived class to compute the PainterShader::group() of a sub-shader. When called, the value of the shader's PainterShader::ID() and PainterShader::registered_to() are already set correctly. In addition, the value of PainterShader::group() is initialized to the same value as that of the PainterItemShader::parent(). In addition, mutex() will be locked on entry.

Parameters
shadershader whose group is to be computed

Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.

◆ compute_item_sub_shader_group()

virtual uint32_t fastuidraw::PainterShaderRegistrar::compute_item_sub_shader_group ( const reference_counted_ptr< PainterItemShader > &  shader)
protectedpure virtual

To be implemented by a derived class to compute the PainterShader::group() of a sub-shader. When called, the value of the shader's PainterShader::ID() and PainterShader::registered_to() are already set correctly. In addition, the value of PainterShader::group() is initialized to the same value as that of the PainterItemShader::parent(). In addition, mutex() will be locked on entry.

Parameters
shadershader whose group is to be computed

Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.

◆ mutex()

Mutex& fastuidraw::PainterShaderRegistrar::mutex ( void  )
protected

Return the Mutex used to make this object thread safe.

◆ register_shader() [1/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( PainterItemShader shader)

Registers an item shader for use; registering a shader more than once to the SAME PainterShaderRegistrar has no effect. However, registering a shader to multiple PainterShaderRegistrar objects is an error.

◆ register_shader() [2/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( PainterItemCoverageShader shader)

Registers an item shader for use; registering a shader more than once to the SAME PainterShaderRegistrar has no effect. However, registering a shader to multiple PainterShaderRegistrar objects is an error.

◆ register_shader() [3/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( PainterBlendShader shader)

Registers a blend shader for use; registering a shader more than once to the SAME PainterShaderRegistrar has no effect. However, registering a shader to multiple PainterShaderRegistrar objects is an error.

◆ register_shader() [4/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( PainterBrushShader shader)

Registers a brush shader for use; registering a shader more than once to the SAME PainterShaderRegistrar has no effect. However, registering a shader to multiple PainterShaderRegistrar objects is an error.

◆ register_shader() [5/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( const PainterImageBrushShader shader)

Registers each of the sub-shaders of a PainterImageBrushShader.

◆ register_shader() [6/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( const PainterGradientBrushShader shader)

Registers each of the sub-shaders of a PainterGradientBrushShader.

◆ register_shader() [7/14]

template<typename T >
void fastuidraw::PainterShaderRegistrar::register_shader ( const reference_counted_ptr< T > &  shader)
inline

Provided as a conveniance to allow registering shaders through reference counted pointers.

Definition at line 113 of file painter_shader_registrar.hpp.

◆ register_shader() [8/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( const PainterStrokeShader p)

◆ register_shader() [9/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( const PainterFillShader p)

◆ register_shader() [10/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( const PainterDashedStrokeShaderSet p)

◆ register_shader() [11/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( const PainterGlyphShader p)

Register each of the reference_counted_ptr<PainterShader> in a PainterGlyphShader.

◆ register_shader() [12/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( const PainterBlendShaderSet p)

Register each of the PainterBlendShader in a PainterBlendShaderSet.

◆ register_shader() [13/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( const PainterBrushShaderSet p)

Register each of the PainterBrushShader in a PainterBrushShaderSet.

◆ register_shader() [14/14]

void fastuidraw::PainterShaderRegistrar::register_shader ( const PainterShaderSet p)

Register each of the shaders in a PainterShaderSet.

◆ unique_id()

unsigned int fastuidraw::PainterShaderRegistrar::unique_id ( void  ) const

Returns a unique ID for the PainterShaderRegistrar, this unique value will be used only by this PainterShaderRegistrar even if it destroyed, no other PainterShaderRegistrar will have it.


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