|
|
1.1 ! root 1: #include "copyright.h" ! 2: ! 3: /* $Header: XDrPoint.c,v 11.8 87/09/11 08:10:07 toddb Exp $ */ ! 4: /* Copyright Massachusetts Institute of Technology 1986 */ ! 5: ! 6: #include "Xlibint.h" ! 7: ! 8: /* precompute the maximum size of batching request allowed */ ! 9: ! 10: static int size = sizeof(xPolyPointReq) + EPERBATCH * sizeof(xPoint); ! 11: ! 12: XDrawPoint(dpy, d, gc, x, y) ! 13: register Display *dpy; ! 14: Drawable d; ! 15: GC gc; ! 16: int x, y; /* INT16 */ ! 17: { ! 18: xPoint *point; ! 19: LockDisplay(dpy); ! 20: FlushGC(dpy, gc); ! 21: { ! 22: register xPolyPointReq *req = (xPolyPointReq *) dpy->last_req; ! 23: /* if same as previous request, with same drawable, batch requests */ ! 24: if ( ! 25: (req->reqType == X_PolyPoint) ! 26: && (req->drawable == d) ! 27: && (req->gc == gc->gid) ! 28: && (req->coordMode == CoordModeOrigin) ! 29: && ((dpy->bufptr + sizeof (xPoint)) <= dpy->bufmax) ! 30: && (((char *)dpy->bufptr - (char *)req) < size) ) { ! 31: point = (xPoint *) dpy->bufptr; ! 32: req->length += sizeof (xPoint) >> 2; ! 33: dpy->bufptr += sizeof (xPoint); ! 34: } ! 35: ! 36: else { ! 37: GetReqExtra(PolyPoint, 4, req); /* 1 point = 4 bytes */ ! 38: req->drawable = d; ! 39: req->gc = gc->gid; ! 40: req->coordMode = CoordModeOrigin; ! 41: point = (xPoint *) (req + 1); ! 42: } ! 43: point->x = x; ! 44: point->y = y; ! 45: } ! 46: UnlockDisplay(dpy); ! 47: SyncHandle(); ! 48: } ! 49:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.