Hi,
Il 27/01/20 13:07, Henri Verbeet ha scritto:
Instead of the points.
Good idea, this should reduce floating point errors.
@@ -2296,11 +2290,21 @@ static BOOL d2d_geometry_add_figure_outline(struct d2d_geometry *geometry, else next = &figure->vertices[i + 1];
if ((figure_end == D2D1_FIGURE_END_CLOSED || (i && i < figure->vertex_count - 1))
&& !d2d_geometry_outline_add_join(geometry, prev, p0, next))
if (figure_end == D2D1_FIGURE_END_CLOSED || (i && i < figure->vertex_count - 1)) {
ERR("Failed to add join.\n");
return FALSE;
D2D1_POINT_2F q_next, q_prev;
d2d_point_subtract(&q_prev, prev, p0);
d2d_point_subtract(&q_next, next, p0);
d2d_point_normalise(&q_prev);
d2d_point_normalise(&q_next);
Why are these normalization necessary? Vectors prev and next will be normalized again in the shader (and they have to, because the transformation matrix is not necessarily orthogonal), so normalization could be skipped here.
if (!d2d_geometry_outline_add_join(geometry, &q_prev, p0, &q_next))
{
ERR("Failed to add join.\n");
return FALSE;
} } if (type == D2D_VERTEX_TYPE_LINE && (figure_end == D2D1_FIGURE_END_CLOSED || i < figure->vertex_count - 1)
Thanks, Giovanni.