FastUIDraw
Classes | Public Member Functions | List of all members
fastuidraw::StrokingAttributeWriter Class Reference

A StrokingAttributeWriter is an implementation of PainterAttributeWriter for the purpose of stroking a path. More...

#include <stroking_attribute_writer.hpp>

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

Classes

class  StrokingMethod
 StrokingMethod specifies how to pack the join and pack values from the source PathEffect::Storage More...
 

Public Member Functions

 StrokingAttributeWriter (void)
 
virtual bool initialize_state (WriteState *state) const override
 
virtual void on_new_store (WriteState *state) const override
 
virtual bool requires_coverage_buffer (void) const override
 
void set_source (const PathEffect::Storage &src, const PainterStrokeShader &shader, const StrokingMethod &method, enum PainterEnums::stroking_method_t tp, enum PainterStrokeShader::shader_type_t aa, bool draw_edges=true)
 
virtual unsigned int state_length (void) const override
 
virtual bool write_data (c_array< PainterAttribute > dst_attribs, c_array< PainterIndex > dst_indices, unsigned int attrib_location, WriteState *state, unsigned int *num_attribs_written, unsigned int *num_indices_written) const override
 

Detailed Description

A StrokingAttributeWriter is an implementation of PainterAttributeWriter for the purpose of stroking a path.

Definition at line 39 of file stroking_attribute_writer.hpp.

Constructor & Destructor Documentation

◆ StrokingAttributeWriter()

fastuidraw::StrokingAttributeWriter::StrokingAttributeWriter ( void  )

Ctor, initializes the StrokingAttributeWriter to stroke nothing.

Member Function Documentation

◆ initialize_state()

virtual bool fastuidraw::StrokingAttributeWriter::initialize_state ( WriteState state) const
overridevirtual

To be implemented by a derived clas to initialize a PainterAttributeWriter::WriteState to indicate the start of writing data for a subsequence calls to write_data(). To return true if there is attribute and index data to upload.

Parameters
statePainterAttributeWriter::WriteState to initialize.

Implements fastuidraw::PainterAttributeWriter.

◆ on_new_store()

virtual void fastuidraw::StrokingAttributeWriter::on_new_store ( WriteState state) const
overridevirtual

To be implemented by a derived class. Called by the caller of a PainterAttributeWriter to indicate that a new data store has been started.

Parameters
statePainterAttributeWriter::WriteState to update

Implements fastuidraw::PainterAttributeWriter.

◆ requires_coverage_buffer()

virtual bool fastuidraw::StrokingAttributeWriter::requires_coverage_buffer ( void  ) const
overridevirtual

To be implemented by a derived class to indicate if the attribute rendering requires a coverage buffer.

Implements fastuidraw::PainterAttributeWriter.

◆ set_source()

void fastuidraw::StrokingAttributeWriter::set_source ( const PathEffect::Storage src,
const PainterStrokeShader shader,
const StrokingMethod method,
enum PainterEnums::stroking_method_t  tp,
enum PainterStrokeShader::shader_type_t  aa,
bool  draw_edges = true 
)

Change the StrokingAttributeWriter to stroke the results of a PathEffect

Parameters
srcthe results of a PathEffect. The object given must stay in scope and its contents remain unchanged until the next call to set_source().
shaderwhat PainterStrokeShader to use
methodspeficies how caps and joins are realized
tpdetermines if linear or arc-stroking are used
aadetermines if anti-alias shading is applied
draw_edgesif false, do not stroke the edges, i.e. only stroke the caps and joins.

◆ state_length()

virtual unsigned int fastuidraw::StrokingAttributeWriter::state_length ( void  ) const
overridevirtual

To be implemented by a derived class to return how large the array PainterAttributeWriter::WriteState::m_state should be.

Implements fastuidraw::PainterAttributeWriter.

◆ write_data()

virtual bool fastuidraw::StrokingAttributeWriter::write_data ( c_array< PainterAttribute dst_attribs,
c_array< PainterIndex dst_indices,
unsigned int  attrib_location,
WriteState state,
unsigned int *  num_attribs_written,
unsigned int *  num_indices_written 
) const
overridevirtual

To be implemented by a derived class to write attribute and index data. Returns true if there is further attribute and index data to upload.

Parameters
dst_attribslocation to which to write attributes. The size of the array is guaranteed by the caller to be atleast the value of WriteState::m_min_attributes_for_next.
dst_indiceslocation to which to write indices. The size of the array is guaranteed by the caller to be atleast the value of WriteState::m_min_indices_for_next.
attrib_locationindex value of the attribute at dst_attribs[0].
statethe write state of the session which is to be updated for the next call to write_data().
num_attribs_writtenlocation to which to write the number of attributes written by the call to write_data().
num_indices_writtenlocation to which to write the number of indices written by the call to write_data().

Implements fastuidraw::PainterAttributeWriter.


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