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.
26 #ifdef HAVE_DIX_CONFIG_H
27 #include <dix-config.h>
35 rlCopyNtoN (DrawablePtr pSrcDrawable
,
36 DrawablePtr pDstDrawable
,
47 CARD8 alu
= pGC
? pGC
->alu
: GXcopy
;
48 FbBits pm
= pGC
? fbGetGCPrivate(pGC
)->pm
: FB_ALLONES
;
58 fbGetDrawable (pSrcDrawable
, src
, srcStride
, srcBpp
, srcXoff
, srcYoff
);
59 fbGetDrawable (pDstDrawable
, dst
, dstStride
, dstBpp
, dstXoff
, dstYoff
);
63 rlBlt (src
+ (pbox
->y1
+ dy
+ srcYoff
) * srcStride
,
65 (pbox
->x1
+ dx
+ srcXoff
) * srcBpp
,
67 pDstDrawable
->pScreen
,
68 dst
+ (pbox
->y1
+ dstYoff
) * dstStride
,
70 (pbox
->x1
+ dstXoff
) * dstBpp
,
72 (pbox
->x2
- pbox
->x1
) * dstBpp
,
73 (pbox
->y2
- pbox
->y1
),
86 rlCopyArea (DrawablePtr pSrcDrawable
,
87 DrawablePtr pDstDrawable
,
99 if (pSrcDrawable
->bitsPerPixel
!= pDstDrawable
->bitsPerPixel
)
100 copy
= fb24_32CopyMtoN
;
104 return fbDoCopy (pSrcDrawable
, pDstDrawable
, pGC
, xIn
, yIn
,
105 widthSrc
, heightSrc
, xOut
, yOut
, copy
, 0, 0);