|
|
1.1 ! root 1: #include "copyright.h" ! 2: ! 3: /* $Header: XDrArc.c,v 11.10 87/09/11 08:09:46 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(xPolyArcReq) + EPERBATCH * sizeof(xArc); ! 11: ! 12: XDrawArc(dpy, d, gc, x, y, width, height, angle1, angle2) ! 13: register Display *dpy; ! 14: Drawable d; ! 15: GC gc; ! 16: int x, y; /* INT16 */ ! 17: unsigned int width, height; /* CARD16 */ ! 18: int angle1, angle2; /* INT16 */ ! 19: { ! 20: xArc *arc; ! 21: ! 22: LockDisplay(dpy); ! 23: /* if same as previous request, with same drawable, batch requests */ ! 24: FlushGC(dpy, gc); ! 25: { ! 26: register xPolyArcReq *req = (xPolyArcReq *) dpy->last_req; ! 27: if ( ! 28: (req->reqType == X_PolyArc) ! 29: && (req->drawable == d) ! 30: && (req->gc == gc->gid) ! 31: && ((dpy->bufptr + sizeof (xArc)) <= dpy->bufmax) ! 32: && (((char *)dpy->bufptr - (char *)req) < size) ) { ! 33: arc = (xArc *) dpy->bufptr; ! 34: req->length += sizeof (xArc) >> 2; ! 35: dpy->bufptr += sizeof (xArc); ! 36: } ! 37: ! 38: else { ! 39: GetReqExtra (PolyArc, sizeof(xArc), req); ! 40: req->drawable = d; ! 41: req->gc = gc->gid; ! 42: arc = (xArc *) (req + 1); ! 43: } ! 44: arc->x = x; ! 45: arc->y = y; ! 46: arc->width = width; ! 47: arc->height = height; ! 48: arc->angle1 = angle1; ! 49: arc->angle2 = angle2; ! 50: } ! 51: UnlockDisplay(dpy); ! 52: SyncHandle(); ! 53: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.