(file) Return to bstor.c CVS log (file) (dir) Up to [XFree86 CVS] / xc / programs / Xserver / hw / xfree86 / accel / ibm8514

File: [XFree86 CVS] / xc / programs / Xserver / hw / xfree86 / accel / ibm8514 / Attic / bstor.c (download)
Revision: 1.1.1.2 (vendor branch), Sat Jan 28 10:03:36 1995 UTC (18 years, 3 months ago) by root
Branch: X11R6
CVS Tags: xf-3_1_2e, xf-3_1_2d, xf-3_1_2c, xf-3_1_2b, xf-3_1_2a, xf-3_1_2Ba, xf-3_1_2B, xf-3_1_2Af, xf-3_1_2Ae, xf-3_1_2Ad, xf-3_1_2Ac, xf-3_1_2Ab, xf-3_1_2Aa, xf-3_1_2A, xf-3_1_2-branch, xf-3_1_2-S, xf-3_1_2, xf-3_1_1h, xf-3_1_1g, xf-3_1_1f, xf-3_1_1e, xf-3_1_1d, xf-3_1_1c, xf-3_1_1b, xf-3_1_1a, xf-3_1_1Z, xf-3_1_1Dc, xf-3_1_1Db, xf-3_1_1Da, xf-3_1_1D, xf-3_1_1Cd, xf-3_1_1Cc, xf-3_1_1Cb, xf-3_1_1Ca, xf-3_1_1C, xf-3_1_1Bi, xf-3_1_1Bh, xf-3_1_1Bg, xf-3_1_1Bf, xf-3_1_1Be, xf-3_1_1Bd, xf-3_1_1Bc, xf-3_1_1Bb, xf-3_1_1Ba, xf-3_1_1B, xf-3_1_1Ad, xf-3_1_1Ac, xf-3_1_1Ab, xf-3_1_1Aa, xf-3_1_1A, xf-3_1_1-u1, xf-3_1_1-u, xf-3_1_1, xf-3_1_0Zg, xf-3_1_0Zf, seq-3977, XC, X11R6_PRE_11, X11R6_13, X11R6_12, X11R6_11
Changes since 1.1.1.1: +1 -1 lines
X11R6 Public Patch 11 (prelim version)

/* $XConsortium: bstor.c,v 1.1 95/01/26 15:29:18 kaleb Exp $ */
/*-
 * ibm8514bstore.c --
 *	Functions required by the backing-store implementation in MI.
 *
 * Copyright (c) 1987 by the Regents of the University of California
 *
 * Permission to use, copy, modify, and distribute this
 * software and its documentation for any purpose and without
 * fee is hereby granted, provided that the above copyright
 * notice appear in all copies.  The University of California
 * makes no representations about the suitability of this
 * software for any purpose.  It is provided "as is" without
 * express or implied warranty.
 *
 * Modified for the 8514/A by Kevin E. Martin (martin@cs.unc.edu)
 *
 * KEVIN E. MARTIN AND TIAGO GONS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
 * IN NO EVENT SHALL KEVIN E. MARTIN OR TIAGO GONS BE LIABLE FOR ANY SPECIAL,
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 * Modified by Tiago Gons (tiago@comosjn.hobby.nl)
 */


#include    "cfb.h"
#include    "X.h"
#include    "mibstore.h"
#include    "regionstr.h"
#include    "scrnintstr.h"
#include    "pixmapstr.h"
#include    "windowstr.h"
#include    "ibm8514.h"

void
ibm8514SaveAreas(pPixmap, prgnSave, xorg, yorg, pWin)
    PixmapPtr	  	pPixmap;  	/* Backing pixmap */
    RegionPtr	  	prgnSave; 	/* Region to save (pixmap-relative) */
    int	    	  	xorg;	    	/* X origin of region */
    int	    	  	yorg;	    	/* Y origin of region */
    WindowPtr	  	pWin;
{
    register BoxPtr	pBox;
    register int	i;
    int			pixWidth;

/* 4-5-93 TCG : is VT visible */
    if (!xf86VTSema)
    {
	cfbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
	return;
    }

    
    i = REGION_NUM_RECTS(prgnSave);
    pBox = REGION_RECTS(prgnSave);

    pixWidth = PixmapBytePad(pPixmap->drawable.width, pPixmap->drawable.depth);

    while (i--) {
	ibm8514ImageRead(pBox->x1 + xorg, pBox->y1 + yorg,
			 pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
			 pPixmap->devPrivate.ptr, pixWidth,
			 pBox->x1, pBox->y1, 0xff);
	pBox++;
    }
}

void
ibm8514RestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin)
    PixmapPtr	  	pPixmap;  	/* Backing pixmap */
    RegionPtr	  	prgnRestore; 	/* Region to restore (screen-relative)*/
    int	    	  	xorg;	    	/* X origin of window */
    int	    	  	yorg;	    	/* Y origin of window */
    WindowPtr	  	pWin;
{
    register BoxPtr	pBox;
    register int	i;
    int			pixWidth;
    
/* 4-5-93 TCG : is VT visible */
    if (!xf86VTSema)
    {
	cfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
	return;
    }

    i = REGION_NUM_RECTS(prgnRestore);
    pBox = REGION_RECTS(prgnRestore);

    pixWidth = PixmapBytePad(pPixmap->drawable.width, pPixmap->drawable.depth);

    while (i--) {
	ibm8514ImageWrite(pBox->x1, pBox->y1,
			  pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
			  pPixmap->devPrivate.ptr, pixWidth,
			  pBox->x1 - xorg, pBox->y1 - yorg,
			  ibm8514alu[GXcopy], 0xffffffff);
	pBox++;
    }
}

Powered by
ViewCVS 0.9.2