First import
[xorg_rtime.git] / xorg-server-1.4 / hw / xfree86 / xf4bpp / emulRepAre.c
blob20fff1e0c202ea61698d90f714e3755e697cde68
1 /*
2 * Copyright IBM Corporation 1987,1988,1989
4 * All Rights Reserved
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
20 * SOFTWARE.
24 /* ppc Replicate Area -- A Divide & Conquer Algorithm
25 * a "ppc" Helper Function For Stipples And Tiling
26 * P. Shupak 1/88
29 #ifdef HAVE_XORG_CONFIG_H
30 #include <xorg-config.h>
31 #endif
33 #include "xf4bpp.h"
35 void xf4bppReplicateArea( pWin, x, y, planeMask, goalWidth, goalHeight,
36 currentHoriz, currentVert)
37 WindowPtr pWin; /* GJA */
38 register int x, y, planeMask ;
39 int goalWidth, goalHeight ;
40 int currentHoriz, currentVert ;
42 for ( ;
43 currentHoriz <= ( goalWidth >> 1 ) ;
44 currentHoriz <<= 1 ) {
45 xf4bppBitBlt( pWin, GXcopy, planeMask,
46 x, y,
47 x + currentHoriz, y,
48 currentHoriz, currentVert ) ;
50 if ( goalWidth - currentHoriz )
51 xf4bppBitBlt( pWin, GXcopy, planeMask,
52 x, y,
53 x + currentHoriz, y,
54 goalWidth - currentHoriz, currentVert ) ;
55 for ( ;
56 currentVert <= ( goalHeight >> 1 ) ;
57 currentVert <<= 1 ) {
58 xf4bppBitBlt( pWin, GXcopy, planeMask,
59 x, y,
60 x, y + currentVert,
61 goalWidth, currentVert ) ;
63 if ( goalHeight - currentVert )
64 xf4bppBitBlt( pWin, GXcopy, planeMask,
65 x, y,
66 x, y + currentVert,
67 goalWidth, goalHeight - currentVert ) ;
68 return ;