4
* Copyright © 2004 Philip Blundell
6
* Permission to use, copy, modify, distribute, and sell this software and its
7
* documentation for any purpose is hereby granted without fee, provided that
8
* the above copyright notice appear in all copies and that both that
9
* copyright notice and this permission notice appear in supporting
10
* documentation, and that the name of Philip Blundell not be used in
11
* advertising or publicity pertaining to distribution of the software without
12
* specific, written prior permission. Philip Blundell makes no
13
* representations about the suitability of this software for any purpose. It
14
* is provided "as is" without express or implied warranty.
16
* PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
* EVENT SHALL PHILIP BLUNDELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
* PERFORMANCE OF THIS SOFTWARE.
26
#include "scrnintstr.h"
27
#include "windowstr.h"
28
#include "dixfontstr.h"
30
#include "regionstr.h"
38
#define WINSTEPX(stride) (stride)
39
#define WINSTART(x,y) (((pScreen->height - 1) - y) + (x * winStride))
44
#define WINSTEPX(stride) (-stride)
46
#define WINSTART(x,y) (((pScreen->width - 1 - x) * winStride) + y)
50
#error This rotation is not supported here
59
FUNC (ScreenPtr pScreen,
63
FUNC (ScreenPtr pScreen,
66
RegionPtr damage = shadowDamage(pBuf);
67
PixmapPtr pShadow = pBuf->pPixmap;
68
int nbox = REGION_NUM_RECTS (damage);
69
BoxPtr pbox = REGION_RECTS (damage);
71
Data *shaBase, *shaLine, *sha;
72
FbStride shaStride, winStride;
74
int shaXoff, shaYoff; /* XXX assumed to be zero */
76
Data *winBase, *win, *winLine;
79
fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff);
80
shaBase = (Data *) shaBits;
81
shaStride = shaStride * sizeof (FbBits) / sizeof (Data);
83
winBase = (Data *) (*pBuf->window) (pScreen, 0, 0,
85
&winSize, pBuf->closure);
86
winStride = (Data *) (*pBuf->window) (pScreen, 1, 0,
88
&winSize, pBuf->closure) - winBase;
94
w = (pbox->x2 - pbox->x1);
95
h = pbox->y2 - pbox->y1;
97
shaLine = shaBase + (y * shaStride) + x;
99
__builtin_prefetch (shaLine);
101
winLine = winBase + WINSTART(x, y);
108
while (sha < (shaLine + w - 16))
111
__builtin_prefetch (sha + shaStride);
114
win += WINSTEPX(winStride);
116
win += WINSTEPX(winStride);
118
win += WINSTEPX(winStride);
120
win += WINSTEPX(winStride);
123
win += WINSTEPX(winStride);
125
win += WINSTEPX(winStride);
127
win += WINSTEPX(winStride);
129
win += WINSTEPX(winStride);
132
win += WINSTEPX(winStride);
134
win += WINSTEPX(winStride);
136
win += WINSTEPX(winStride);
138
win += WINSTEPX(winStride);
141
win += WINSTEPX(winStride);
143
win += WINSTEPX(winStride);
145
win += WINSTEPX(winStride);
147
win += WINSTEPX(winStride);
150
while (sha < (shaLine + w))
153
win += WINSTEPX(winStride);
157
shaLine += shaStride;
158
winLine += WINSTEPY();