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