2 * Copyright © 2004 David Reveman
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * David Reveman not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * David Reveman makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
15 * DAVID REVEMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DAVID REVEMAN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Author: David Reveman <davidr@novell.com>
30 xglCopy (DrawablePtr pSrc
,
37 glitz_surface_t
*src
, *dst
;
41 XGL_DRAWABLE_PIXMAP (pDst
);
46 if (xglPrepareTarget (pDst
))
48 if (!xglSyncSurface (pSrc
))
53 if (!xglPrepareTarget (pSrc
))
56 if (!xglSyncSurface (pDst
))
60 XGL_GET_DRAWABLE (pSrc
, src
, srcXoff
, srcYoff
);
61 XGL_GET_DRAWABLE (pDst
, dst
, dstXoff
, dstYoff
);
63 glitz_surface_set_clip_region (dst
,
65 (glitz_box_t
*) pBox
, nBox
);
71 pPixmap
->drawable
.width
- dstXoff
,
72 pPixmap
->drawable
.height
- dstYoff
,
76 glitz_surface_set_clip_region (dst
, 0, 0, NULL
, 0);
78 if (glitz_surface_get_status (dst
))
85 xglCopyProc (DrawablePtr pSrc
,
97 BoxPtr pSrcBox
= (BoxPtr
) closure
;
99 if (!xglCopy (pSrc
, pDst
, dx
, dy
, pBox
, nBox
))
103 XGL_DRAWABLE_PIXMAP (pDst
);
104 XGL_PIXMAP_PRIV (pPixmap
);
106 if (!xglSyncBits (pSrc
, pSrcBox
))
107 FatalError (XGL_SW_FAILURE_STRING
);
109 if (!xglMapPixmapBits (pPixmap
))
110 FatalError (XGL_SW_FAILURE_STRING
);
112 fbCopyNtoN (pSrc
, pDst
, pGC
,
115 reverse
, upsidedown
, bitplane
,
118 pPixmapPriv
->damageBox
= miEmptyBox
;
122 REGION_INIT (pDst
->pScreen
, ®ion
, pBox
, 1);
123 xglAddSurfaceDamage (pDst
, ®ion
);
124 REGION_UNINIT (pDst
->pScreen
, ®ion
);
129 xglAddCurrentBitDamage (pDst
);