3 * Copyright © 2000 SuSE, Inc.
5 * Permission to use, copy, modify, distribute, and sell this software and its
6 * documentation for any purpose is hereby granted without fee, provided that
7 * the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of SuSE not be used in advertising or
10 * publicity pertaining to distribution of the software without specific,
11 * written prior permission. SuSE makes no representations about the
12 * suitability of this software for any purpose. It is provided "as is"
13 * without express or implied warranty.
15 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
17 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 * Author: Keith Packard, SuSE, Inc.
28 #include "Xrenderint.h"
30 /* precompute the maximum size of batching request allowed */
32 #define size (SIZEOF(xRenderFillRectanglesReq) + FRCTSPERBATCH * SIZEOF(xRectangle))
35 XRenderFillRectangles (Display *dpy,
38 _Xconst XRenderColor *color,
39 _Xconst XRectangle *rectangles,
42 XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy);
43 xRenderFillRectanglesReq *req;
47 RenderSimpleCheckExtension (dpy, info);
52 GetReq(RenderFillRectangles, req);
54 req->reqType = info->codes->major_opcode;
55 req->renderReqType = X_RenderFillRectangles;
58 req->color.red = color->red;
59 req->color.green = color->green;
60 req->color.blue = color->blue;
61 req->color.alpha = color->alpha;
65 if (!dpy->bigreq_size && len > (dpy->max_request_size - req->length))
67 n = (dpy->max_request_size - req->length) >> 1;
70 SetReqLen(req, len, len);
71 len <<= 2; /* watch out for macros... */
72 Data16 (dpy, (short *) rectangles, len);