1 /*****************************************************************************
2 Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
3 
4                         All Rights Reserved
5 
6 Permission to use, copy, modify, and distribute this software and its
7 documentation for any purpose and without fee is hereby granted,
8 provided that the above copyright notice appear in all copies and that
9 both that copyright notice and this permission notice appear in
10 supporting documentation, and that the name of Digital not be
11 used in advertising or publicity pertaining to distribution of the
12 software without specific, written prior permission.
13 
14 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20 SOFTWARE.
21 
22 ******************************************************************************/
23 
24 #include "x11perf.h"
25 
26 static XPoint   *points;
27 static GC       pgc;
28 
29 int
InitDots(XParms xp,Parms p,int64_t reps)30 InitDots(XParms xp, Parms p, int64_t reps)
31 {
32     int i;
33 
34     pgc = xp->fggc;
35 
36     points = (XPoint *)malloc(p->objects * sizeof(XPoint));
37 
38     for (i = 0; i != p->objects; i++) {
39 	points[i].x = 2 * (i/MAXROWS);
40 	points[i].y = 2 * (i%MAXROWS);
41     }
42     return reps;
43 }
44 
45 void
DoDots(XParms xp,Parms p,int64_t reps)46 DoDots(XParms xp, Parms p, int64_t reps)
47 {
48     int     i;
49 
50     for (i = 0; i != reps; i++) {
51         XDrawPoints(xp->d, xp->w, pgc, points, p->objects, CoordModeOrigin);
52         if (pgc == xp->bggc)
53             pgc = xp->fggc;
54         else
55             pgc = xp->bggc;
56 	CheckAbort ();
57     }
58 }
59 
60 void
EndDots(XParms xp,Parms p)61 EndDots(XParms xp, Parms p)
62 {
63     free(points);
64 }
65 
66