2 * Copyright IBM Corporation 1987,1988,1989
6 * Permission to use, copy, modify, and distribute this software and its
7 * documentation for any purpose and without fee is hereby granted,
8 * provided that the above copyright notice appear in all copies and that
9 * both that copyright notice and this permission notice appear in
10 * supporting documentation, and that the name of IBM not be
11 * used in advertising or publicity pertaining to distribution of the
12 * software without specific, written prior permission.
14 * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16 * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
30 #ifdef HAVE_XORG_CONFIG_H
31 #include <xorg-config.h>
41 xf4bppFillArea( pWin
, nboxes
, pBox
, pGC
)
42 register WindowPtr pWin
;
44 register BoxPtr pBox
;
47 register int x
, y
, w
, h
;
49 unsigned long int fg
, bg
, pm
;
52 ppcPrivGC
*pPrivGC
= pGC
->devPrivates
[mfbGetGCPrivateIndex()].ptr
;
54 TRACE( ( "xf4bppFillArea(0x%x,%d,0x%x,0x%x)\n", pWin
, nboxes
, pBox
, pGC
) ) ;
56 if ( ( alu
= pPrivGC
->colorRrop
.alu
) == GXnoop
|| !nboxes
)
59 xSrc
= pGC
->patOrg
.x
+ pWin
->drawable
.x
;
60 ySrc
= pGC
->patOrg
.y
+ pWin
->drawable
.y
;
62 pm
= pPrivGC
->colorRrop
.planemask
;
63 fg
= pPrivGC
->colorRrop
.fgPixel
;
64 bg
= pPrivGC
->colorRrop
.bgPixel
;
67 switch ( pPrivGC
->colorRrop
.fillStyle
) {
69 for ( pPixmap
= pGC
->tile
.pixmap
; --nboxes
; pBox
++ )
70 if ( ( w
= pBox
->x2
- ( x
= pBox
->x1
) )
71 && ( h
= pBox
->y2
- ( y
= pBox
->y1
) ) )
72 xf4bppTileRect( pWin
, pPixmap
, alu
, pm
,
73 x
, y
, w
, h
, xSrc
, ySrc
) ;
75 case FillOpaqueStippled
:
76 for ( pPixmap
= pGC
->stipple
; --nboxes
; pBox
++ )
77 if ( ( w
= pBox
->x2
- ( x
= pBox
->x1
) )
78 && ( h
= pBox
->y2
- ( y
= pBox
->y1
) ) )
79 xf4bppOpaqueStipple( pWin
, pPixmap
, fg
, bg
, alu
, pm
,
80 x
, y
, w
, h
, xSrc
, ySrc
) ;
83 for ( pPixmap
= pGC
->stipple
; --nboxes
; pBox
++ )
84 if ( ( w
= pBox
->x2
- ( x
= pBox
->x1
) )
85 && ( h
= pBox
->y2
- ( y
= pBox
->y1
) ) )
86 xf4bppFillStipple( pWin
, pPixmap
, fg
, alu
, pm
,
87 x
, y
, w
, h
, xSrc
, ySrc
) ;
90 for ( ; --nboxes
; pBox
++ )
91 if ( ( w
= pBox
->x2
- ( x
= pBox
->x1
) )
92 && ( h
= pBox
->y2
- ( y
= pBox
->y1
) ) )
93 xf4bppFillSolid( pWin
, fg
, alu
, pm
, x
, y
, w
, h
) ;