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