FastUIDraw
|
An ArcStrokedPoint holds the data for a point of stroking where the segments can be arcs of a circle. The upshot is that a fragment shader will determine per-pixel coverage. In addition, the data is so that changing the stroking width or miter limit does not change the stroking data. More...
#include <arc_stroked_point.hpp>
Public Types | |
enum | offset_type_t { offset_arc_point, offset_line_segment, offset_arc_point_dashed_capper, number_offset_types } |
Enumeration type to specify how to compute the location of an ArcStrokedPoint. More... | |
enum | packed_data_bit_arc_point_dashed_capper { extend_bit = number_common_bits } |
enum | packed_data_bit_layout_common_t { offset_type_bit0 = 0, offset_type_num_bits = 2, boundary_bit = offset_type_bit0 + offset_type_num_bits, end_segment_bit, distance_constant_on_primitive_bit, join_bit, depth_bit0, depth_num_bits = 20, number_common_bits = depth_bit0 + depth_num_bits } |
Enumeration encoding of bits of m_packed_data common to all offset types. More... | |
enum | packed_data_bit_masks_t { offset_type_mask = FASTUIDRAW_MASK(offset_type_bit0, offset_type_num_bits), boundary_mask = FASTUIDRAW_MASK(boundary_bit, 1), beyond_boundary_mask = FASTUIDRAW_MASK(beyond_boundary_bit, 1), inner_stroking_mask = FASTUIDRAW_MASK(inner_stroking_bit, 1), move_to_arc_center_mask = FASTUIDRAW_MASK(move_to_arc_center_bit, 1), end_segment_mask = FASTUIDRAW_MASK(end_segment_bit, 1), distance_constant_on_primitive_mask = FASTUIDRAW_MASK(distance_constant_on_primitive_bit, 1), join_mask = FASTUIDRAW_MASK(join_bit, 1), extend_mask = FASTUIDRAW_MASK(extend_bit, 1), depth_mask = FASTUIDRAW_MASK(depth_bit0, depth_num_bits) } |
Enumeration holding bit masks generated from values in packed_data_bit_layout_common_t. More... | |
enum | packed_data_bit_stroking_boundary_t { beyond_boundary_bit = number_common_bits, inner_stroking_bit, move_to_arc_center_bit } |
Public Member Functions | |
float | arc_angle (void) const |
float & | arc_angle (void) |
uint32_t | depth (void) const |
void | depth (const uint32_t v) |
enum offset_type_t | offset_type (void) const |
void | pack_point (PainterAttribute *dst) const |
float | radius (void) const |
float & | radius (void) |
Static Public Member Functions | |
static enum offset_type_t | offset_type (uint32_t packed_data_value) |
static void | unpack_point (ArcStrokedPoint *dst, const PainterAttribute &src) |
Public Attributes | |
float | m_contour_length |
vec2 | m_data |
float | m_distance_from_contour_start |
float | m_distance_from_edge_start |
float | m_edge_length |
vec2 | m_offset_direction |
uint32_t | m_packed_data |
vec2 | m_position |
An ArcStrokedPoint holds the data for a point of stroking where the segments can be arcs of a circle. The upshot is that a fragment shader will determine per-pixel coverage. In addition, the data is so that changing the stroking width or miter limit does not change the stroking data.
Definition at line 43 of file arc_stroked_point.hpp.
Enumeration type to specify how to compute the location of an ArcStrokedPoint.
Definition at line 51 of file arc_stroked_point.hpp.
Enumeration of the bits of m_packed_data for those with offset type offset_arc_point_dashed_capper
Enumerator | |
---|---|
extend_bit | if up, the point is to be moved in the direction of m_data to cover an induced cap. |
Definition at line 177 of file arc_stroked_point.hpp.
Enumeration encoding of bits of m_packed_data common to all offset types.
Enumerator | |
---|---|
offset_type_bit0 | Bit0 for holding the offset_type() value of the point. |
offset_type_num_bits | number of bits needed to hold the offset_type() value of the point. |
boundary_bit | Bit indicates that the point in on the stroking boundary. Points with this bit down have that the vertex position after stroking is the same as m_position. |
end_segment_bit | Bit indicates that point is on the end of a segment. |
distance_constant_on_primitive_bit | Bit indicates that when doing dashed stroking that the value the distance value is the same for all points of a triangle, i.e. the dashed coverage computation can be done purely from the vertex shader |
join_bit | Bit indicates that the primitive formed is for a join |
depth_bit0 | Bit0 for holding the depth() value of the point |
depth_num_bits | number of bits needed to hold the depth() value of the point. |
number_common_bits | Number of bits used on common packed data |
Definition at line 84 of file arc_stroked_point.hpp.
Enumeration holding bit masks generated from values in packed_data_bit_layout_common_t.
Enumerator | |
---|---|
offset_type_mask | Mask generated for offset_type_bit0 and offset_type_num_bits |
boundary_mask | Mask generated for boundary_bit |
beyond_boundary_mask | Mask generated for boundary_bit |
inner_stroking_mask | Mask generated for inner_stroking_bit |
move_to_arc_center_mask | Mask generated for move_to_arc_center_bit |
end_segment_mask | Mask generated for end_segment_bit |
distance_constant_on_primitive_mask | Mask generated for distance_constant_on_primitive_bit |
join_mask | Mask generated for join_bit |
extend_mask | Mask generated for extend_bit |
depth_mask | Mask generated for depth_bit0 and depth_num_bits |
Definition at line 191 of file arc_stroked_point.hpp.
Enumeration of the bits of m_packed_data for those with offset type offset_arc_point
Definition at line 148 of file arc_stroked_point.hpp.
|
inline |
If a point from an arc-segment, gives the angle of the arc, equivalent to m_data[1].
Definition at line 350 of file arc_stroked_point.hpp.
|
inline |
If a point from an arc-segment, gives the angle of the arc, equivalent to m_data[1].
Definition at line 360 of file arc_stroked_point.hpp.
|
inline |
When stroking the data, the depth test to only pass when the depth value is -strictly- larger so that a fixed pixel is not stroked twice by a single path. The value returned by depth() is a relative z-value for a vertex. The points drawn first have the largest z-values.
Definition at line 374 of file arc_stroked_point.hpp.
|
inline |
Set the value returned by depth().
Definition at line 383 of file arc_stroked_point.hpp.
|
inlinestatic |
Provides the point type from a value of m_packed_data. The return value is one of the enumerations of offset_type_t.
packed_data_value | value suitable for m_packed_data |
Definition at line 308 of file arc_stroked_point.hpp.
|
inline |
Provides the point type for the point. The return value is one of the enumerations of offset_type_t.
Definition at line 320 of file arc_stroked_point.hpp.
void fastuidraw::ArcStrokedPoint::pack_point | ( | PainterAttribute * | dst | ) | const |
Pack the data of this ArcStrokedPoint into a Painter Attribute. The packing is as follows:
dst | PainterAttribute to which to pack |
|
inline |
If a point from an arc-segment, gives the radius of the arc, equivalent to m_data[0].
Definition at line 330 of file arc_stroked_point.hpp.
|
inline |
If a point from an arc-segment, gives the radius of the arc, equivalent to m_data[0].
Definition at line 340 of file arc_stroked_point.hpp.
|
static |
Unpack an ArcStrokedPoint from a Painter Attribute.
dst | point to which to unpack data |
src | PainterAttribute from which to unpack data |
float fastuidraw::ArcStrokedPoint::m_contour_length |
Gives the length of the contour on which the point lies. This value is the same for all points along a fixed contour.
Definition at line 293 of file arc_stroked_point.hpp.
vec2 fastuidraw::ArcStrokedPoint::m_data |
Meaning of m_data depends on offset_type(). If offset_type() is offset_line_segment, then m_data holds the vector from this point to other point of the line segment. Otherwise, m_data[0] holds the radius of the arc and m_data[1] holds the angle difference from the end of the arc to the start of the arc.
Definition at line 267 of file arc_stroked_point.hpp.
float fastuidraw::ArcStrokedPoint::m_distance_from_contour_start |
Gives the distance of the point from the start of the -contour- on which the point resides.
Definition at line 279 of file arc_stroked_point.hpp.
float fastuidraw::ArcStrokedPoint::m_distance_from_edge_start |
Gives the distance of the point from the start of the -edge- on which the point resides.
Definition at line 273 of file arc_stroked_point.hpp.
float fastuidraw::ArcStrokedPoint::m_edge_length |
Gives the length of the edge on which the point lies. This value is the same for all points along a fixed edge.
Definition at line 286 of file arc_stroked_point.hpp.
vec2 fastuidraw::ArcStrokedPoint::m_offset_direction |
Gives the unit vector in which to push the point. For those points that are arc's the location of the center is always given by m_position - radius() * m_offset_direction
Definition at line 256 of file arc_stroked_point.hpp.
uint32_t fastuidraw::ArcStrokedPoint::m_packed_data |
Bit field with data packed.
Definition at line 298 of file arc_stroked_point.hpp.
vec2 fastuidraw::ArcStrokedPoint::m_position |
Give the position of the point on the path.
Definition at line 248 of file arc_stroked_point.hpp.