2
* This code is largely copied from fbcopy.c.
4
* Copyright © 1998 Keith Packard
5
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
7
* Permission to use, copy, modify, distribute, and sell this software and its
8
* documentation for any purpose is hereby granted without fee, provided that
9
* the above copyright notice appear in all copies and that both that
10
* copyright notice and this permission notice appear in supporting
11
* documentation, and that the name of Keith Packard not be used in
12
* advertising or publicity pertaining to distribution of the software without
13
* specific, written prior permission. Keith Packard makes no
14
* representations about the suitability of this software for any purpose. It
15
* is provided "as is" without express or implied warranty.
17
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
* PERFORMANCE OF THIS SOFTWARE.
25
/* $XFree86: xc/programs/Xserver/fb/fbcopy.c,v 1.12 2001/07/16 05:04:05 keithp Exp $ */
27
#ifdef HAVE_DIX_CONFIG_H
28
#include <dix-config.h>
36
rlCopyNtoN (DrawablePtr pSrcDrawable,
37
DrawablePtr pDstDrawable,
48
CARD8 alu = pGC ? pGC->alu : GXcopy;
49
FbBits pm = pGC ? fbGetGCPrivate(pGC)->pm : FB_ALLONES;
59
fbGetDrawable (pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
60
fbGetDrawable (pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
64
rlBlt (src + (pbox->y1 + dy + srcYoff) * srcStride,
66
(pbox->x1 + dx + srcXoff) * srcBpp,
68
pDstDrawable->pScreen,
69
dst + (pbox->y1 + dstYoff) * dstStride,
71
(pbox->x1 + dstXoff) * dstBpp,
73
(pbox->x2 - pbox->x1) * dstBpp,
74
(pbox->y2 - pbox->y1),
87
rlCopyArea (DrawablePtr pSrcDrawable,
88
DrawablePtr pDstDrawable,
100
if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel)
101
copy = fb24_32CopyMtoN;
105
return fbDoCopy (pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
106
widthSrc, heightSrc, xOut, yOut, copy, 0, 0);