Keith Packard <[email protected]> writes: > This allocates span data for all of the provided arcs and draws the > whole set in one call, rather than doing them one at a time. For > modern hardware, this is a significant performance improvement. > > Signed-off-by: Keith Packard <[email protected]> > --- > mi/mifillarc.c | 98 > ++++++++++++++++++++-------------------------------------- > 1 file changed, 34 insertions(+), 64 deletions(-) > > diff --git a/mi/mifillarc.c b/mi/mifillarc.c > index 337343d..1695121 100644 > --- a/mi/mifillarc.c > +++ b/mi/mifillarc.c
> /* MIPOLYFILLARC -- The public entry for the PolyFillArc request.
> @@ -692,21 +644,39 @@ miPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
> xArc * parcs)
> {
> int i;
> xArc *arc;
> + int nspans = 0;
> + DDXPointPtr pts, points;
> + int *wids, *widths;
> + int n;
> +
> + for (i = narcs, arc = parcs; --i >= 0; arc++)
> + nspans += arc->height;
> +
> + pts = points = malloc (sizeof (DDXPointRec) * nspans + sizeof(int) *
> nspans);
> + if (!points)
> + return;
> + wids = widths = (int *) (points + nspans);
Can you give me some justification of what prevents integer overflow
here?
pgpMdn0nMoB40.pgp
Description: PGP signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
