summaryrefslogtreecommitdiff
path: root/miext/shadow/shplanar.c
diff options
context:
space:
mode:
Diffstat (limited to 'miext/shadow/shplanar.c')
-rw-r--r--miext/shadow/shplanar.c162
1 files changed, 81 insertions, 81 deletions
diff --git a/miext/shadow/shplanar.c b/miext/shadow/shplanar.c
index 350405186..4f6542cb6 100644
--- a/miext/shadow/shplanar.c
+++ b/miext/shadow/shplanar.c
@@ -44,7 +44,7 @@
* 32 4-bit pixels per write
*/
-#define PL_SHIFT 7
+#define PL_SHIFT 7
#define PL_UNIT (1 << PL_SHIFT)
#define PL_MASK (PL_UNIT - 1)
@@ -87,94 +87,94 @@
#endif
void
-shadowUpdatePlanar4 (ScreenPtr pScreen,
- shadowBufPtr pBuf)
+shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage (pBuf);
- PixmapPtr pShadow = pBuf->pPixmap;
- int nbox = RegionNumRects (damage);
- BoxPtr pbox = RegionRects (damage);
- CARD32 *shaBase, *shaLine, *sha;
- FbStride shaStride;
- int scrBase, scrLine, scr;
- int shaBpp;
- _X_UNUSED int shaXoff, shaYoff;
- int x, y, w, h, width;
- int i;
- CARD32 *winBase = NULL, *win;
- CARD32 winSize;
- int plane;
- CARD32 m,m5,m6;
- CARD8 s1, s2, s3, s4;
+ RegionPtr damage = shadowDamage(pBuf);
+ PixmapPtr pShadow = pBuf->pPixmap;
+ int nbox = RegionNumRects(damage);
+ BoxPtr pbox = RegionRects(damage);
+ CARD32 *shaBase, *shaLine, *sha;
+ FbStride shaStride;
+ int scrBase, scrLine, scr;
+ int shaBpp;
+ _X_UNUSED int shaXoff, shaYoff;
+ int x, y, w, h, width;
+ int i;
+ CARD32 *winBase = NULL, *win;
+ CARD32 winSize;
+ int plane;
+ CARD32 m, m5, m6;
+ CARD8 s1, s2, s3, s4;
- fbGetStipDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff);
- while (nbox--)
- {
- x = (pbox->x1) * shaBpp;
- y = (pbox->y1);
- w = (pbox->x2 - pbox->x1) * shaBpp;
- h = pbox->y2 - pbox->y1;
+ fbGetStipDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff,
+ shaYoff);
+ while (nbox--) {
+ x = (pbox->x1) * shaBpp;
+ y = (pbox->y1);
+ w = (pbox->x2 - pbox->x1) * shaBpp;
+ h = pbox->y2 - pbox->y1;
- w = (w + (x & PL_MASK) + PL_MASK) >> PL_SHIFT;
- x &= ~PL_MASK;
-
- scrLine = (x >> PL_SHIFT);
- shaLine = shaBase + y * shaStride + (x >> FB_SHIFT);
-
- while (h--)
- {
- for (plane = 0; plane < 4; plane++)
- {
- width = w;
- scr = scrLine;
- sha = shaLine;
- winSize = 0;
- scrBase = 0;
- while (width) {
- /* how much remains in this window */
- i = scrBase + winSize - scr;
- if (i <= 0 || scr < scrBase)
- {
- winBase = (CARD32 *) (*pBuf->window) (pScreen,
- y,
- (scr << 4) | (plane),
- SHADOW_WINDOW_WRITE,
- &winSize,
- pBuf->closure);
- if(!winBase)
- return;
- winSize >>= 2;
- scrBase = scr;
- i = winSize;
- }
- win = winBase + (scr - scrBase);
- if (i > width)
- i = width;
- width -= i;
- scr += i;
-
- while (i--)
- {
- GetBits(plane,0,s1);
- GetBits(plane,1,s2);
- GetBits(plane,2,s3);
- GetBits(plane,3,s4);
- *win++ = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
- sha += 4;
- }
- }
- }
- shaLine += shaStride;
- y++;
- }
- pbox++;
+ w = (w + (x & PL_MASK) + PL_MASK) >> PL_SHIFT;
+ x &= ~PL_MASK;
+
+ scrLine = (x >> PL_SHIFT);
+ shaLine = shaBase + y * shaStride + (x >> FB_SHIFT);
+
+ while (h--) {
+ for (plane = 0; plane < 4; plane++) {
+ width = w;
+ scr = scrLine;
+ sha = shaLine;
+ winSize = 0;
+ scrBase = 0;
+ while (width) {
+ /* how much remains in this window */
+ i = scrBase + winSize - scr;
+ if (i <= 0 || scr < scrBase) {
+ winBase = (CARD32 *) (*pBuf->window) (pScreen,
+ y,
+ (scr << 4) |
+ (plane),
+ SHADOW_WINDOW_WRITE,
+ &winSize,
+ pBuf->closure);
+ if (!winBase)
+ return;
+ winSize >>= 2;
+ scrBase = scr;
+ i = winSize;
+ }
+ win = winBase + (scr - scrBase);
+ if (i > width)
+ i = width;
+ width -= i;
+ scr += i;
+
+ while (i--) {
+ GetBits(plane, 0, s1);
+ GetBits(plane, 1, s2);
+ GetBits(plane, 2, s3);
+ GetBits(plane, 3, s4);
+ *win++ = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
+ sha += 4;
+ }
+ }
+ }
+ shaLine += shaStride;
+ y++;
+ }
+ pbox++;
}
}
-shadowUpdateProc shadowUpdatePlanar4Weak(void) {
+shadowUpdateProc
+shadowUpdatePlanar4Weak(void)
+{
return shadowUpdatePlanar4;
}
-shadowUpdateProc shadowUpdatePlanar4x8Weak(void) {
+shadowUpdateProc
+shadowUpdatePlanar4x8Weak(void)
+{
return shadowUpdatePlanar4x8;
}