FastUIDraw
|
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>
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) | |
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) |
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.
fastuidraw::PainterShaderRegistrar::PainterShaderRegistrar | ( | void | ) |
Ctor.
|
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.
shader | shader whose Tag is to be computed |
Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.
|
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.
shader | shader whose Tag is to be computed |
Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.
|
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.
shader | shader whose Tag is to be computed |
Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.
|
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.
shader | shader whose Tag is to be computed |
Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.
|
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.
|
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.
shader | shader whose group is to be computed |
Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.
|
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.
shader | shader whose group is to be computed |
Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.
|
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.
shader | shader whose group is to be computed |
Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.
|
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.
shader | shader whose group is to be computed |
Implemented in fastuidraw::glsl::PainterShaderRegistrarGLSL.
|
protected |
Return the Mutex used to make this object thread safe.
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.
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.
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.
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.
void fastuidraw::PainterShaderRegistrar::register_shader | ( | const PainterImageBrushShader * | shader | ) |
Registers each of the sub-shaders of a PainterImageBrushShader.
void fastuidraw::PainterShaderRegistrar::register_shader | ( | const PainterGradientBrushShader * | shader | ) |
Registers each of the sub-shaders of a PainterGradientBrushShader.
|
inline |
Provided as a conveniance to allow registering shaders through reference counted pointers.
Definition at line 113 of file painter_shader_registrar.hpp.
void fastuidraw::PainterShaderRegistrar::register_shader | ( | const PainterStrokeShader & | p | ) |
Register each PainterItemShader in a PainterStrokeShader
void fastuidraw::PainterShaderRegistrar::register_shader | ( | const PainterFillShader & | p | ) |
Register each PainterItemShader in a PainterFillShader
void fastuidraw::PainterShaderRegistrar::register_shader | ( | const PainterDashedStrokeShaderSet & | p | ) |
Register each PainterStrokeShader in a PainterDashedStrokeShaderSet
void fastuidraw::PainterShaderRegistrar::register_shader | ( | const PainterGlyphShader & | p | ) |
Register each of the reference_counted_ptr<PainterShader> in a PainterGlyphShader.
void fastuidraw::PainterShaderRegistrar::register_shader | ( | const PainterBlendShaderSet & | p | ) |
Register each of the PainterBlendShader in a PainterBlendShaderSet.
void fastuidraw::PainterShaderRegistrar::register_shader | ( | const PainterBrushShaderSet & | p | ) |
Register each of the PainterBrushShader in a PainterBrushShaderSet.
void fastuidraw::PainterShaderRegistrar::register_shader | ( | const PainterShaderSet & | p | ) |
Register each of the shaders in a PainterShaderSet.
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.