[PATCH 2/3] d2d1: Pass previous and next vectors to d2d_geometry_outline_add_join().

Giovanni Mascellani gio at debian.org
Mon Jan 27 07:09:45 CST 2020


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.
-- 
Giovanni Mascellani <g.mascellani at gmail.com>
Postdoc researcher - Université Libre de Bruxelles

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200127/0b02fdbc/attachment.sig>


More information about the wine-devel mailing list