3 * Copyright © 2002 Keith Packard
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 Keith Packard not be used in
10 * advertising or publicity pertaining to distribution of the software without
11 * specific, written prior permission. Keith Packard makes no
12 * representations about the suitability of this software for any purpose. It
13 * is provided "as is" without express or implied warranty.
15 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
19 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21 * PERFORMANCE OF THIS SOFTWARE.
27 #include "Xrenderint.h"
30 XRenderCompositeTriangles (Display *dpy,
34 _Xconst XRenderPictFormat *maskFormat,
37 _Xconst XTriangle *triangles,
40 XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy);
41 xRenderTrianglesReq *req;
45 RenderSimpleCheckExtension (dpy, info);
49 GetReq(RenderTriangles, req);
50 req->reqType = info->codes->major_opcode;
51 req->renderReqType = X_RenderTriangles;
55 req->maskFormat = maskFormat ? maskFormat->id : 0;
59 len = ((long) n) * (SIZEOF (xTriangle) >> 2);
60 if (!dpy->bigreq_size && len > (dpy->max_request_size - req->length)) {
61 n = (dpy->max_request_size - req->length) / (SIZEOF (xTriangle) >> 2);
62 len = ((long)n) * (SIZEOF (xTriangle) >> 2);
64 SetReqLen (req, len, len);
66 DataInt32 (dpy, (int *) triangles, len);
75 XRenderCompositeTriStrip (Display *dpy,
79 _Xconst XRenderPictFormat *maskFormat,
82 _Xconst XPointFixed *points,
85 XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy);
86 xRenderTriStripReq *req;
90 RenderSimpleCheckExtension (dpy, info);
94 GetReq(RenderTriStrip, req);
95 req->reqType = info->codes->major_opcode;
96 req->renderReqType = X_RenderTriStrip;
100 req->maskFormat = maskFormat ? maskFormat->id : 0;
104 len = ((long) n) * (SIZEOF (xPointFixed) >> 2);
105 if (!dpy->bigreq_size && len > (dpy->max_request_size - req->length)) {
106 n = (dpy->max_request_size - req->length) / (SIZEOF (xPointFixed) >> 2);
107 len = ((long)n) * (SIZEOF (xPointFixed) >> 2);
109 SetReqLen (req, len, len);
111 DataInt32 (dpy, (int *) points, len);
120 XRenderCompositeTriFan (Display *dpy,
124 _Xconst XRenderPictFormat *maskFormat,
127 _Xconst XPointFixed *points,
130 XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy);
131 _Xconst XPointFixed *first = points;
133 xRenderTriFanReq *req;
137 RenderSimpleCheckExtension (dpy, info);
143 GetReqExtra(RenderTriFan, SIZEOF (xPointFixed), req);
144 req->reqType = info->codes->major_opcode;
145 req->renderReqType = X_RenderTriFan;
146 req->op = (CARD8) op;
149 req->maskFormat = maskFormat ? maskFormat->id : 0;
152 p = (xPointFixed *) (req + 1);
156 len = ((long) n) * (SIZEOF (xPointFixed) >> 2);
157 if (!dpy->bigreq_size && len > (dpy->max_request_size - req->length)) {
158 n = (dpy->max_request_size - req->length) / (SIZEOF (xPointFixed) >> 2);
159 len = ((long)n) * (SIZEOF (xPointFixed) >> 2);
161 SetReqLen (req, len, len);
163 DataInt32 (dpy, (int *) points, len);