home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / ppc / emulRepAre.c < prev    next >
C/C++ Source or Header  |  1989-11-14  |  3KB  |  81 lines

  1. /*
  2.  * Copyright IBM Corporation 1987,1988,1989
  3.  *
  4.  * All Rights Reserved
  5.  *
  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.
  13.  *
  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.
  21.  *
  22. */
  23.  
  24. /* $Header: /andrew/X11/R3src/tape/server/ddx/ibm/ppc/RCS/ppcRepArea.c,v 9.1 88/10/24 04:01:09 paul Exp $ */
  25. /* $Source: /andrew/X11/R3src/tape/server/ddx/ibm/ppc/RCS/ppcRepArea.c,v $ */
  26.  
  27. #ifndef lint
  28. static char *rcsid = "$Header: /andrew/X11/R3src/tape/server/ddx/ibm/ppc/RCS/ppcRepArea.c,v 9.1 88/10/24 04:01:09 paul Exp $";
  29. #endif
  30.  
  31. /* ppc Replicate Area -- A Divide & Conquer Algorithm
  32.  * a "ppc" Helper Function For Stipples And Tiling
  33.  * P. Shupak 1/88
  34.  */
  35.  
  36. #include "X.h"
  37. #include "scrnintstr.h"
  38. #include "screenint.h"
  39. #include "pixmapstr.h"
  40. #include "pixmap.h"
  41. #include "ppc.h"
  42.  
  43. void ppcReplicateArea( x, y, planeMask, goalWidth, goalHeight,
  44.             currentHoriz, currentVert, pScrn )
  45. register int x, y, planeMask ;
  46. int goalWidth, goalHeight ;
  47. int currentHoriz, currentVert ;
  48. ScreenPtr pScrn ;
  49. {
  50. register void (*bitBlitFunction)() =
  51.         ( (ppcScrnPriv *) pScrn->devPrivate )->blit ;
  52.  
  53.     for ( ;
  54.           currentHoriz <= ( goalWidth >> 1 ) ;
  55.           currentHoriz <<= 1 ) {
  56.         (*bitBlitFunction)( GXcopy, planeMask, planeMask,
  57.             x, y,
  58.             x + currentHoriz, y,
  59.             currentHoriz, currentVert ) ;
  60.     }
  61.     if ( goalWidth - currentHoriz )
  62.         (*bitBlitFunction)( GXcopy, planeMask, planeMask,
  63.             x, y,
  64.             x + currentHoriz, y,
  65.             goalWidth - currentHoriz, currentVert ) ;
  66.     for ( ;
  67.           currentVert <= ( goalHeight >> 1 ) ;
  68.           currentVert <<= 1 ) {
  69.         (*bitBlitFunction)( GXcopy, planeMask, planeMask,
  70.             x, y,
  71.             x, y + currentVert,
  72.             goalWidth, currentVert ) ;
  73.     }
  74.     if ( goalHeight - currentVert )
  75.         (*bitBlitFunction)( GXcopy, planeMask, planeMask,
  76.             x, y,
  77.             x, y + currentVert,
  78.             goalWidth, goalHeight - currentVert ) ;
  79. return ;
  80. }
  81.