home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
x
/
x11p-13.zip
/
RCS
/
do_dots.c,v
< prev
next >
Wrap
Text File
|
1989-12-07
|
5KB
|
273 lines
head 2.4;
access ;
symbols pre-merge:2.0;
locks ; strict;
comment @ * @;
2.4
date 89.12.07.16.34.10; author joel; state Exp;
branches ;
next 2.3;
2.3
date 89.11.20.13.23.49; author joel; state Exp;
branches ;
next 2.2;
2.2
date 89.05.11.16.44.18; author joel; state Exp;
branches ;
next 2.1;
2.1
date 89.05.03.14.17.33; author joel; state Exp;
branches ;
next 2.0;
2.0
date 89.01.31.17.04.53; author erik; state Exp;
branches ;
next 1.2;
1.2
date 89.01.31.17.04.53; author joel; state Exp;
branches ;
next 1.1;
1.1
date 88.06.10.13.34.26; author joel; state Exp;
branches ;
next ;
desc
@@
2.4
log
@Changed interface to p->reps
@
text
@/*****************************************************************************
Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************************/
#include "x11perf.h"
static XPoint *points;
static GC pgc;
int InitDots(xp, p, reps)
XParms xp;
Parms p;
int reps;
{
int i;
pgc = xp->fggc;
points = (XPoint *)malloc(p->objects * sizeof(XPoint));
for (i = 0; i != p->objects; i++) {
points[i].x = 2 * (i/MAXROWS);
points[i].y = 2 * (i%MAXROWS);
}
return reps;
}
void DoDots(xp, p, reps)
XParms xp;
Parms p;
int reps;
{
int i;
for (i = 0; i != reps; i++) {
XDrawPoints(xp->d, xp->w, pgc, points, p->objects, CoordModeOrigin);
if (pgc == xp->bggc)
pgc = xp->fggc;
else
pgc = xp->bggc;
}
}
void EndDots(xp, p)
XParms xp;
Parms p;
{
free(points);
}
@
2.3
log
@Declare pgc as static, so switch between fggc and bggc happens every time,
not just within one iteration of tests. (Helps make things look better on
slow machines, which may only run 1 iteration.)
@
text
@d29 1
a29 1
Bool InitDots(xp, p)
d32 1
d44 1
a44 1
return True;
d47 1
a47 1
void DoDots(xp, p)
d50 1
d54 1
a54 1
for (i = 0; i != p->reps; i++) {
@
2.2
log
@Parameters to all routines now (xp, p)
MAXROWS used in all routines
Junked most global communication variables
@
text
@d26 2
a27 1
static XPoint *points;
d35 2
a49 1
GC pgc;
a51 1
pgc = xp->fggc;
@
2.1
log
@Massive changes, I'm not going to go into details.
@
text
@d1 23
a26 2
static GC bggc, fggc;
static Window w;
d28 3
a30 3
Bool InitDots(d, p)
Display *d;
Parms p;
d32 1
a32 1
int i, x, y;
a33 1
i = 0;
d35 5
a39 7
for (x = 0; x < COLS; x++)
for (y = 0; y < p->objects/COLS; y++) {
points[i].x = 2*x;
points[i].y = 2*y;
i++;
}
CreatePerfStuff(d, 1, WIDTH, HEIGHT, &w, &bggc, &fggc);
d43 3
a45 3
void DoDots(d, p)
Display *d;
Parms p;
d47 2
a48 2
GC pgc;
int i;
d50 5
a54 6
pgc = bggc;
for (i=0; i < p->reps; i++)
{
XDrawPoints(d, w, pgc, points, p->objects, CoordModeOrigin);
if (pgc == bggc)
pgc = fggc;
d56 1
a56 1
pgc = bggc;
d60 3
a62 3
void EndDots(d, p)
Display *d;
Parms p;
a63 3
XDestroyWindow(d, w);
XFreeGC(d, bggc);
XFreeGC(d, fggc);
@
2.0
log
@version from /usr/src/pmax
@
text
@d7 1
a7 1
void InitDots(d, p)
d22 1
@
1.2
log
@Added -fg -bg capabilities
@
text
@@
1.1
log
@Initial revision
@
text
@d4 1
a4 1
static GC whitegc, blackgc;
d21 1
a21 1
CreatePerfStuff(d, 1, WIDTH, HEIGHT, &w, &whitegc, &blackgc);
d31 1
a31 1
pgc = whitegc;
d35 2
a36 2
if (pgc == whitegc)
pgc = blackgc;
d38 1
a38 1
pgc = whitegc;
d47 2
a48 2
XFreeGC(d, whitegc);
XFreeGC(d, blackgc);
@