[PATCH 2/3] d2d1: Pass previous and next vectors to d2d_geometry_outline_add_join().
Henri Verbeet
hverbeet at gmail.com
Mon Jan 27 07:51:54 CST 2020
On Mon, 27 Jan 2020 at 16:40, Giovanni Mascellani <gio at debian.org> wrote:
> > @@ -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.
>
They may not be necessary. They're mostly there because
d2d_geometry_outline_add_join() originally had them. I think that in
turn was mostly a leftover from when d2d_geometry_outline_add_join()
(incorrectly) used d2d_point_dot() instead of d2d_point_ccw(). Note
that the "prev" and "next" vectors are also used for vertex positions
in the "ccw == 0.0f" case though. In any case, it would probably be
best to do a potential removal in a separate follow-up patch.
More information about the wine-devel
mailing list