/*
*
* Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Thanks to Daniel Chemko <dchemko@intrinsyc.com> for making the 90 and 180
* orientations work.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include "scrnintstr.h"
#include "windowstr.h"
#include "dixfontstr.h"
#include "mi.h"
#include "regionstr.h"
#include "globals.h"
#include "gcstruct.h"
#include "shadow.h"
#include "fb.h"
#define DANDEBUG 0
#if ROTATE == 270
#define SCRY(x,y,w,h) (x)
#define SCRWIDTH(x,y,w,h) (h)
#define STEPDOWN(x,y,w,h) ((w)--)
#define NEXTY(x,y,w,h) ((x)++)
#define SCRLEFT(x,y,w,h) (y)
#define SCRWIDTH(x,y,w,h) (h)
#define STEPDOWN(x,y,w,h) ((w)--)
#define NEXTY(x,y,w,h) ((void)(x))
#define SCRWIDTH(x,y,w,h) (w)
#define STEPDOWN(x,y,w,h) ((h)--)
#define NEXTY(x,y,w,h) ((void)(y))
#else
#define SCRLEFT(x,y,w,h) (x)
#define SCRY(x,y,w,h) (y)
#define SCRWIDTH(x,y,w,h) (w)
#define STEPDOWN(x,y,w,h) ((h)--)
#define NEXTY(x,y,w,h) ((y)++)
#endif
void
{
int shaBpp;
int x, y, w, h, width;
int i;
shaYoff);
#if (DANDEBUG > 1)
("-> Entering Shadow Update:\r\n |- Origins: pShadow=%x, pScreen=%x, damage=%x\r\n |- Metrics: shaStride=%d, shaBase=%x, shaBpp=%d\r\n | \n",
#endif
while (nbox--) {
#if (DANDEBUG > 2)
(" |-> Redrawing box - Metrics: X=%d, Y=%d, Width=%d, Height=%d\n",
x, y, w, h);
#endif
while (STEPDOWN(x, y, w, h)) {
winSize = 0;
scrBase = 0;
#if (DANDEBUG > 3)
ErrorF(" | |-> StepDown - Metrics: width=%d, scr=%x, sha=%x\n",
#endif
while (width) {
/* how much remains in this window */
SCRY(x, y, w, h),
&winSize,
if (!winBase)
return;
i = winSize;
#if(DANDEBUG > 4)
(" | | |-> Starting New Line - Metrics: winBase=%x, scrBase=%x, winSize=%d\r\n | | | Xstride=%d, Ystride=%d, w=%d h=%d\n",
#endif
}
if (i > width)
i = width;
width -= i;
scr += i;
#if(DANDEBUG > 5)
(" | | |-> Writing Line - Metrics: win=%x, sha=%x\n",
#endif
while (i--) {
#if(DANDEBUG > 6)
(" | | |-> Writing Pixel - Metrics: win=%x, sha=%d, remaining=%d\n",
#endif
} /* i */
} /* width */
NEXTY(x, y, w, h);
} /* STEPDOWN */
pbox++;
} /* nbox */
}