
// CommonStrokeTessellatorInterface.hpp - interface between control and evaluation for polar stroking

#ifndef __CommonStrokeTessellatorInterface_hpp__
#define __CommonStrokeTessellatorInterface_hpp__

#include "CommonStrokeTessellatorPrivate.hpp"

bool StrokeTessellatorMETHOD useHalfSteps() CONST
{
#if HALF_STEPS
    CONST bool use_half_steps = link_state[0] != 0;
    return use_half_steps;
#else
    return false;
#endif
}

StrokeTessellatorMETHOD uint StrokeTessellatorMETHOD Steps() CONST
{
    CONST uint steps = row_columns_orientationBitMask_steps[3];
    return steps;
}

bool StrokeTessellatorMETHOD IsQuadratic() CONST
{
    CONST bool is_quadratic = (link_state[2] != 0);
    return is_quadratic;
}

bool StrokeTessellatorMETHOD IsJoinOrCap() CONST
{
    CONST bool is_join_or_cap = (link_state[1] > 0);
    return is_join_or_cap;
}

StrokeTessellatorMETHOD uint StrokeTessellatorMETHOD OrientationBitMask() CONST
{
    CONST uint orientationBitMask = row_columns_orientationBitMask_steps[2];
    return orientationBitMask;
}

#if ARC_LENGTH_TEXGEN
#define BUFMASK (524288-1)

StrokeTessellatorMETHOD uint StrokeTessellatorMETHOD linkOffsetIndex(uint primitive_id) CONST
{
    CONST uint link_offset_ndx = (path_offset + 2*primitive_id) & BUFMASK;
    return link_offset_ndx;
}
#endif

#endif // __CommonStrokeTessellatorInterface_hpp__
