2
* This code is largely copied from fbfill.c.
4
* Copyright © 1998 Keith Packard
5
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
7
* Permission to use, copy, modify, distribute, and sell this software and its
8
* documentation for any purpose is hereby granted without fee, provided that
9
* the above copyright notice appear in all copies and that both that
10
* copyright notice and this permission notice appear in supporting
11
* documentation, and that the name of Keith Packard not be used in
12
* advertising or publicity pertaining to distribution of the software without
13
* specific, written prior permission. Keith Packard makes no
14
* representations about the suitability of this software for any purpose. It
15
* is provided "as is" without express or implied warranty.
17
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
* PERFORMANCE OF THIS SOFTWARE.
25
/* $XFree86: xc/programs/Xserver/fb/fbfill.c,v 1.6 2003/01/31 00:01:45 torrey Exp $ */
27
#ifdef HAVE_DIX_CONFIG_H
28
#include <dix-config.h>
36
rlFill (DrawablePtr pDrawable,
47
FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
49
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
51
switch (pGC->fillStyle) {
53
rlSolid (pDrawable->pScreen,
54
dst + (y + dstYoff) * dstStride,
56
(x + dstXoff) * dstBpp,
58
width * dstBpp, height,
59
pPriv->and, pPriv->xor);
62
case FillOpaqueStippled: {
63
PixmapPtr pStip = pGC->stipple;
64
int stipWidth = pStip->drawable.width;
65
int stipHeight = pStip->drawable.height;
73
int stipXoff, stipYoff; /* XXX assumed to be zero */
75
if (pGC->fillStyle == FillStippled)
76
alu = FbStipple1Rop(pGC->alu,pGC->fgPixel);
78
alu = FbOpaqueStipple1Rop(pGC->alu,pGC->fgPixel,pGC->bgPixel);
79
fbGetDrawable (&pStip->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff);
80
fbTile (dst + (y + dstYoff) * dstStride,
92
(pGC->patOrg.x + pDrawable->x + dstXoff),
93
pGC->patOrg.y + pDrawable->y + dstYoff - y);
100
int stipXoff, stipYoff; /* XXX assumed to be zero */
101
FbBits fgand, fgxor, bgand, bgxor;
105
if (pGC->fillStyle == FillStippled)
107
bgand = fbAnd(GXnoop,(FbBits) 0,FB_ALLONES);
108
bgxor = fbXor(GXnoop,(FbBits) 0,FB_ALLONES);
112
bgand = pPriv->bgand;
113
bgxor = pPriv->bgxor;
116
fbGetStipDrawable (&pStip->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff);
117
fbStipple (dst + (y + dstYoff) * dstStride,
119
(x + dstXoff) * dstBpp,
121
width * dstBpp, height,
129
pGC->patOrg.x + pDrawable->x + dstXoff,
130
pGC->patOrg.y + pDrawable->y + dstYoff - y);
135
PixmapPtr pTile = pGC->tile.pixmap;
141
int tileXoff, tileYoff; /* XXX assumed to be zero */
143
fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff);
144
tileWidth = pTile->drawable.width;
145
tileHeight = pTile->drawable.height;
146
fbTile (dst + (y + dstYoff) * dstStride,
148
(x + dstXoff) * dstBpp,
149
width * dstBpp, height,
157
(pGC->patOrg.x + pDrawable->x + dstXoff) * dstBpp,
158
pGC->patOrg.y + pDrawable->y + dstYoff - y);
162
fbValidateDrawable (pDrawable);
166
rlSolidBoxClipped (DrawablePtr pDrawable,
178
int dstXoff, dstYoff;
181
int partX1, partX2, partY1, partY2;
183
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
185
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
197
if (partX2 <= partX1)
208
if (partY2 <= partY1)
211
rlSolid (pDrawable->pScreen,
212
dst + (partY1 + dstYoff) * dstStride,
214
(partX1 + dstXoff) * dstBpp,
217
(partX2 - partX1) * dstBpp,