FastUIDraw
Classes | Public Member Functions | List of all members
fastuidraw::PainterAttributeWriter Class Referenceabstract

Provides an interface to write attribute and index data when a simple copy of data from c_array objects is not sufficient. More...

#include <painter_attribute_writer.hpp>

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

Classes

class  WriteState
 

Public Member Functions

virtual bool initialize_state (WriteState *state) const =0
 
virtual void on_new_store (WriteState *state) const =0
 
virtual bool requires_coverage_buffer (void) const =0
 
virtual unsigned int state_length (void) const =0
 
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 =0
 

Detailed Description

Provides an interface to write attribute and index data when a simple copy of data from c_array objects is not sufficient.

A PainterAttributeWriter is to be stateless. However, in order to be able to successfully write multiple chunks of attributes and indices, a PainterAttributeWriter is given a "cookie" (see WriteState) which represents how far along streaming it is.

Definition at line 47 of file painter_attribute_writer.hpp.

Member Function Documentation

◆ initialize_state()

virtual bool fastuidraw::PainterAttributeWriter::initialize_state ( WriteState state) const
pure virtual

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.

Implemented in fastuidraw::StrokingAttributeWriter.

◆ on_new_store()

virtual void fastuidraw::PainterAttributeWriter::on_new_store ( WriteState state) const
pure virtual

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

Implemented in fastuidraw::StrokingAttributeWriter.

◆ requires_coverage_buffer()

virtual bool fastuidraw::PainterAttributeWriter::requires_coverage_buffer ( void  ) const
pure virtual

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

Implemented in fastuidraw::StrokingAttributeWriter.

◆ state_length()

virtual unsigned int fastuidraw::PainterAttributeWriter::state_length ( void  ) const
pure virtual

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

Implemented in fastuidraw::StrokingAttributeWriter.

◆ write_data()

virtual bool fastuidraw::PainterAttributeWriter::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
pure virtual

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

Implemented in fastuidraw::StrokingAttributeWriter.


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