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