2
* Id: fbfillrect.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
4
* Copyright © 1998 Keith Packard
6
* Permission to use, copy, modify, distribute, and sell this software and its
7
* documentation for any purpose is hereby granted without fee, provided that
8
* the above copyright notice appear in all copies and that both that
9
* copyright notice and this permission notice appear in supporting
10
* documentation, and that the name of Keith Packard not be used in
11
* advertising or publicity pertaining to distribution of the software without
12
* specific, written prior permission. Keith Packard makes no
13
* representations about the suitability of this software for any purpose. It
14
* is provided "as is" without express or implied warranty.
16
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
* PERFORMANCE OF THIS SOFTWARE.
24
/* $XFree86: xc/programs/Xserver/fb/fbfillrect.c,v 1.1 1999/11/19 13:53:43 hohndel Exp $ */
26
#ifdef HAVE_DIX_CONFIG_H
27
#include <dix-config.h>
33
fbPolyFillRect(DrawablePtr pDrawable,
38
RegionPtr pClip = fbGetCompositeClip(pGC);
41
int extentX1, extentX2, extentY1, extentY2;
42
int fullX1, fullX2, fullY1, fullY2;
43
int partX1, partX2, partY1, partY2;
50
pextent = REGION_EXTENTS(pGC->pScreen, pClip);
51
extentX1 = pextent->x1;
52
extentY1 = pextent->y1;
53
extentX2 = pextent->x2;
54
extentY2 = pextent->y2;
57
fullX1 = prect->x + xorg;
58
fullY1 = prect->y + yorg;
59
fullX2 = fullX1 + (int) prect->width;
60
fullY2 = fullY1 + (int) prect->height;
63
if (fullX1 < extentX1)
66
if (fullY1 < extentY1)
69
if (fullX2 > extentX2)
72
if (fullY2 > extentY2)
75
if ((fullX1 >= fullX2) || (fullY1 >= fullY2))
77
n = REGION_NUM_RECTS (pClip);
82
fullX1, fullY1, fullX2-fullX1, fullY2-fullY1);
86
pbox = REGION_RECTS(pClip);
88
* clip the rectangle to each box in the clip region
89
* this is logically equivalent to calling Intersect()
108
if (partX1 < partX2 && partY1 < partY2)
109
fbFill (pDrawable, pGC,
111
partX2 - partX1, partY2 - partY1);