Keith Packard <[email protected]> writes:

> Drawing all of the spans in one driver call is a considerable
> performance improvement, which we can do unless the arcs are
> double-dashed, in which case overlapping dashes should draw the latter
> arc contents.
>
> Signed-off-by: Keith Packard <[email protected]>
> ---
>  mi/mizerarc.c | 40 ++++++++++++++++++++++++++++++++++------
>  1 file changed, 34 insertions(+), 6 deletions(-)
>
> diff --git a/mi/mizerarc.c b/mi/mizerarc.c
> index 9dac180..e39cd82 100644
> --- a/mi/mizerarc.c
> +++ b/mi/mizerarc.c
> @@ -653,6 +653,10 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, 
> xArc * parcs)
>      int *widths = NULL;
>      XID fgPixel = pGC->fgPixel;
>      DashInfo dinfo;
> +    Bool gather_points;
> +    int mul_points;
> +    DDXPointPtr points_base;
> +    int *widths_base = NULL;
>  
>      for (arc = parcs, i = narcs; --i >= 0; arc++) {
>          if (!miCanZeroArc(arc))
> @@ -669,9 +673,17 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, 
> xArc * parcs)
>      if (!maxPts)
>          return;
>      numPts = maxPts << 2;
> +
> +    gather_points = FALSE;
> +    mul_points = 1;
> +    if (pGC->lineStyle != LineDoubleDash) {
> +        gather_points = TRUE;
> +        mul_points = narcs;
> +    }
> +
>      dospans = (pGC->fillStyle != FillSolid);
>      if (dospans) {
> -        widths = malloc(sizeof(int) * numPts);
> +        widths_base = widths = malloc(sizeof(int) * numPts * mul_points);

Doesn't this have the an even worse overflow problem (width * height *
narcs) than other patch you fixed up did?

Attachment: pgpsjpmLNfeCq.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

Reply via email to