+/**
+ * Calculate fixed position data for a triangle
+ */
+static inline void
+calc_fixed_position( struct lp_setup_context *setup,
+ struct fixed_position* position,
+ const float (*v0)[4],
+ const float (*v1)[4],
+ const float (*v2)[4])
+{
+ position->x[0] = subpixel_snap(v0[0][0] - setup->pixel_offset);
+ position->x[1] = subpixel_snap(v1[0][0] - setup->pixel_offset);
+ position->x[2] = subpixel_snap(v2[0][0] - setup->pixel_offset);
+ position->x[3] = 0;
+
+ position->y[0] = subpixel_snap(v0[0][1] - setup->pixel_offset);
+ position->y[1] = subpixel_snap(v1[0][1] - setup->pixel_offset);
+ position->y[2] = subpixel_snap(v2[0][1] - setup->pixel_offset);
+ position->y[3] = 0;
+
+ position->dx01 = position->x[0] - position->x[1];
+ position->dy01 = position->y[0] - position->y[1];
+
+ position->dx20 = position->x[2] - position->x[0];
+ position->dy20 = position->y[2] - position->y[0];
+
+ position->area = IMUL64(position->dx01, position->dy20) -
+ IMUL64(position->dx20, position->dy01);
+}
+
+
+/**
+ * Rotate a triangle, flipping its clockwise direction,
+ * Swaps values for xy[0] and xy[1]
+ */
+static inline void
+rotate_fixed_position_01( struct fixed_position* position )
+{
+ int x, y;
+
+ x = position->x[1];
+ y = position->y[1];
+ position->x[1] = position->x[0];
+ position->y[1] = position->y[0];
+ position->x[0] = x;
+ position->y[0] = y;
+
+ position->dx01 = -position->dx01;
+ position->dy01 = -position->dy01;
+ position->dx20 = position->x[2] - position->x[0];
+ position->dy20 = position->y[2] - position->y[0];
+
+ position->area = -position->area;
+}
+
+
+/**
+ * Rotate a triangle, flipping its clockwise direction,
+ * Swaps values for xy[1] and xy[2]
+ */
+static inline void
+rotate_fixed_position_12( struct fixed_position* position )