5ef18f86d8f1bbc8a26d7f358a3017da05a61b94
3 * Copyright © 2000 Keith Packard
5 * Permission to use, copy, modify, distribute, and sell this software and its
6 * documentation for any purpose is hereby granted without fee, provided that
7 * the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of Keith Packard not be used in
10 * advertising or publicity pertaining to distribution of the software without
11 * specific, written prior permission. Keith Packard makes no
12 * representations about the suitability of this software for any purpose. It
13 * is provided "as is" without express or implied warranty.
15 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
19 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21 * PERFORMANCE OF THIS SOFTWARE.
24 #ifdef HAVE_DIX_CONFIG_H
25 #include <dix-config.h>
31 #include "scrnintstr.h"
32 #include "windowstr.h"
33 #include <X11/fonts/font.h>
34 #include "dixfontstr.h"
35 #include <X11/fonts/fontstruct.h>
37 #include "regionstr.h"
44 shadowUpdatePacked(ScreenPtr pScreen
, shadowBufPtr pBuf
)
46 RegionPtr damage
= shadowDamage(pBuf
);
47 PixmapPtr pShadow
= pBuf
->pPixmap
;
48 int nbox
= RegionNumRects(damage
);
49 BoxPtr pbox
= RegionRects(damage
);
50 FbBits
*shaBase
, *shaLine
, *sha
;
52 int scrBase
, scrLine
, scr
;
54 _X_UNUSED
int shaXoff
, shaYoff
;
55 int x
, y
, w
, h
, width
;
57 FbBits
*winBase
= NULL
, *win
;
60 fbGetDrawable(&pShadow
->drawable
, shaBase
, shaStride
, shaBpp
, shaXoff
,
63 x
= pbox
->x1
* shaBpp
;
65 w
= (pbox
->x2
- pbox
->x1
) * shaBpp
;
66 h
= pbox
->y2
- pbox
->y1
;
68 scrLine
= (x
>> FB_SHIFT
);
69 shaLine
= shaBase
+ y
* shaStride
+ (x
>> FB_SHIFT
);
72 w
= (w
+ x
+ FB_MASK
) >> FB_SHIFT
;
81 /* how much remains in this window */
82 i
= scrBase
+ winSize
- scr
;
83 if (i
<= 0 || scr
< scrBase
) {
84 winBase
= (FbBits
*) (*pBuf
->window
) (pScreen
,
93 winSize
/= sizeof(FbBits
);
96 win
= winBase
+ (scr
- scrBase
);
101 memcpy(win
, sha
, i
* sizeof(FbBits
));
104 shaLine
+= shaStride
;
112 shadowUpdatePackedWeak(void)
114 return shadowUpdatePacked
;