FastUIDraw
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
fastuidraw::gl::PainterEngineGL Class Reference

A PainterEngineGL implements PainterEngine using the GL (or GLES) API. The PainterShaderRegistrar object returned by painter_shader_registrar() derives from glsl::PainterShaderRegistrarGLSL. In addition, when adding custom shaders, the shader types need to be derived from the shader types of the GLSL module, i.e. More...

#include <painter_engine_gl.hpp>

Inheritance diagram for fastuidraw::gl::PainterEngineGL:
Inheritance graph
[legend]

Classes

class  ColorStopAtlasParams
 Class to hold the construction parameters for creating a GL-backend ColorStopAtlas for a PainterEngineGL. More...
 
class  ConfigurationGL
 A ConfigurationGL gives parameters how to contruct a PainterEngineGL. More...
 
class  GlyphAtlasParams
 Class to hold the construction parameters for creating a GL-backend GlyphAtlas for a PainterEngineGL. More...
 
class  ImageAtlasParams
 Class to hold the construction parameters for creating the GL-backend ImageAtlas for a PainterEngineGL. More...
 

Public Types

enum  buffer_streaming_type_t { buffer_streaming_use_mapping, buffer_streaming_orphaning, buffer_streaming_buffer_subdata }
 Specifies how to stream buffers into GL. More...
 
enum  program_type_t { program_all, program_without_discard, program_with_discard, number_program_types }
 Enumeration to specify which Program to fetch from the methods program(). More...
 
- Public Types inherited from fastuidraw::glsl::PainterShaderRegistrarGLSLTypes
enum  clipping_type_t { clipping_via_gl_clip_distance, clipping_via_discard, clipping_via_skip_color_write }
 
enum  colorstop_backing_t { colorstop_texture_1d_array, colorstop_texture_2d_array }
 Enumeration to specify how to access the backing store of a color stop atlas store in ColorStopAtlas::backing_store(). More...
 
enum  data_store_backing_t { data_store_tbo, data_store_ubo, data_store_ssbo }
 Enumeration to specify how the data store filled by PainterDraw::m_store is realized. More...
 
enum  fbf_blending_type_t { fbf_blending_not_supported, fbf_blending_framebuffer_fetch, fbf_blending_interlock }
 Enumeration to specify how to perform framebuffer-fetch blending. More...
 
enum  glyph_data_backing_t { glyph_data_tbo, glyph_data_texture_array, glyph_data_ssbo }
 Enumeration to specify how to access the backing store of the glyph data stored in GlyphAtlas::store() More...
 
enum  vertex_shader_in_layout { attribute0_slot = 0, attribute1_slot, attribute2_slot, header_attrib_slot }
 Enumeration to describe vertex shader input slot layout. More...
 
enum  z_coordinate_convention_t { z_minus_1_to_1, z_0_to_1 }
 Enumeration to specify the convention for a 3D API for its normalized device coordinate in z. More...
 

Public Member Functions

const ConfigurationGLconfiguration_gl (void) const
 
virtual reference_counted_ptr< PainterBackendcreate_backend (void) const override final
 
virtual reference_counted_ptr< PainterSurfacecreate_surface (ivec2 dims, enum PainterSurface::render_type_t render_type) override final
 
unsigned int num_image_units (void) const
 
unsigned int num_ssbo_units (void) const
 
unsigned int num_texture_units (void) const
 
unsigned int num_ubo_units (void) const
 
reference_counted_ptr< Programprogram (enum program_type_t discard_tp, enum PainterBlendShader::shader_type blend_type)
 
reference_counted_ptr< Programprogram_deferred_coverage_buffer (void)
 
- Public Member Functions inherited from fastuidraw::PainterEngine
ColorStopAtlascolorstop_atlas (void) const
 
const ConfigurationBaseconfiguration_base (void) const
 
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)
 

Static Public Member Functions

static reference_counted_ptr< PainterEngineGLcreate (ConfigurationGL config_gl, const ContextProperties &ctx=ContextProperties())
 
static reference_counted_ptr< PainterEngineGLcreate (bool optimal_rendering_quality, const ContextProperties &ctx=ContextProperties())
 
- 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)
 

Additional Inherited Members

- Protected Member Functions inherited from 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)
 
PerformanceHintsset_hints (void)
 

Detailed Description

A PainterEngineGL implements PainterEngine using the GL (or GLES) API. The PainterShaderRegistrar object returned by painter_shader_registrar() derives from glsl::PainterShaderRegistrarGLSL. In addition, when adding custom shaders, the shader types need to be derived from the shader types of the GLSL module, i.e.

Definition at line 55 of file painter_engine_gl.hpp.

Member Enumeration Documentation

◆ buffer_streaming_type_t

Specifies how to stream buffers into GL.

!

Enumerator
buffer_streaming_use_mapping 

Reuse GL buffer objects and stream the data via glMapBufferRange

buffer_streaming_orphaning 

Reuse the same GL buffer NAMES, but use glBufferData() to orphan the GL buffer objects to replace the data.

buffer_streaming_buffer_subdata 

Reuse the GL buffer objects and stream the data via glBufferSubData

Definition at line 93 of file painter_engine_gl.hpp.

◆ program_type_t

Enumeration to specify which Program to fetch from the methods program().

Enumerator
program_all 

Get the GLSL program that handles all item shaders

program_without_discard 

Get the GLSL program that handles those item shaders which do not have discard

program_with_discard 

Get the GLSL program that handles those item shaders which do have discard

Definition at line 65 of file painter_engine_gl.hpp.

Member Function Documentation

◆ configuration_gl()

const ConfigurationGL& fastuidraw::gl::PainterEngineGL::configuration_gl ( void  ) const

Returns the ConfigurationGL adapted from that passed by ctor (for the properties of the GL context) of the PainterBackendGL.

◆ create() [1/2]

static reference_counted_ptr<PainterEngineGL> fastuidraw::gl::PainterEngineGL::create ( ConfigurationGL  config_gl,
const ContextProperties ctx = ContextProperties() 
)
static

Ctor. Create a PainterEngineGL configured via a ConfigurationGL value. The configuration of the created PainterEngineGL will be adjusted according to the functionaliy of the currentl current GL context. In addition, the current GL context or a GL context of its share group must be current when the PainterEngineGL is used.

Parameters
config_glConfigurationGL providing configuration parameters
ctxOptional argument to pass to avoid re-querying the current GL context for extension and version

◆ create() [2/2]

static reference_counted_ptr<PainterEngineGL> fastuidraw::gl::PainterEngineGL::create ( bool  optimal_rendering_quality,
const ContextProperties ctx = ContextProperties() 
)
static

Ctor. Create a PainterEngineGL and the atlases to be used by it. The atlases and PainterEngineGL will be configured optimally as according to the current GL context. In addition, the current GL context or a GL context of its share group must be current when the PainterEngineGL is used.

Parameters
optimal_rendering_qualityif true, select parameters that give optimal rendering quality (at potential sacrifice of performance). If false, choose for optimal performance even at the cost of rendering quality.
ctxOptional argument to pass to avoid re-querying the current GL context for extension and version

◆ create_backend()

virtual reference_counted_ptr<PainterBackend> fastuidraw::gl::PainterEngineGL::create_backend ( void  ) const
finaloverridevirtual

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

Implements fastuidraw::PainterEngine.

◆ create_surface()

virtual reference_counted_ptr<PainterSurface> fastuidraw::gl::PainterEngineGL::create_surface ( ivec2  dims,
enum PainterSurface::render_type_t  render_type 
)
finaloverridevirtual

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).

Implements fastuidraw::PainterEngine.

◆ num_image_units()

unsigned int fastuidraw::gl::PainterEngineGL::num_image_units ( void  ) const

Returns the number of image binding units used; the units used are 0, 1, ..., num_image_units() - 1.

◆ num_ssbo_units()

unsigned int fastuidraw::gl::PainterEngineGL::num_ssbo_units ( void  ) const

Returns the number of SSBO binding units used; the units used are 0, 1, ..., num_ssbo_units() - 1.

◆ num_texture_units()

unsigned int fastuidraw::gl::PainterEngineGL::num_texture_units ( void  ) const

Returns the number of texture binding units used; the units used are 0, 1, ..., num_texture_units() - 1.

◆ num_ubo_units()

unsigned int fastuidraw::gl::PainterEngineGL::num_ubo_units ( void  ) const

Returns the number of UBO binding units used; the units used are 0, 1, ..., num_ubo_units() - 1.

◆ program()

reference_counted_ptr<Program> fastuidraw::gl::PainterEngineGL::program ( enum program_type_t  discard_tp,
enum PainterBlendShader::shader_type  blend_type 
)

Return the specified Program used to draw by Painter Backend objects generated by this PainterEngineGL.

Parameters
discard_tpselects what item-shaders are included
blend_typeselects what blend type

◆ program_deferred_coverage_buffer()

reference_counted_ptr<Program> fastuidraw::gl::PainterEngineGL::program_deferred_coverage_buffer ( void  )

Returns the Program used to draw to the deferred coverage buffer.


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