1264fa531Smrg/*****************************************************************************
2264fa531SmrgCopyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
3264fa531Smrg
4264fa531Smrg                        All Rights Reserved
5264fa531Smrg
6dfac8f13SmrgPermission to use, copy, modify, and distribute this software and its
7dfac8f13Smrgdocumentation for any purpose and without fee is hereby granted,
8264fa531Smrgprovided that the above copyright notice appear in all copies and that
9dfac8f13Smrgboth that copyright notice and this permission notice appear in
10264fa531Smrgsupporting documentation, and that the name of Digital not be
11264fa531Smrgused in advertising or publicity pertaining to distribution of the
12dfac8f13Smrgsoftware without specific, written prior permission.
13264fa531Smrg
14264fa531SmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15264fa531SmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16264fa531SmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17264fa531SmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18264fa531SmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19264fa531SmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20264fa531SmrgSOFTWARE.
21264fa531Smrg
22264fa531Smrg******************************************************************************/
23264fa531Smrg
24264fa531Smrg#ifndef VMS
25264fa531Smrg#include <X11/Xatom.h>
26264fa531Smrg#else
27264fa531Smrg#include <decw$include/Xatom.h>
28264fa531Smrg#endif
29264fa531Smrg#include "x11perf.h"
30264fa531Smrg
31264fa531Smrgstatic Window win[2];
32264fa531Smrg
33dfac8f13Smrgint
34533545b5SmrgInitGC(XParms xp, Parms p, int64_t reps)
35264fa531Smrg{
36264fa531Smrg    win[0] = XCreateSimpleWindow(
37264fa531Smrg	xp->d, xp->w, 10, 10, 10, 10, 1, xp->foreground, xp->background);
38264fa531Smrg    win[1] = XCreateSimpleWindow(
39264fa531Smrg	xp->d, xp->w, 30, 30, 10, 10, 1, xp->foreground, xp->background);
40264fa531Smrg    XMapSubwindows(xp->d, xp->w);
41264fa531Smrg    return reps;
42264fa531Smrg}
43264fa531Smrg
44dfac8f13Smrgvoid
45533545b5SmrgDoChangeGC(XParms xp, Parms p, int64_t reps)
46264fa531Smrg{
47264fa531Smrg    XGCValues   gcv;
48264fa531Smrg
49c9e4df9bSmrg    for (int i = 0; i != reps; i++) {
50264fa531Smrg        gcv.foreground = xp->foreground;
51264fa531Smrg        XChangeGC(xp->d, xp->fggc, GCForeground , &gcv);
52dfac8f13Smrg        XDrawPoint(xp->d, win[0], xp->fggc, 5, 5);
53264fa531Smrg
54264fa531Smrg        gcv.foreground = xp->background;
55264fa531Smrg        XChangeGC(xp->d, xp->fggc, GCForeground , &gcv);
56dfac8f13Smrg        XDrawPoint(xp->d, win[1], xp->fggc, 5, 5);
57264fa531Smrg
58264fa531Smrg        gcv.foreground = xp->background;
59264fa531Smrg        XChangeGC(xp->d, xp->fggc, GCForeground , &gcv);
60dfac8f13Smrg        XDrawPoint(xp->d, win[0], xp->fggc, 5, 5);
61264fa531Smrg
62264fa531Smrg        gcv.foreground = xp->foreground;
63264fa531Smrg        XChangeGC(xp->d, xp->fggc, GCForeground , &gcv);
64dfac8f13Smrg        XDrawPoint(xp->d, win[1], xp->fggc, 5, 5);
65264fa531Smrg	CheckAbort ();
66264fa531Smrg    }
67264fa531Smrg}
68264fa531Smrg
69dfac8f13Smrgvoid
70264fa531SmrgEndGC(XParms xp, Parms p)
71264fa531Smrg{
72264fa531Smrg    XDestroyWindow(xp->d, win[0]);
73264fa531Smrg    XDestroyWindow(xp->d, win[1]);
74264fa531Smrg}
75264fa531Smrg
76