Lines Matching refs:VGfloat
48 static const VGfloat curve_threshold = 0.25f;
50 static const VGfloat zero_coords[] = {0.f, 0.f};
71 void (*current_coords)(struct stroke_iterator *it, VGfloat *coords);
77 const VGfloat *coords;
90 static void stroke_itr_coords(struct stroke_iterator *itr, VGfloat *coords)
95 static void stroke_fw_itr_coords(struct stroke_iterator *itr, VGfloat *coords)
122 static void stroke_bw_itr_coords(struct stroke_iterator *itr, VGfloat *coords)
203 itr->coords = (VGfloat*)coords->data;
264 VGfloat bez[8];
305 static void stroke_flat_itr_coords(struct stroke_iterator *itr, VGfloat *coords)
348 static INLINE VGboolean finite_coords4(const VGfloat *c)
357 static VGboolean do_lines_intersect(VGfloat x1, VGfloat y1, VGfloat x2, VGfloat y2,
358 VGfloat x3, VGfloat y3, VGfloat x4, VGfloat y4)
360 VGfloat a1, a2, b1, b2, c1, c2; /* Coefficients of line eqns */
361 VGfloat r1, r2, r3, r4; /* 'sign' values */
386 static INLINE VGfloat line_dx(const VGfloat *l)
391 static INLINE VGfloat line_dy(const VGfloat *l)
396 static INLINE VGfloat line_angle(const VGfloat *l)
398 const VGfloat dx = line_dx(l);
399 const VGfloat dy = line_dy(l);
401 const VGfloat theta = atan2(-dy, dx) * 360.0 / M_2PI;
403 const VGfloat theta_normalized = theta < 0 ? theta + 360 : theta;
411 static INLINE void line_set_length(VGfloat *l, VGfloat len)
413 VGfloat uv[] = {l[0], l[1], l[2], l[3]};
421 static INLINE void line_translate(VGfloat *l, VGfloat x, VGfloat y)
429 static INLINE VGfloat line_angle_to(const VGfloat *l1,
430 const VGfloat *l2)
432 VGfloat a1, a2, delta, delta_normalized;
448 static INLINE VGfloat line_angles(const VGfloat *l1,
449 const VGfloat *l2)
451 VGfloat cos_line, rad = 0;
466 static INLINE VGfloat adapted_angle_on_x(const VGfloat *line)
468 const VGfloat identity[] = {0, 0, 1, 0};
469 VGfloat angle = line_angles(line, identity);
475 static enum intersection_type line_intersect(const VGfloat *l1,
476 const VGfloat *l2,
479 VGfloat isect[2] = { 0 };
497 VGfloat la = line_dy(l2) / line_dx(l2);
501 VGfloat ta = line_dy(l1) / line_dx(l1);
505 VGfloat x;
506 VGfloat ta = line_dy(l1) / line_dx(l1);
507 VGfloat la = line_dy(l2) / line_dx(l2);
550 void stroker_emit_move_to(struct stroker *stroker, VGfloat x, VGfloat y)
553 VGfloat coords[2] = {x, y};
567 void stroker_emit_line_to(struct stroker *stroker, VGfloat x, VGfloat y)
570 VGfloat coords[2] = {x, y};
583 void stroker_emit_curve_to(struct stroker *stroker, VGfloat px1, VGfloat py1,
584 VGfloat px2, VGfloat py2,
585 VGfloat x, VGfloat y)
588 VGfloat coords[6] = {px1, py1, px2, py2, x, y};
615 VGfloat x1, VGfloat y1,
616 VGfloat x2, VGfloat y2,
617 VGfloat width, VGfloat height)
633 VGfloat focal_x, VGfloat focal_y,
634 const VGfloat *next_line, enum line_join_mode join)
649 VGfloat prev_line[] = {stroker->back2_x, stroker->back2_y,
652 VGfloat isect[2] = { 0 };
656 VGfloat offset = stroker->stroke_width / 2;
657 VGfloat l1[4] = {prev_line[0],
661 VGfloat l2[4] = {next_line[2],
676 VGfloat offset = stroker->stroke_width / 2;
677 VGfloat short_cut[4] = {prev_line[2], prev_line[3],
679 VGfloat angle = line_angles(prev_line, short_cut);
692 VGfloat offset = stroker->stroke_width / 2;
693 VGfloat l1[4] = { prev_line[0], prev_line[1],
695 VGfloat l2[4] = {focal_x, focal_y,
721 VGfloat miter_line[4] = {stroker->back1_x, stroker->back1_y,
723 VGfloat sl = (stroker->stroke_width * stroker->miter_limit);
724 VGfloat inside_line[4] = {prev_line[2], prev_line[3],
726 VGfloat angle = line_angle_to(inside_line, prev_line);
752 const VGfloat *coords,
758 VGfloat *data = stroker->control_points->data;
786 VGfloat *data = stroker->control_points->data;
798 void stroker_move_to(struct stroker *stroker, VGfloat x, VGfloat y)
800 VGfloat coords[2] = {x, y};
814 void stroker_line_to(struct stroker *stroker, VGfloat x, VGfloat y)
816 VGfloat coords[] = {x, y};
827 void stroker_curve_to(struct stroker *stroker, VGfloat px1, VGfloat py1,
828 VGfloat px2, VGfloat py2,
829 VGfloat x, VGfloat y)
831 VGfloat coords[] = {px1, py1,
845 VGfloat *coords,
846 VGfloat *res)
871 VGfloat *start_tangent)
876 VGfloat start[2], prev[2];
878 VGfloat offset;
906 VGfloat coords[8];
913 VGfloat line[4] = {prev[0], prev[1], coords[0], coords[1]};
914 VGfloat normal[4];
931 sizeof(VGfloat) * 4);
963 VGfloat tangent[4];
971 VGfloat pt[2] = {offset_curves[0].x1,
1026 VGfloat fw_start_tangent[4], bw_start_tangent[4];
1032 sizeof(VGfloat)*4);
1034 sizeof(VGfloat)*4);
1056 VGfloat data[8], coords[8];
1064 memset(data, 0, sizeof(VGfloat) * 8);
1080 VGfloat
1092 VGfloat offset = stroker->stroke_width / 2;
1093 VGfloat cx = data[0], cy = data[1];
1116 static INLINE VGfloat dash_pattern(struct dash_stroker *stroker,
1127 VGfloat sum_length = 0;
1130 VGfloat pos = 0;
1131 VGfloat elen = 0;
1132 VGfloat doffset = stroker->dash_phase;
1133 VGfloat estart = 0;
1134 VGfloat estop = 0;
1135 VGfloat cline[4];
1137 VGfloat prev[2];
1138 VGfloat move_to_pos[2];
1139 VGfloat line_to_pos[2];
1169 VGfloat coords[8];
1188 VGfloat p2[2];
1192 VGfloat dpos = pos + dash_pattern(stroker, idash) - doffset - estart;
1284 stroker->control_points = array_create(sizeof(VGfloat));