FastUIDraw
|
Painter implements a canvas rendering interface. More...
#include <painter.hpp>
Classes | |
class | GlyphRendererChooser |
A GlyphRendererChooser provides an interface for choosing how to render glyphs depending on the current transformation matrix, Painter::transformation(). More... | |
class | NormalizedCoordRect |
A NormalizedCoordRect is used to specify a rectangle in -normalized- device coordinates. Recall that normalized device coordinates hae that the bottom-left is (-1, 1) and the top right is (+1, +1) ALWAYS. More... | |
Public Member Functions | |
Painter (const reference_counted_ptr< PainterEngine > &backend) | |
void | begin (const reference_counted_ptr< PainterSurface > &surface, const float3x3 &initial_transformation, bool clear_color_buffer=true) |
void | begin (const reference_counted_ptr< PainterSurface > &surface, enum screen_orientation orientation, bool clear_color_buffer=true) |
void | begin_coverage_buffer (void) |
void | begin_coverage_buffer (const Rect &logical_rect, float additional_pixel_slack=0.0f, float additional_item_slack=0.0f) |
void | begin_coverage_buffer (const NormalizedCoordRect &normalized_rect, float additional_pixel_slack=0.0f) |
void | begin_layer (const reference_counted_ptr< const PainterEffect > &effect, PainterEffectParams &effect_params) |
void | begin_layer (const vec4 &color_modulate) |
void | begin_layer (float alpha) |
BlendMode | blend_mode (void) const |
PainterBlendShader * | blend_shader (void) const |
void | blend_shader (const reference_counted_ptr< PainterBlendShader > &h, BlendMode blend_mode) |
void | blend_shader (const PainterBlendShaderSet &shader_set, enum blend_mode_t m) |
void | blend_shader (enum blend_mode_t m) |
c_array< const vec3 > | clip_equations (void) |
void | clip_in_path (const Path &path, enum fill_rule_t fill_rule) |
void | clip_in_path (const FilledPath &path, enum fill_rule_t fill_rule) |
void | clip_in_path (const Path &path, const CustomFillRuleBase &fill_rule) |
void | clip_in_path (const FilledPath &path, const CustomFillRuleBase &fill_rule) |
void | clip_in_rect (const Rect &rect) |
void | clip_in_rounded_rect (const RoundedRect &R) |
void | clip_out_convex_polygon (c_array< const vec2 > poly) |
void | clip_out_custom (PainterItemShader *shader, const PainterDataValue< PainterItemShaderData > &shader_data, c_array< const c_array< const PainterAttribute > > attrib_chunks, c_array< const c_array< const PainterIndex > > index_chunks, c_array< const int > index_adjusts, c_array< const unsigned int > attrib_chunk_selector) |
void | clip_out_custom (PainterItemShader *shader, const PainterDataValue< PainterItemShaderData > &shader_data, c_array< const c_array< const PainterAttribute > > attrib_chunks, c_array< const c_array< const PainterIndex > > index_chunks, c_array< const int > index_adjusts) |
void | clip_out_custom (PainterItemShader *shader, const PainterDataValue< PainterItemShaderData > &shader_data, c_array< const PainterAttribute > attrib_chunk, c_array< const PainterIndex > index_chunk, int index_adjust=0) |
void | clip_out_path (const Path &path, enum fill_rule_t fill_rule) |
void | clip_out_path (const FilledPath &path, enum fill_rule_t fill_rule) |
void | clip_out_path (const Path &path, const CustomFillRuleBase &fill_rule) |
void | clip_out_path (const FilledPath &path, const CustomFillRuleBase &fill_rule) |
void | clip_out_rect (const Rect &rect) |
void | clip_out_rounded_rect (const RoundedRect &R) |
c_array< const vec3 > | clip_polygon (void) |
bool | clip_region_bounds (vec2 *min_pt, vec2 *max_pt) |
bool | clip_region_logical_bounds (vec2 *min_pt, vec2 *max_pt) |
ColorStopAtlas & | colorstop_atlas (void) const |
GlyphRenderer | compute_glyph_renderer (float pixel_size) |
GlyphRenderer | compute_glyph_renderer (float pixel_size, const GlyphRendererChooser &chooser) |
float | compute_path_thresh (const Path &path) |
float | compute_path_thresh (const Path &path, const c_array< const uvec4 > shader_data, const reference_counted_ptr< const StrokingDataSelectorBase > &selector, float *out_rounded_thresh) |
void | concat (const float3x3 &tr) |
void | curve_flatness (float thresh) |
float | curve_flatness (void) |
const GlyphRendererChooser & | default_glyph_renderer_chooser (void) const |
const PainterShaderSet & | default_shaders (void) const |
unsigned int | draw_data_added_count (void) const |
void | draw_generic (PainterItemShader *shader, const PainterData &draw, c_array< const PainterAttribute > attrib_chunk, c_array< const PainterIndex > index_chunk, int index_adjust=0) |
void | draw_generic (PainterItemShader *shader, const PainterData &draw, c_array< const c_array< const PainterAttribute > > attrib_chunks, c_array< const c_array< const PainterIndex > > index_chunks, c_array< const int > index_adjusts) |
void | draw_generic (PainterItemShader *shader, const PainterData &draw, c_array< const c_array< const PainterAttribute > > attrib_chunks, c_array< const c_array< const PainterIndex > > index_chunks, c_array< const int > index_adjusts, c_array< const unsigned int > attrib_chunk_selector) |
void | draw_generic (PainterItemShader *shader, const PainterData &draw, c_array< const PainterAttribute > attrib_chunk, c_array< const PainterIndex > index_chunk, range_type< int > z_range, int index_adjust=0) |
void | draw_generic (PainterItemShader *shader, const PainterData &draw, c_array< const c_array< const PainterAttribute > > attrib_chunks, c_array< const c_array< const PainterIndex > > index_chunks, c_array< const range_type< int > > z_ranges, c_array< const int > index_adjusts) |
void | draw_generic (PainterItemShader *shader, const PainterData &draw, const PainterAttributeWriter &src) |
GlyphRenderer | draw_glyphs (const PainterGlyphShader &shader, const PainterData &draw, const GlyphSequence &glyph_sequence, GlyphRenderer renderer=GlyphRenderer(banded_rays_glyph)) |
GlyphRenderer | draw_glyphs (const PainterData &draw, const GlyphSequence &glyph_sequence, GlyphRenderer renderer=GlyphRenderer(banded_rays_glyph)) |
GlyphRenderer | draw_glyphs (const PainterBrush &brush, const GlyphSequence &glyph_sequence, GlyphRenderer renderer=GlyphRenderer(banded_rays_glyph)) |
GlyphRenderer | draw_glyphs (const PainterGlyphShader &shader, const PainterData &draw, const GlyphSequence &glyph_sequence, const GlyphRendererChooser &renderer_chooser) |
GlyphRenderer | draw_glyphs (const PainterData &draw, const GlyphSequence &glyph_sequence, const GlyphRendererChooser &renderer_chooser) |
GlyphRenderer | draw_glyphs (const PainterBrush &brush, const GlyphSequence &glyph_sequence, const GlyphRendererChooser &renderer_chooser) |
GlyphRenderer | draw_glyphs (const PainterGlyphShader &shader, const PainterData &draw, const GlyphRun &glyph_run, unsigned int begin, unsigned int count, GlyphRenderer renderer=GlyphRenderer(banded_rays_glyph)) |
GlyphRenderer | draw_glyphs (const PainterData &draw, const GlyphRun &glyph_run, unsigned int begin, unsigned int count, GlyphRenderer renderer=GlyphRenderer(banded_rays_glyph)) |
GlyphRenderer | draw_glyphs (const PainterBrush &brush, const GlyphRun &glyph_run, unsigned int begin, unsigned int count, GlyphRenderer renderer=GlyphRenderer(banded_rays_glyph)) |
GlyphRenderer | draw_glyphs (const PainterGlyphShader &shader, const PainterData &draw, const GlyphRun &glyph_run, GlyphRenderer renderer=GlyphRenderer(banded_rays_glyph)) |
GlyphRenderer | draw_glyphs (const PainterData &draw, const GlyphRun &glyph_run, GlyphRenderer renderer=GlyphRenderer(banded_rays_glyph)) |
GlyphRenderer | draw_glyphs (const PainterBrush &brush, const GlyphRun &glyph_run, GlyphRenderer renderer=GlyphRenderer(banded_rays_glyph)) |
GlyphRenderer | draw_glyphs (const PainterGlyphShader &shader, const PainterData &draw, const GlyphRun &glyph_run, unsigned int begin, unsigned int count, const GlyphRendererChooser &renderer_chooser) |
GlyphRenderer | draw_glyphs (const PainterData &draw, const GlyphRun &glyph_run, unsigned int begin, unsigned int count, const GlyphRendererChooser &renderer_chooser) |
GlyphRenderer | draw_glyphs (const PainterBrush &brush, const GlyphRun &glyph_run, unsigned int begin, unsigned int count, const GlyphRendererChooser &renderer_chooser) |
GlyphRenderer | draw_glyphs (const PainterGlyphShader &shader, const PainterData &draw, const GlyphRun &glyph_run, const GlyphRendererChooser &renderer_chooser) |
GlyphRenderer | draw_glyphs (const PainterData &draw, const GlyphRun &glyph_run, const GlyphRendererChooser &renderer_chooser) |
GlyphRenderer | draw_glyphs (const PainterBrush &brush, const GlyphRun &glyph_run, const GlyphRendererChooser &renderer_chooser) |
c_array< const PainterSurface *const > | end (void) |
void | end_coverage_buffer (void) |
void | end_layer (void) |
void | fill_convex_polygon (const PainterFillShader &shader, const PainterData &draw, c_array< const vec2 > pts, bool apply_shader_anti_aliasing=true) |
void | fill_convex_polygon (const PainterData &draw, c_array< const vec2 > pts, bool apply_shader_anti_aliasing=true) |
void | fill_convex_polygon (const PainterBrush &brush, c_array< const vec2 > pts, bool apply_shader_anti_aliasing=true) |
void | fill_path (const PainterFillShader &shader, const PainterData &draw, const FilledPath &data, enum fill_rule_t fill_rule, bool apply_shader_anti_aliasing=true) |
void | fill_path (const PainterFillShader &shader, const PainterData &draw, const Path &path, enum fill_rule_t fill_rule, bool apply_shader_anti_aliasing=true) |
void | fill_path (const PainterFillShader &shader, const PainterData &draw, const FilledPath &data, const CustomFillRuleBase &fill_rule, bool apply_shader_anti_aliasing=true) |
void | fill_path (const PainterFillShader &shader, const PainterData &draw, const Path &path, const CustomFillRuleBase &fill_rule, bool apply_shader_anti_aliasing=true) |
void | fill_path (const PainterGlyphShader &shader, const PainterData &draw, const ShaderFilledPath &path, enum fill_rule_t fill_rule) |
void | fill_path (const PainterData &draw, const Path &path, enum fill_rule_t fill_rule, bool apply_shader_anti_aliasing=true) |
void | fill_path (const PainterData &draw, const Path &path, const CustomFillRuleBase &fill_rule, bool apply_shader_anti_aliasing=true) |
void | fill_path (const PainterData &draw, const ShaderFilledPath &path, enum fill_rule_t fill_rule) |
void | fill_path (const PainterBrush &brush, const Path &path, enum fill_rule_t fill_rule, bool apply_shader_anti_aliasing=true) |
void | fill_path (const PainterBrush &brush, const Path &path, const CustomFillRuleBase &fill_rule, bool apply_shader_anti_aliasing=true) |
void | fill_rect (const PainterFillShader &shader, const PainterData &draw, const Rect &rect, bool apply_shader_anti_aliasing=true) |
void | fill_rect (const PainterData &draw, const Rect &rect, bool apply_shader_anti_aliasing=true) |
void | fill_rect (const PainterBrush &brush, const Rect &rect, bool apply_shader_anti_aliasing=true) |
void | fill_rounded_rect (const PainterFillShader &shader, const PainterData &draw, const RoundedRect &R, bool apply_shader_anti_aliasing=true) |
void | fill_rounded_rect (const PainterData &draw, const RoundedRect &R, bool apply_shader_anti_aliasing=true) |
void | fill_rounded_rect (const PainterBrush &brush, const RoundedRect &R, bool apply_shader_anti_aliasing=true) |
enum return_code | flush (void) |
enum return_code | flush (const reference_counted_ptr< PainterSurface > &new_surface) |
GlyphAtlas & | glyph_atlas (void) const |
GlyphCache & | glyph_cache (void) const |
ImageAtlas & | image_atlas (void) const |
PainterPackedValuePool & | packed_value_pool (void) |
PainterShaderRegistrar & | painter_shader_registrar (void) const |
unsigned int | query_stat (enum query_stats_t st) const |
void | query_stats (c_array< unsigned int > dst) const |
void | queue_action (const reference_counted_ptr< const PainterDrawBreakAction > &action) |
void | restore (void) |
void | rotate (float angle) |
void | save (void) |
void | scale (float s) |
unsigned int | select_subsets (const FilledPath &path, c_array< unsigned int > dst) |
void | select_subsets (const PartitionedTessellatedPath &path, c_array< const float > geometry_inflation, bool select_miter_joins, fastuidraw::PartitionedTessellatedPath::SubsetSelection &dst, NormalizedCoordRect *nrect) |
void | shear (float sx, float sy) |
void | stroke_dashed_path (const PainterDashedStrokeShaderSet &shader, const PainterData &draw, const Path &path, const StrokingStyle &stroke_style=StrokingStyle(), bool apply_shader_anti_aliasing=true, enum stroking_method_t stroking_method=stroking_method_fastest, const PathEffect *effect=nullptr) |
void | stroke_dashed_path (const PainterData &draw, const Path &path, const StrokingStyle &stroke_style=StrokingStyle(), bool apply_shader_anti_aliasing=true, enum stroking_method_t stroking_method=stroking_method_fastest, const PathEffect *effect=nullptr) |
void | stroke_dashed_path (const PainterBrush &brush, const PainterDashedStrokeParams &stroking_params, const Path &path, const StrokingStyle &stroke_style=StrokingStyle(), bool apply_shader_anti_aliasing=true, enum stroking_method_t stroking_method=stroking_method_fastest, const PathEffect *effect=nullptr) |
void | stroke_path (const PainterStrokeShader &shader, const PainterData &draw, const Path &path, const StrokingStyle &stroke_style=StrokingStyle(), bool apply_shader_anti_aliasing=true, enum stroking_method_t stroking_method=stroking_method_fastest, const PathEffect *effect=nullptr) |
void | stroke_path (const PainterData &draw, const Path &path, const StrokingStyle &stroke_style=StrokingStyle(), bool apply_shader_anti_aliasing=true, enum stroking_method_t stroking_method=stroking_method_fastest, const PathEffect *effect=nullptr) |
void | stroke_path (const PainterBrush &brush, const PainterStrokeParams &stroking_params, const Path &path, const StrokingStyle &stroke_style=StrokingStyle(), bool apply_shader_anti_aliasing=true, enum stroking_method_t stroking_method=stroking_method_fastest, const PathEffect *effect=nullptr) |
const reference_counted_ptr< PainterSurface > & | surface (void) const |
void | transformation (const float3x3 &m) |
const float3x3 & | transformation (void) |
void | translate (const vec2 &p) |
Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter > | |
reference_counted_base (void) | |
Static Public Member Functions | |
static unsigned int | number_stats (void) |
Static Public Member Functions inherited from fastuidraw::PainterEnums | |
static enum fill_rule_t | complement_fill_rule (enum fill_rule_t f) |
static bool | is_miter_join (enum join_style js) |
static c_string | label (enum screen_orientation v) |
static c_string | label (enum rotation_orientation_t v) |
static c_string | label (enum glyph_layout_type v) |
static c_string | label (enum cap_style v) |
static c_string | label (enum join_style v) |
static c_string | label (enum fill_rule_t v) |
static c_string | label (enum stroking_method_t v) |
static c_string | label (enum blend_mode_t v) |
static c_string | label (enum query_stats_t v) |
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) |
Painter implements a canvas rendering interface.
Painter implements:
The transformation of a Painter goes from local item coordinate to 3D API clip-coordinates (for example in GL, from item coordinates to gl_Position.xyw). FastUIDraw follows the convention that the top of the window is at normalized y-coordinate -1 and the bottom of the window is at normalized y-coordinate +1. The transformation is to be applied as matrix-vector multiplication, i.e.
for local coordiante (x, y). Normalized device coordinates are defined as
where (-1, -1) corresponds to the bottom-left hand corner of the viewport (see PainterSurface::viewport()) and (+1, +1) is the top right hand corner of the viewport.
The pixel pipeline of Painter is
Painter uses clip-planes and the depth buffer to perform clipping. The depth-buffer clips by occluding elements. For example, the method clip_out_rect() simply draws a rectangle so that it does not affect the color buffer but with a depth value that is infront of the elements that it is to occlude. Painter uses the convention that elements with greater than or equal depth values are visible (for example in GL this corresponds to the depth test being set to GL_GEQUAL). Unless an item occludes (or self occludes), the current active depth value is unaffected. An item's vertex shader will emit a relative z-value (i.e. relative to the item) which is then incremented by the current z-value of the Painter.
A Painter is a HEAVY object (it creates pools of buffers during its lifetime for reuse). As such, one should reuse Painter objects as much as reasonably possible.
Definition at line 120 of file painter.hpp.
|
explicit |
Ctor.
backend | PainterEngine object from which via PainterEngine::create_backend(), the created Painter object will use for its entire lifetime. |
void fastuidraw::Painter::begin | ( | const reference_counted_ptr< PainterSurface > & | surface, |
const float3x3 & | initial_transformation, | ||
bool | clear_color_buffer = true |
||
) |
Indicate to start drawing with methods of this Painter. The transformation matrix will be intialized with given float3x3. Drawing commands sent to 3D hardware are buffered and not sent to the hardware until end() is called. All draw commands must be between a begin()/end() pair.
surface | the PainterSurface to which to render content |
initial_transformation | value to initialize transformation() which is the matrix from logical coordinates to API 3D clip coordinates. |
clear_color_buffer | if true, clear the color buffer on the viewport of the surface. |
void fastuidraw::Painter::begin | ( | const reference_counted_ptr< PainterSurface > & | surface, |
enum screen_orientation | orientation, | ||
bool | clear_color_buffer = true |
||
) |
Indicate to start drawing with methods of this Painter. The ransformation matrix will be intialized with a projection matrix derived from the passed screen_orientation and the viewort of the passed PainterSurface. Drawing commands sent to 3D hardware are buffered and not sent to the hardware until end() is called. All draw commands must be between a begin()/end() pair.
surface | the PainterSurface to which to render content |
orientation | orientation convention with which to initialize the transformation |
clear_color_buffer | if true, clear the color buffer on the viewport of the surface. |
void fastuidraw::Painter::begin_coverage_buffer | ( | void | ) |
Begin a deferred coverage buffer layer. A deferred coverage buffer is needed for those PainterItemShader values for which PainterItemShader::coverage_shader() is non-null. When a coverage buffer is active, those PainterItemCoverageShader will render to the current deferred coverage buffer and the PainterItemShader will read from it for its rendering. This starts a coverage buffer layer region of the size of the bounding box of the current clip-region. It is strongly suggested to use begin_coverage_buffer(const Rect&, float, float) or begin_coverage_buffer(const NormalizedCoordRect&, float) to limit the size of the coverage buffer.
void fastuidraw::Painter::begin_coverage_buffer | ( | const Rect & | logical_rect, |
float | additional_pixel_slack = 0.0f , |
||
float | additional_item_slack = 0.0f |
||
) |
Acts the same as begin_coverage_buffer(void), but limits the coverage buffer to the bounding box of the intersection of the current clipping region with the passed rectangle.
logical_rect | rectangle in LOGICAL coordinates, i.e. before transformation() is applied. |
additional_pixel_slack | inflate the coverage buffer region by this many pixels on each side |
additional_item_slack | inflate the coverage buffer region by this amount in logical coordinates |
void fastuidraw::Painter::begin_coverage_buffer | ( | const NormalizedCoordRect & | normalized_rect, |
float | additional_pixel_slack = 0.0f |
||
) |
Acts the same as begin_coverage_buffer(void), but limits the coverage buffer to the bounding box of the intersection of the current clipping region with the passed rectangle.
normalized_rect | rectangle in NORMALIZED DEVICE coordinates, i.e. after transformation() is applied. |
additional_pixel_slack | inflate the coverage buffer region by this many pixels on each side |
void fastuidraw::Painter::begin_layer | ( | const reference_counted_ptr< const PainterEffect > & | effect, |
PainterEffectParams & | effect_params | ||
) |
Begin an FX layer. This marks first rendering into an offscreen buffer and then blitting the buffer with the passed FX applied. The buffer will be blitted with the blend_shader(), and blend_mode() at the time of the call to begin_layer(). All restore() commands called after a begin_layer() must match a save() from after a begin_layer(). It is acceptable to layer any number of begin_layer() calls as well.
effect | effect to apply |
effect_params | effect parameters for the effect |
void fastuidraw::Painter::begin_layer | ( | const vec4 & | color_modulate | ) |
Begin a transparency layer. This marks first rendering into an offscreen buffer and then blitting the buffer. The buffer will be blitted with the blend_shader(), and blend_mode() at the time of the call to begin_layer(). All restore() commands called after a begin_layer() must match a save() from after a begin_layer(). It is acceptable to layer any number of begin_layer() calls as well.
color_modulate | color value by which to modulate the layer when it is to be blitted |
|
inline |
Provided as a conveniance, equivalent to
alpha | alpha value for color modulation. |
Definition at line 783 of file painter.hpp.
BlendMode fastuidraw::Painter::blend_mode | ( | void | ) | const |
Returns the active 3D API blend mode
PainterBlendShader* fastuidraw::Painter::blend_shader | ( | void | ) | const |
Returns the active blend shader
void fastuidraw::Painter::blend_shader | ( | const reference_counted_ptr< PainterBlendShader > & | h, |
BlendMode | blend_mode | ||
) |
Sets the blend shader.
h | blend shader to use for blending. |
blend_mode | 3D API blend mode |
|
inline |
Equivalent to
It is a crashing error if shader_set does not support the named blend mode.
shader_set | PainterBlendShaderSet from which to take blend shader |
m | Blend mode to use |
Definition at line 301 of file painter.hpp.
|
inline |
Equivalent to
m | Blend mode to use |
Definition at line 315 of file painter.hpp.
Returns the current clip-equations of the Painter. The clip-equations are updated whenever clip_in_rect() or clip_in_path() or restore() are called, as such the returned c_array then becomes invalid. The equations are in -CLIP- coordinates, thus do not change when the transformation changes.
void fastuidraw::Painter::clip_in_path | ( | const Path & | path, |
enum fill_rule_t | fill_rule | ||
) |
Clip-in by a path, i.e. set the clipping to be the intersection of the current clipping against the the fill of a path.
path | path by which to clip out |
fill_rule | fill rule to apply to path |
void fastuidraw::Painter::clip_in_path | ( | const FilledPath & | path, |
enum fill_rule_t | fill_rule | ||
) |
Clip-in by a path, i.e. set the clipping to be the intersection of the current clipping against the the fill of a path.
path | path by which to clip out |
fill_rule | fill rule to apply to path |
void fastuidraw::Painter::clip_in_path | ( | const Path & | path, |
const CustomFillRuleBase & | fill_rule | ||
) |
Clip-in by a path, i.e. set the clipping to be the intersection of the current clipping against the the fill of a path.
path | path by which to clip out |
fill_rule | custom fill rule to apply to path |
void fastuidraw::Painter::clip_in_path | ( | const FilledPath & | path, |
const CustomFillRuleBase & | fill_rule | ||
) |
Clip-in by a path, i.e. set the clipping to be the intersection of the current clipping against the the fill of a path.
path | path by which to clip out |
fill_rule | custom fill rule to apply to path |
void fastuidraw::Painter::clip_in_rect | ( | const Rect & | rect | ) |
Set clipping to the intersection of the current clipping with a rectangle.
rect | clip-in rectangle |
void fastuidraw::Painter::clip_in_rounded_rect | ( | const RoundedRect & | R | ) |
Set clipping to the intersection of the current clipping with a rounded rectangle.
R | rounded rectangle |
Clipout by a convex polygon
poly | points of the convex polygon |
void fastuidraw::Painter::clip_out_custom | ( | PainterItemShader * | shader, |
const PainterDataValue< PainterItemShaderData > & | shader_data, | ||
c_array< const c_array< const PainterAttribute > > | attrib_chunks, | ||
c_array< const c_array< const PainterIndex > > | index_chunks, | ||
c_array< const int > | index_adjusts, | ||
c_array< const unsigned int > | attrib_chunk_selector | ||
) |
Clipout by custom data.
shader | shader with which to draw the attribute/index data |
shader_data | shader data to pass to shader |
attrib_chunks | attribute data to draw |
index_chunks | the i'th element is index data into attrib_chunks[i] |
index_adjusts | if non-empty, the i'th element is the value by which to adjust all of index_chunks[i]; if empty the index values are not adjusted. |
attrib_chunk_selector | selects which attribute chunk to use for each index chunk |
|
inline |
Clipout by custom data.
shader | shader with which to draw the attribute/index data |
shader_data | shader data to pass to shader |
attrib_chunks | attribute data to draw |
index_chunks | the i'th element is index data into attrib_chunks[i] |
index_adjusts | if non-empty, the i'th element is the value by which to adjust all of index_chunks[i]; if empty the index values are not adjusted. |
Definition at line 662 of file painter.hpp.
|
inline |
Clipout by custom data.
shader | shader with which to draw the attribute/index data |
shader_data | shader data to pass to shader |
attrib_chunk | attribute data to draw |
index_chunk | index data into attrib_chunk |
index_adjust | amount by which to adjust the values in index_chunk |
Definition at line 682 of file painter.hpp.
void fastuidraw::Painter::clip_out_path | ( | const Path & | path, |
enum fill_rule_t | fill_rule | ||
) |
Clip-out by a path, i.e. set the clipping to be the intersection of the current clipping against the -complement- of the fill of a path.
path | path by which to clip out |
fill_rule | fill rule to apply to path |
void fastuidraw::Painter::clip_out_path | ( | const FilledPath & | path, |
enum fill_rule_t | fill_rule | ||
) |
Clip-out by a path, i.e. set the clipping to be the intersection of the current clipping against the -complement- of the fill of a path.
path | path by which to clip out |
fill_rule | fill rule to apply to path |
void fastuidraw::Painter::clip_out_path | ( | const Path & | path, |
const CustomFillRuleBase & | fill_rule | ||
) |
Clip-out by a path, i.e. set the clipping to be the intersection of the current clipping against the -complement- of the fill of a path.
path | path by which to clip out |
fill_rule | custom fill rule to apply to path |
void fastuidraw::Painter::clip_out_path | ( | const FilledPath & | path, |
const CustomFillRuleBase & | fill_rule | ||
) |
Clip-out by a path, i.e. set the clipping to be the intersection of the current clipping against the -complement- of the fill of a path.
path | path by which to clip out |
fill_rule | custom fill rule to apply to path |
void fastuidraw::Painter::clip_out_rect | ( | const Rect & | rect | ) |
Clipout by a rect
rect | clip-out rectangle |
void fastuidraw::Painter::clip_out_rounded_rect | ( | const RoundedRect & | R | ) |
Set clipping to the intersection of the current clipping with the complement of a rounded rectangle.
R | rounded rectangle |
Returns the convex polygon embodied by clip_equations(). The value changes whenever clip_in_rect(), clip_in_path() or restore() are called, as such the returned c_array then becomes invalid. The coordinates are in -CLIP- coordinates, thus do not change when the transformation changes.
If the clipping region is non-empty, returns true and writes the min and max corner of the bounding box in normalized device coordinates of the clipping region.
min_pt | location to which to write the minimum corner point |
max_pt | location to which to write the maximum corner point |
If the clipping region is non-empty, returns true and writes the min and max corner of the bounding box in local coordinates of the clipping region.
min_pt | location to which to write the minimum corner point |
max_pt | location to which to write the maximum corner point |
ColorStopAtlas& fastuidraw::Painter::colorstop_atlas | ( | void | ) | const |
Returns a reference to the ColorStopAtlas of this Painter. All color stops used by all brushes of this Painter must live on colorstop_atlas().
GlyphRenderer fastuidraw::Painter::compute_glyph_renderer | ( | float | pixel_size | ) |
Feed a logical pixel size and the current transformation to default_glyph_renderer_chooser() to compute how to render glyphs.
pixel_size | size of text to render BEFORE applying the transformation matrix. |
GlyphRenderer fastuidraw::Painter::compute_glyph_renderer | ( | float | pixel_size, |
const GlyphRendererChooser & | chooser | ||
) |
Feed a logical pixel size and the current transformation to a GlyphRendererChooser to compute how to render glyphs.
pixel_size | size of text to render BEFORE applying the transformation matrix. |
chooser | object that chooses how to render glyphs |
float fastuidraw::Painter::compute_path_thresh | ( | const Path & | path | ) |
Returns what value Painter currently uses for Path::tessellation(float) const to fetch the TessellatedPath from which it will fetch the FilledPath to perform a path fill.
path | Path to choose the thresh for |
float fastuidraw::Painter::compute_path_thresh | ( | const Path & | path, |
const c_array< const uvec4 > | shader_data, | ||
const reference_counted_ptr< const StrokingDataSelectorBase > & | selector, | ||
float * | out_rounded_thresh | ||
) |
Returns what value Painter currently uses for Path::tessellation(float) const to fetch the TessellatedPath use to perform stroking and filling.
path | Path to choose the thresh for | |
shader_data | data sent to stroking shader | |
selector | object (see PainterStrokeShader::stroking_data_selector()) to use stroking parameters to help compute necessary thresh | |
[out] | out_rounded_thresh | location to which to write threshhold to be used for rounded caps and joins of StrokedPath. |
void fastuidraw::Painter::concat | ( | const float3x3 & | tr | ) |
Concats the current transformation matrix by a given matrix.
tr | transformation by which to concat |
void fastuidraw::Painter::curve_flatness | ( | float | thresh | ) |
Set the curve flatness requirement for TessellatedPath selection when stroking or filling paths when passing to drawing methods a Path object. The value represents the distance, in pixels, requested for between the approximated curve (realized in TessellatedPath) and the true curve (realized in Path). This value is combined with a value derived from the current transformation matrix to pass to Path::tessellation(float) to fetch a TessellatedPath. Default value is 0.5.
float fastuidraw::Painter::curve_flatness | ( | void | ) |
Returns the value set by curve_flatness(float).
const GlyphRendererChooser& fastuidraw::Painter::default_glyph_renderer_chooser | ( | void | ) | const |
Returns the default GlyphRendererChooser object that Painter uses.
const PainterShaderSet& fastuidraw::Painter::default_shaders | ( | void | ) | const |
Return the default shaders for common drawing types.
unsigned int fastuidraw::Painter::draw_data_added_count | ( | void | ) | const |
Everytime Painter generates attribute/index data to be sent to the 3D API, this counter is incremented. The value is essentially equivalent to the number of times draw_generic() is called (directly or indirectly through other methods). The counter is reset when begin() is called.
|
inline |
Draw generic attribute data.
shader | shader with which to draw data |
draw | data for how to draw |
attrib_chunk | attribute data to draw |
index_chunk | index data into attrib_chunk |
index_adjust | amount by which to adjust the values in index_chunk |
Definition at line 1626 of file painter.hpp.
void fastuidraw::Painter::draw_generic | ( | PainterItemShader * | shader, |
const PainterData & | draw, | ||
c_array< const c_array< const PainterAttribute > > | attrib_chunks, | ||
c_array< const c_array< const PainterIndex > > | index_chunks, | ||
c_array< const int > | index_adjusts | ||
) |
Draw generic attribute data.
shader | shader with which to draw data |
draw | data for how to draw |
attrib_chunks | attribute data to draw |
index_chunks | the i'th element is index data into attrib_chunks[i] |
index_adjusts | if non-empty, the i'th element is the value by which to adjust all of index_chunks[i]; if empty the index values are not adjusted. |
void fastuidraw::Painter::draw_generic | ( | PainterItemShader * | shader, |
const PainterData & | draw, | ||
c_array< const c_array< const PainterAttribute > > | attrib_chunks, | ||
c_array< const c_array< const PainterIndex > > | index_chunks, | ||
c_array< const int > | index_adjusts, | ||
c_array< const unsigned int > | attrib_chunk_selector | ||
) |
Draw generic attribute data
shader | shader with which to draw data |
draw | data for how to draw |
attrib_chunks | attribute data to draw |
index_chunks | the i'th element is index data into attrib_chunks[K] where K = attrib_chunk_selector[i] |
index_adjusts | if non-empty, the i'th element is the value by which to adjust all of index_chunks[i]; if empty the index values are not adjusted. |
attrib_chunk_selector | selects which attribute chunk to use for each index chunk |
void fastuidraw::Painter::draw_generic | ( | PainterItemShader * | shader, |
const PainterData & | draw, | ||
c_array< const PainterAttribute > | attrib_chunk, | ||
c_array< const PainterIndex > | index_chunk, | ||
range_type< int > | z_range, | ||
int | index_adjust = 0 |
||
) |
Draw generic attribute data where the item self occludes
shader | shader with which to draw data |
draw | data for how to draw |
attrib_chunk | attribute data to draw |
index_chunk | index data into attrib_chunk |
index_adjust | amount by which to adjust the values in index_chunk |
z_range | z-range of item's attribute data |
void fastuidraw::Painter::draw_generic | ( | PainterItemShader * | shader, |
const PainterData & | draw, | ||
c_array< const c_array< const PainterAttribute > > | attrib_chunks, | ||
c_array< const c_array< const PainterIndex > > | index_chunks, | ||
c_array< const range_type< int > > | z_ranges, | ||
c_array< const int > | index_adjusts | ||
) |
Draw generic attribute data where the item self occludes
shader | shader with which to draw data |
draw | data for how to draw |
attrib_chunks | attribute data to draw |
index_chunks | index data into attrib_chunk |
z_ranges | z-ranges of item's attribute data |
index_adjusts | if non-empty, the i'th element is the value by which to adjust all of index_chunks[i]; if empty the index values are not adjusted. |
void fastuidraw::Painter::draw_generic | ( | PainterItemShader * | shader, |
const PainterData & | draw, | ||
const PainterAttributeWriter & | src | ||
) |
Draw generic attribute data
shader | shader with which to draw data |
draw | data for how to draw |
src | generator of attribute and index data |
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterGlyphShader & | shader, |
const PainterData & | draw, | ||
const GlyphSequence & | glyph_sequence, | ||
GlyphRenderer | renderer = GlyphRenderer(banded_rays_glyph) |
||
) |
Draw glyphs from a GlyphSequence.
shader | PainterGlyphShader to draw the glyphs |
draw | data for how to draw |
glyph_sequence | GlyphSequence providing glyphs |
renderer | how to render the glyphs. If GlyphRenderer::valid() is false, then the Painter will use default_glyph_renderer_chooser() to choose the renderer |
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterData & | draw, |
const GlyphSequence & | glyph_sequence, | ||
GlyphRenderer | renderer = GlyphRenderer(banded_rays_glyph) |
||
) |
Draw glyphs from a GlyphSequence.
draw | data for how to draw |
glyph_sequence | GlyphSequence providing glyphs |
renderer | how to render the glyphs. If GlyphRenderer::valid() is false, then the Painter will use default_glyph_renderer_chooser() to choose the renderer |
|
inline |
Draw glyphs from a GlyphSequence.
brush | brush to apply to stroking |
glyph_sequence | GlyphSequence providing glyphs |
renderer | how to render the glyphs. If GlyphRenderer::valid() is false, then the Painter will use default_glyph_renderer_chooser() to choose the renderer |
Definition at line 931 of file painter.hpp.
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterGlyphShader & | shader, |
const PainterData & | draw, | ||
const GlyphSequence & | glyph_sequence, | ||
const GlyphRendererChooser & | renderer_chooser | ||
) |
Draw glyphs from a GlyphSequence.
shader | PainterGlyphShader to draw the glyphs |
draw | data for how to draw |
glyph_sequence | GlyphSequence providing glyphs |
renderer_chooser | GlyphRendererChooser to use to choose how to render the glyphs. |
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterData & | draw, |
const GlyphSequence & | glyph_sequence, | ||
const GlyphRendererChooser & | renderer_chooser | ||
) |
Draw glyphs from a GlyphSequence. and the data of the passed GlyphSequence.
draw | data for how to draw |
glyph_sequence | GlyphSequence providing glyphs |
renderer_chooser | GlyphRendererChooser to use to choose how to render the glyphs. |
|
inline |
Draw glyphs from a GlyphSequence.
brush | brush to apply to text |
glyph_sequence | GlyphSequence providing glyphs |
renderer_chooser | GlyphRendererChooser to use to choose how to render the glyphs. |
Definition at line 976 of file painter.hpp.
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterGlyphShader & | shader, |
const PainterData & | draw, | ||
const GlyphRun & | glyph_run, | ||
unsigned int | begin, | ||
unsigned int | count, | ||
GlyphRenderer | renderer = GlyphRenderer(banded_rays_glyph) |
||
) |
Draw glyphs from a GlyphRun.
shader | PainterGlyphShader to draw the glyphs |
draw | data for how to draw |
glyph_run | GlyphRun providing glyphs |
renderer | how to render the glyphs. If GlyphRenderer::valid() is false, then the Painter will use default_glyph_renderer_chooser() to choose the renderer |
begin | first character of GlyphRun to draw |
count | number of characters, startng at begin, of the GlyphRun to draw |
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterData & | draw, |
const GlyphRun & | glyph_run, | ||
unsigned int | begin, | ||
unsigned int | count, | ||
GlyphRenderer | renderer = GlyphRenderer(banded_rays_glyph) |
||
) |
Draw glyphs from a GlyphRun. and the data of the passed GlyphRun.
draw | data for how to draw |
glyph_run | GlyphRun providing glyphs |
renderer | how to render the glyphs. If GlyphRenderer::valid() is false, then the Painter will use default_glyph_renderer_chooser() to choose the renderer |
begin | first character of GlyphRun to draw |
count | number of characters, startng at begin, of the GlyphRun to draw |
|
inline |
Draw glyphs from a GlyphRun. and the data of the passed GlyphRun.
brush | brush to apply to text |
glyph_run | GlyphRun providing glyphs |
renderer | how to render the glyphs. If GlyphRenderer::valid() is false, then the Painter will use default_glyph_renderer_chooser() to choose the renderer |
begin | first character of GlyphRun to draw |
count | number of characters, startng at begin, of the GlyphRun to draw |
Definition at line 1033 of file painter.hpp.
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterGlyphShader & | shader, |
const PainterData & | draw, | ||
const GlyphRun & | glyph_run, | ||
GlyphRenderer | renderer = GlyphRenderer(banded_rays_glyph) |
||
) |
Draw all glyphs from a GlyphRun.
shader | PainterGlyphShader to draw the glyphs |
draw | data for how to draw |
glyph_run | GlyphRun providing glyphs |
renderer | how to render the glyphs. If GlyphRenderer::valid() is false, then the Painter will use default_glyph_renderer_chooser() to choose the renderer |
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterData & | draw, |
const GlyphRun & | glyph_run, | ||
GlyphRenderer | renderer = GlyphRenderer(banded_rays_glyph) |
||
) |
Draw all glyphs from a GlyphRun. and the data of the passed GlyphRun.
draw | data for how to draw |
glyph_run | GlyphRun providing glyphs |
renderer | how to render the glyphs. If GlyphRenderer::valid() is false, then the Painter will use default_glyph_renderer_chooser() to choose the renderer |
|
inline |
Draw glyphs from a GlyphRun.
brush | brush to apply to text |
glyph_run | GlyphRun providing glyphs |
renderer | how to render the glyphs. If GlyphRenderer::valid() is false, then the Painter will use default_glyph_renderer_chooser() to choose the renderer |
Definition at line 1082 of file painter.hpp.
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterGlyphShader & | shader, |
const PainterData & | draw, | ||
const GlyphRun & | glyph_run, | ||
unsigned int | begin, | ||
unsigned int | count, | ||
const GlyphRendererChooser & | renderer_chooser | ||
) |
Draw glyphs from a GlyphRun.
shader | PainterGlyphShader to draw the glyphs |
draw | data for how to draw |
glyph_run | GlyphRun providing glyphs |
renderer_chooser | GlyphRendererChooser to use to choose how to render the glyphs. |
begin | first character of GlyphRun to draw |
count | number of characters, startng at begin, of the GlyphRun to draw |
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterData & | draw, |
const GlyphRun & | glyph_run, | ||
unsigned int | begin, | ||
unsigned int | count, | ||
const GlyphRendererChooser & | renderer_chooser | ||
) |
Draw glyphs from a GlyphRun. and the data of the passed GlyphRun.
draw | data for how to draw |
glyph_run | GlyphRun providing glyphs |
renderer_chooser | GlyphRendererChooser to use to choose how to render the glyphs. |
begin | first character of GlyphRun to draw |
count | number of characters, startng at begin, of the GlyphRun to draw |
|
inline |
Draw glyphs from a GlyphRun.
brush | brush to apply to text |
glyph_run | GlyphRun providing glyphs |
begin | first character of GlyphRun to draw |
count | number of characters, startng at begin, of the GlyphRun to draw |
renderer_chooser | GlyphRendererChooser to use to choose how to render the glyphs. |
Definition at line 1134 of file painter.hpp.
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterGlyphShader & | shader, |
const PainterData & | draw, | ||
const GlyphRun & | glyph_run, | ||
const GlyphRendererChooser & | renderer_chooser | ||
) |
Draw all glyphs from a GlyphRun.
shader | PainterGlyphShader to draw the glyphs |
draw | data for how to draw |
glyph_run | GlyphRun providing glyphs |
renderer_chooser | GlyphRendererChooser to use to choose how to render the glyphs. |
GlyphRenderer fastuidraw::Painter::draw_glyphs | ( | const PainterData & | draw, |
const GlyphRun & | glyph_run, | ||
const GlyphRendererChooser & | renderer_chooser | ||
) |
Draw all glyphs from a GlyphRun. and the data of the passed GlyphRun.
draw | data for how to draw |
glyph_run | GlyphRun providing glyphs |
renderer_chooser | GlyphRendererChooser to use to choose how to render the glyphs. |
|
inline |
Draw glyphs from a GlyphRun.
brush | brush to apply to text |
glyph_run | GlyphRun providing glyphs |
renderer_chooser | GlyphRendererChooser to use to choose how to render the glyphs. |
Definition at line 1180 of file painter.hpp.
c_array<const PainterSurface* const> fastuidraw::Painter::end | ( | void | ) |
Indicate to end drawing with methods of this Painter. Drawing commands sent to 3D hardware are buffered and not sent to hardware until end() is called. Returns the list of surfaces used for offscreen rendering within the begin()/end() pair; these surfaces are -owned- by the Painter and their contents are potentially changed (or even the object destroyed) on the next call to begin(). All draw commands must be between a begin()/end() pair.
void fastuidraw::Painter::end_coverage_buffer | ( | void | ) |
End the current coverage buffer.
void fastuidraw::Painter::end_layer | ( | void | ) |
End the current transparency layer and blit the layer.
void fastuidraw::Painter::fill_convex_polygon | ( | const PainterFillShader & | shader, |
const PainterData & | draw, | ||
c_array< const vec2 > | pts, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a convex polygon using a custom shader.
shader | shader with which to draw the convex polygon |
draw | data for how to draw |
pts | points of the polygon so that neighboring points (modulo pts.size()) are the edges of the polygon. |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
void fastuidraw::Painter::fill_convex_polygon | ( | const PainterData & | draw, |
c_array< const vec2 > | pts, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a convex polygon using the default fill shader.
draw | data for how to draw |
pts | points of the polygon so that neighboring points (modulo pts.size()) are the edges of the polygon. |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
|
inline |
Fill a convex polygon using the default fill shader.
brush | PainterBrush to apply to fill |
pts | points of the polygon so that neighboring points (modulo pts.size()) are the edges of the polygon. |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
Definition at line 1535 of file painter.hpp.
void fastuidraw::Painter::fill_path | ( | const PainterFillShader & | shader, |
const PainterData & | draw, | ||
const FilledPath & | data, | ||
enum fill_rule_t | fill_rule, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a path.
shader | shader with which to fill the attribute data |
draw | data for how to draw |
data | attribute and index data with which to fill a path |
fill_rule | fill rule with which to fill the path |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
void fastuidraw::Painter::fill_path | ( | const PainterFillShader & | shader, |
const PainterData & | draw, | ||
const Path & | path, | ||
enum fill_rule_t | fill_rule, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a path.
shader | shader with which to fill the attribute data |
draw | data for how to draw |
path | to fill |
fill_rule | fill rule with which to fill the path |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
void fastuidraw::Painter::fill_path | ( | const PainterFillShader & | shader, |
const PainterData & | draw, | ||
const FilledPath & | data, | ||
const CustomFillRuleBase & | fill_rule, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a path.
shader | shader with which to fill the attribute data |
draw | data for how to draw |
data | attribute and index data with which to fill a path |
fill_rule | custom fill rule with which to fill the path |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
void fastuidraw::Painter::fill_path | ( | const PainterFillShader & | shader, |
const PainterData & | draw, | ||
const Path & | path, | ||
const CustomFillRuleBase & | fill_rule, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a path.
shader | shader with which to fill the attribute data |
draw | data for how to draw |
path | to fill |
fill_rule | custom fill rule with which to fill the path |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
void fastuidraw::Painter::fill_path | ( | const PainterGlyphShader & | shader, |
const PainterData & | draw, | ||
const ShaderFilledPath & | path, | ||
enum fill_rule_t | fill_rule | ||
) |
Fill a path via ShaderFilledPath
shader | shader with which to draw the ShaderFilledPath |
draw | data for how to draw |
path | ShaderFilledPath to fill |
fill_rule | fill rule to apply to fill |
void fastuidraw::Painter::fill_path | ( | const PainterData & | draw, |
const Path & | path, | ||
enum fill_rule_t | fill_rule, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a path using the default shader to draw the fill.
draw | data for how to draw |
path | path to fill |
fill_rule | fill rule with which to fill the path |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
void fastuidraw::Painter::fill_path | ( | const PainterData & | draw, |
const Path & | path, | ||
const CustomFillRuleBase & | fill_rule, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a path using the default shader to draw the fill.
draw | data for how to draw |
path | path to fill |
fill_rule | custom fill rule with which to fill the path |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
void fastuidraw::Painter::fill_path | ( | const PainterData & | draw, |
const ShaderFilledPath & | path, | ||
enum fill_rule_t | fill_rule | ||
) |
Fill a path via ShaderFilledPath using the default shader to draw the fill.
draw | data for how to draw |
path | ShaderFilledPath to fill |
fill_rule | fill rule to apply to fill |
|
inline |
Fill a path using the default shader to draw the fill. Provided as a conveniance, equivalent to
brush | PainterBrush to apply to fill |
path | path to fill |
fill_rule | fill rule with which to fill the path |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
Definition at line 1477 of file painter.hpp.
|
inline |
Fill a path using the default shader to draw the fill.
brush | PainterBrush to apply to fill |
path | path to fill |
fill_rule | custom fill rule with which to fill the path |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
Definition at line 1494 of file painter.hpp.
void fastuidraw::Painter::fill_rect | ( | const PainterFillShader & | shader, |
const PainterData & | draw, | ||
const Rect & | rect, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a rect using a custom shader.
shader | shader with which to draw the rect |
draw | data for how to draw |
rect | rectangle to fill |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
void fastuidraw::Painter::fill_rect | ( | const PainterData & | draw, |
const Rect & | rect, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a rect using the default fill shader.
draw | data for how to draw |
rect | rectangle to fill |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
|
inline |
Fill a rect using the default fill shader.
brush | PainterBrush to apply to fill |
rect | rectangle to fill |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
Definition at line 1573 of file painter.hpp.
void fastuidraw::Painter::fill_rounded_rect | ( | const PainterFillShader & | shader, |
const PainterData & | draw, | ||
const RoundedRect & | R, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a rounded rect using a fill shader
shader | shader with which to draw the rounded rectangle |
draw | data for how to draw |
R | RoundedRect to draw |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
void fastuidraw::Painter::fill_rounded_rect | ( | const PainterData & | draw, |
const RoundedRect & | R, | ||
bool | apply_shader_anti_aliasing = true |
||
) |
Fill a rounded rect using the default fill shader
draw | data for how to draw |
R | RoundedRect to draw |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
|
inline |
Fill a rounded rect using the default fill shader
brush | brush to apply to filling |
R | RoundedRect to draw |
apply_shader_anti_aliasing | if true, fill with shader based anti-aliasing |
Definition at line 1611 of file painter.hpp.
enum return_code fastuidraw::Painter::flush | ( | const reference_counted_ptr< PainterSurface > & | new_surface | ) |
Flushes the rendering and flushes the rendering commands to the 3D API and shift to using a the passed surface; the surface's viewport dimensions MUST match the current surface's viewport dimensions, i.e. the value of PainterSurface::viewport().m_dimensions surface() and the passed PainterSurface must match. It is not possible if the Painter is within a begin_layer()/end_layer() pair or if it is within a begin_coverage_buffer()/end_coverage_buffer() pair. Returns routine_success if flush was executed and routine_fail if not.
enum return_code fastuidraw::Painter::flush | ( | void | ) |
Flushes the rendering and flushes the rendering commands to the 3D API and maintain using the current PainterSurface. It is not possible to flush if the Painter is within a begin_layer()/end_layer() pair or if it is within a begin_coverage_buffer()/end_coverage_buffer() pair. Returns routine_success if flush was executed and routine_fail if not.
GlyphAtlas& fastuidraw::Painter::glyph_atlas | ( | void | ) | const |
Returns a reference to the GlyphAtlas of this Painter. All glyphs used by this Painter must live on glyph_atlas().
GlyphCache& fastuidraw::Painter::glyph_cache | ( | void | ) | const |
Returns a handle to the GlyphCache made from glyph_atlas().
ImageAtlas& fastuidraw::Painter::image_atlas | ( | void | ) | const |
Returns a reference to the ImageAtlas of of this Painter. All images used by this Painter must live on image_atlas().
|
static |
Returns the number of stats the Painter type supports.
PainterPackedValuePool& fastuidraw::Painter::packed_value_pool | ( | void | ) |
Returns the PainterPackedValuePool used to construct PainterPackedValue objects.
PainterShaderRegistrar& fastuidraw::Painter::painter_shader_registrar | ( | void | ) | const |
Returns the PainterShaderRegistrar of the PainterBackend used by this Painter object. Use this return value to add custom shaders. NOTE: shaders added within a thread are not useable within that thread until the next call to begin().
unsigned int fastuidraw::Painter::query_stat | ( | enum query_stats_t | st | ) | const |
Returns a stat on how much data the Packer has handled in the last begin()/end() pair. Calling query_stat() within a begin()/end() pair gives unreliable results.
st | stat to query |
void fastuidraw::Painter::query_stats | ( | c_array< unsigned int > | dst | ) | const |
Write into a c_array<> all the stats from the last begin()/end() pair. The number of stats can be fetched with number_stats(). The values written into are indexed by query_stats_t. Calling query_stats() within a begin()/end() pair gives unreliable results.
void fastuidraw::Painter::queue_action | ( | const reference_counted_ptr< const PainterDrawBreakAction > & | action | ) |
Queue an action that uses (or affects) the GPU. Through these actions, one can mix FastUIDraw::Painter with native API calls on a surface. However, adding an action induces a draw-break (and state restore) after each such action. Also, the action is not called until end() is called.
action | action to execute within a draw-stream. |
void fastuidraw::Painter::restore | ( | void | ) |
void fastuidraw::Painter::rotate | ( | float | angle | ) |
Concats the current transformation matrix with a rotation.
angle | angle by which to rotate in radians. |
void fastuidraw::Painter::save | ( | void | ) |
Save the current state of this Painter onto the save state stack. The state is restored (and the stack popped) by called restore(). The state saved is:
void fastuidraw::Painter::scale | ( | float | s | ) |
Concats the current transformation matrix with a scaleing.
s | scaling factor by which to scale |
unsigned int fastuidraw::Painter::select_subsets | ( | const FilledPath & | path, |
c_array< unsigned int > | dst | ||
) |
Calls FilledPath::select_subsets() passing arguments derived from the current state of the Painter.
path | FilledPath from which to compute subset selection | |
[out] | dst | location to which to write the FilledPath::Subset ID values |
void fastuidraw::Painter::select_subsets | ( | const PartitionedTessellatedPath & | path, |
c_array< const float > | geometry_inflation, | ||
bool | select_miter_joins, | ||
fastuidraw::PartitionedTessellatedPath::SubsetSelection & | dst, | ||
NormalizedCoordRect * | nrect | ||
) |
Calls PartitionedTessellatedPath::select_subsets() passing arguments derived from the current state of the Painter.
path | PartitionedTessellatedPath from which to compute subset selection | |
geometry_inflation | amount path geometry is inflated, array is indexed by the enumeration PathEnums::path_geometry_inflation_index_t | |
select_miter_joins | if true, when selecting what joins are in the area, enlarge the join footprint for if the joins are stroked as a type of miter join. | |
[out] | dst | location to which to write the selection |
[out] | nrect | if non-null, location to which to write the bounding box of the selection. NOTE: if the selection is empty, then the value writen will be an empty-rect point at (0, 0). |
void fastuidraw::Painter::shear | ( | float | sx, |
float | sy | ||
) |
Concats the current transformation matrix with a shear.
sx | scaling factor in x-direction to apply |
sy | scaling factor in y-direction to apply |
void fastuidraw::Painter::stroke_dashed_path | ( | const PainterDashedStrokeShaderSet & | shader, |
const PainterData & | draw, | ||
const Path & | path, | ||
const StrokingStyle & | stroke_style = StrokingStyle() , |
||
bool | apply_shader_anti_aliasing = true , |
||
enum stroking_method_t | stroking_method = stroking_method_fastest , |
||
const PathEffect * | effect = nullptr |
||
) |
Stroke a path dashed.
shader | shader with which to draw |
draw | data for how to draw |
path | Path to stroke |
stroke_style | how to stroke the path |
apply_shader_anti_aliasing | if true, stroke with shader-based anti-aliasing |
stroking_method | stroking method to use |
effect | if non-null, apply the given PathEffect on stroking |
void fastuidraw::Painter::stroke_dashed_path | ( | const PainterData & | draw, |
const Path & | path, | ||
const StrokingStyle & | stroke_style = StrokingStyle() , |
||
bool | apply_shader_anti_aliasing = true , |
||
enum stroking_method_t | stroking_method = stroking_method_fastest , |
||
const PathEffect * | effect = nullptr |
||
) |
Stroke a path using PainterShaderSet::dashed_stroke_shader() of default_shaders().
draw | data for how to draw |
path | Path to stroke |
stroke_style | how to stroke the path |
apply_shader_anti_aliasing | if true, stroke with shader-based anti-aliasing |
stroking_method | stroking method to use |
effect | if non-null, apply the given PathEffect on stroking |
|
inline |
Provided as a conveniance, equivalent to
brush | brush to apply to stroking |
stroking_params | stroking parameters to apply to stroking |
path | Path to stroke |
stroke_style | how to stroke the path |
apply_shader_anti_aliasing | if true, stroke with shader-based anti-aliasing |
stroking_method | stroking method to use |
effect | if non-null, apply the given PathEffect on stroking |
Definition at line 1357 of file painter.hpp.
void fastuidraw::Painter::stroke_path | ( | const PainterStrokeShader & | shader, |
const PainterData & | draw, | ||
const Path & | path, | ||
const StrokingStyle & | stroke_style = StrokingStyle() , |
||
bool | apply_shader_anti_aliasing = true , |
||
enum stroking_method_t | stroking_method = stroking_method_fastest , |
||
const PathEffect * | effect = nullptr |
||
) |
Stroke a path.
shader | shader with which to stroke the attribute data |
draw | data for how to draw |
path | Path to stroke |
stroke_style | how to stroke the path |
apply_shader_anti_aliasing | if true, stroke with shader-based anti-aliasing |
stroking_method | stroking method to use |
effect | if non-null, apply the given PathEffect on stroking |
void fastuidraw::Painter::stroke_path | ( | const PainterData & | draw, |
const Path & | path, | ||
const StrokingStyle & | stroke_style = StrokingStyle() , |
||
bool | apply_shader_anti_aliasing = true , |
||
enum stroking_method_t | stroking_method = stroking_method_fastest , |
||
const PathEffect * | effect = nullptr |
||
) |
Stroke a path using PainterShaderSet::stroke_shader() of default_shaders().
draw | data for how to draw |
path | Path to stroke |
stroke_style | how to stroke the path |
apply_shader_anti_aliasing | if true, stroke with shader-based anti-aliasing |
stroking_method | stroking method to use |
effect | if non-null, apply the given PathEffect on stroking |
|
inline |
Provided as a conveniance, equivalent to
brush | brush to apply to stroking |
stroking_params | stroking parameters to apply to stroking |
path | Path to stroke |
stroke_style | how to stroke the path |
apply_shader_anti_aliasing | if true, stroke with shader-based anti-aliasing |
stroking_method | stroking method to use |
effect | if non-null, apply the given PathEffect on stroking |
Definition at line 1296 of file painter.hpp.
const reference_counted_ptr<PainterSurface>& fastuidraw::Painter::surface | ( | void | ) | const |
Returns the PainterSurface to which the Painter is drawing. If there is no active surface, then returns a null reference.
void fastuidraw::Painter::transformation | ( | const float3x3 & | m | ) |
Sets the transformation matrix
m | new value for transformation matrix |
const float3x3& fastuidraw::Painter::transformation | ( | void | ) |
Returns the value of the current transformation.
void fastuidraw::Painter::translate | ( | const vec2 & | p | ) |
Concats the current transformation matrix with a translation
p | translation by which to translate |