FastUIDraw
|
A StrokedPoint holds the data for a point of stroking where all segments are line segments (coming from curve tessellation). The upshot is that the fragment shader does NOT perform any coverage computation for non-dashed stroking. In addition, the data is so that changing the stroking width or miter limit does not change the stroking data. More...
#include <stroked_point.hpp>
Public Types | |
enum | offset_type_t { offset_sub_edge, offset_shared_with_edge, offset_rounded_join, offset_miter_clip_join, offset_miter_bevel_join, offset_miter_join, offset_rounded_cap, offset_square_cap, offset_adjustable_cap, offset_flat_cap, number_offset_types } |
Enumeration for specifing the point type which in turn determines the meaning of the fields m_pre_offset and m_auxiliary_offset. More... | |
enum | packed_data_bit_adjustable_cap_t { adjustable_cap_ending_bit = number_common_bits, adjustable_cap_is_end_contour_bit } |
Enumeration encoding of bits of m_packed_data for those with offset type offset_adjustable_cap. More... | |
enum | packed_data_bit_flat_cap_t { flat_cap_ending_bit = number_common_bits, flat_cap_is_end_contour_bit } |
Enumeration encoding of bits of m_packed_data for those with offset type offset_flat_cap. More... | |
enum | packed_data_bit_layout_common_t { offset_type_bit0 = 0, offset_type_num_bits = 4, boundary_bit = offset_type_bit0 + offset_type_num_bits, depth_bit0, depth_num_bits = 20, join_bit = depth_bit0 + depth_num_bits, number_common_bits } |
Enumeration encoding of bits of m_packed_data common to all offset types. More... | |
enum | packed_data_bit_layout_miter_join_t { lambda_negated_bit = number_common_bits } |
Enumeration encoding of bits of m_packed_data for those with offset type offset_miter_clip_join. More... | |
enum | packed_data_bit_layout_rounded_join_t { normal0_y_sign_bit = number_common_bits, normal1_y_sign_bit, sin_sign_bit } |
Enumeration encoding of bits of m_packed_data for those with offset type offset_rounded_join. 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), depth_mask = FASTUIDRAW_MASK(depth_bit0, depth_num_bits), end_sub_edge_mask = FASTUIDRAW_MASK(end_sub_edge_bit, 1), bevel_edge_mask = FASTUIDRAW_MASK(bevel_edge_bit, 1), normal0_y_sign_mask = FASTUIDRAW_MASK(normal0_y_sign_bit, 1), normal1_y_sign_mask = FASTUIDRAW_MASK(normal1_y_sign_bit, 1), sin_sign_mask = FASTUIDRAW_MASK(sin_sign_bit, 1), lambda_negated_mask = FASTUIDRAW_MASK(lambda_negated_bit, 1), join_mask = FASTUIDRAW_MASK(join_bit, 1), adjustable_cap_ending_mask = FASTUIDRAW_MASK(adjustable_cap_ending_bit, 1), adjustable_cap_is_end_contour_mask = FASTUIDRAW_MASK(adjustable_cap_is_end_contour_bit, 1), flat_cap_ending_mask = FASTUIDRAW_MASK(flat_cap_ending_bit, 1), flat_cap_is_end_contour_mask = FASTUIDRAW_MASK(flat_cap_is_end_contour_bit, 1) } |
Enumeration holding bit masks. More... | |
enum | packed_data_bit_sub_edge_t { end_sub_edge_bit = number_common_bits, bevel_edge_bit } |
Enumeration encoding of bits of m_packed_data for those with offset type offset_sub_edge. More... | |
Public Member Functions | |
uint32_t | depth (void) const |
void | depth (const uint32_t v) |
enum offset_type_t | offset_type (void) const |
int | on_boundary (void) const |
void | pack_point (PainterAttribute *dst) const |
Static Public Member Functions | |
static enum offset_type_t | offset_type (uint32_t packed_data_value) |
static void | unpack_point (StrokedPoint *dst, const PainterAttribute &src) |
Public Attributes | |
vec2 | m_auxiliary_offset |
float | m_contour_length |
float | m_distance_from_contour_start |
float | m_distance_from_edge_start |
float | m_edge_length |
uint32_t | m_packed_data |
vec2 | m_position |
vec2 | m_pre_offset |
A StrokedPoint holds the data for a point of stroking where all segments are line segments (coming from curve tessellation). The upshot is that the fragment shader does NOT perform any coverage computation for non-dashed stroking. In addition, the data is so that changing the stroking width or miter limit does not change the stroking data.
Definition at line 46 of file stroked_point.hpp.
Enumeration for specifing the point type which in turn determines the meaning of the fields m_pre_offset and m_auxiliary_offset.
Enumerator | |
---|---|
offset_sub_edge | The point is for an edge of the path, point signifies the start or end of a sub-edge (quad) of drawing an edge. The meanings of m_pre_offset and m_auxiliary_offset are:
|
offset_shared_with_edge | The point is at a position that has the same value as point on an edge but the point itself is part of a cap or join. The meanings of the members m_pre_offset and m_auxiliary_offset are:
|
offset_rounded_join | The point is for a boundary point of a rounded join of the path. The meanings of the members m_pre_offset and and m_auxiliary_offset are:
|
offset_miter_clip_join | Point type for miter-clip join point whose position depends on the stroking radius and the miter-limit. The meanings of m_pre_offset and m_auxiliary_offset are:
|
offset_miter_bevel_join | Point type for miter-bevel join point whose position depends on the stroking radius and the miter-limit. The meanings of m_pre_offset and m_auxiliary_offset are:
|
offset_miter_join | Point type for miter join whose position position depends on the stroking radius and the miter-limit. The meanings of m_pre_offset and m_auxiliary_offset are:
|
offset_rounded_cap | The point is for a boundary point of a rounded cap of the path. The meanings of m_pre_offset and m_auxiliary_offset are:
|
offset_square_cap | The point is for a boundary point of a square cap of the path, the meanings of m_pre_offset and m_auxiliary_offset are:
|
offset_adjustable_cap | The point is a point of an adjustable cap. These points are for dashed stroking with caps; they contain data to allow one from a vertex shader to extend or shrink the cap area correctly to implement dashed stroking. The meanings of m_pre_offset and m_auxiliary_offset are:
|
offset_flat_cap | The point is a point of a flat cap. These points are for doing anti-aliasing at the starting and ending of an open contour. The meanings of m_pre_offset and m_auxiliary_offset are:
|
number_offset_types | Number different point types with respect to rendering |
Definition at line 55 of file stroked_point.hpp.
Enumeration encoding of bits of m_packed_data for those with offset type offset_adjustable_cap.
Definition at line 323 of file stroked_point.hpp.
Enumeration encoding of bits of m_packed_data for those with offset type offset_flat_cap.
Definition at line 344 of file 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 for holding boundary() value of the point |
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. |
join_bit | Bit to indicate point is from a join. For these points, during dashed stroking. For joins, one is guaranteed that the distance values for all points of a fixed join are the same. |
number_common_bits | Number of bits used on common packed data |
Definition at line 207 of file stroked_point.hpp.
Enumeration encoding of bits of m_packed_data for those with offset type offset_miter_clip_join.
Enumerator | |
---|---|
lambda_negated_bit | Indicates that the lambda of the miter-join computation should be negated. |
Definition at line 309 of file stroked_point.hpp.
Enumeration encoding of bits of m_packed_data for those with offset type offset_rounded_join.
Enumerator | |
---|---|
normal0_y_sign_bit | Bit for holding the the sign of the y-coordinate of the normal 0 for the offset_type() offset_rounded_join. |
normal1_y_sign_bit | Bit for holding the the sign of the y-coordinate of the normal 1 for the offset_type() offset_rounded_join. |
sin_sign_bit | Bit for holding the the sign of sin() value for the offset_type() offset_rounded_join. |
Definition at line 278 of file stroked_point.hpp.
Enumeration holding bit masks.
Enumerator | |
---|---|
offset_type_mask | Mask generated for offset_type_bit0 and offset_type_num_bits |
boundary_mask | Mask generated for boundary_bit |
depth_mask | Mask generated for depth_bit0 and depth_num_bits |
end_sub_edge_mask | Mask generated for end_sub_edge_bit |
bevel_edge_mask | Mask generated for bevel_edge_bit |
normal0_y_sign_mask | Mask generated for normal0_y_sign_bit |
normal1_y_sign_mask | Mask generated for normal1_y_sign_bit |
sin_sign_mask | Mask generated for sin_sign_bit sin_sign_bit |
lambda_negated_mask | Mask generated for lambda_negated_mask |
join_mask | Mask generated for join_bit |
adjustable_cap_ending_mask | Mask generated for adjustable_cap_ending_bit |
adjustable_cap_is_end_contour_mask | Mask generated for adjustable_cap_is_end_contour_bit |
flat_cap_ending_mask | Mask generated for flat_cap_ending_bit |
flat_cap_is_end_contour_mask | Mask generated for adjustable_cap_is_end_contour_bit |
Definition at line 364 of file stroked_point.hpp.
Enumeration encoding of bits of m_packed_data for those with offset type offset_sub_edge.
Definition at line 257 of file 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 531 of file stroked_point.hpp.
|
inline |
Set the value returned by depth().
Definition at line 540 of file 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 517 of file 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 505 of file stroked_point.hpp.
|
inline |
Has value 0 or 1. If the value is 0, then the point is on the path. If the value has value 1, then indicates a point that is on the boundary of the stroked path.
Definition at line 553 of file stroked_point.hpp.
void fastuidraw::StrokedPoint::pack_point | ( | PainterAttribute * | dst | ) | const |
Pack the data of this StrokedPoint into a Painter Attribute. The packing is as follows:
dst | PainterAttribute to which to pack |
|
static |
Unpack a StrokedPoint from a Painter Attribute.
dst | point to which to unpack data |
src | PainterAttribute from which to unpack data |
vec2 fastuidraw::StrokedPoint::m_auxiliary_offset |
Gives values to help compute the location of the point after applying the stroking width. See the descriptions to the elements of offset_type_t for its meaning for different offset types.
Definition at line 458 of file stroked_point.hpp.
float fastuidraw::StrokedPoint::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 484 of file stroked_point.hpp.
float fastuidraw::StrokedPoint::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 470 of file stroked_point.hpp.
float fastuidraw::StrokedPoint::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 464 of file stroked_point.hpp.
float fastuidraw::StrokedPoint::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 477 of file stroked_point.hpp.
uint32_t fastuidraw::StrokedPoint::m_packed_data |
Bit field with data packed as according to packed_data_bit_layout_common_t, packed_data_bit_layout_rounded_join_t, packed_data_bit_adjustable_cap_t and packed_data_bit_sub_edge_t. See also, packed_data_bit_masks_t for bit masks generated.
Definition at line 495 of file stroked_point.hpp.
vec2 fastuidraw::StrokedPoint::m_position |
The base position of a point before applying the stroking width to the position.
Definition at line 442 of file stroked_point.hpp.
vec2 fastuidraw::StrokedPoint::m_pre_offset |
Gives values to help compute the location of the point after applying the stroking width. See the descriptions to the elements of offset_type_t for its meaning for different offset types.
Definition at line 450 of file stroked_point.hpp.