diff options
Diffstat (limited to 'hw/kdrive/src/kshadow.c')
-rw-r--r-- | hw/kdrive/src/kshadow.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/hw/kdrive/src/kshadow.c b/hw/kdrive/src/kshadow.c index ea44812db..cf3391dba 100644 --- a/hw/kdrive/src/kshadow.c +++ b/hw/kdrive/src/kshadow.c @@ -26,36 +26,36 @@ #include "kdrive.h" Bool -KdShadowFbAlloc (KdScreenInfo *screen, int fb, Bool rotate) +KdShadowFbAlloc (KdScreenInfo *screen, Bool rotate) { int paddedWidth; void *buf; int width = rotate ? screen->height : screen->width; int height = rotate ? screen->width : screen->height; - int bpp = screen->fb[fb].bitsPerPixel; + int bpp = screen->fb.bitsPerPixel; /* use fb computation for width */ paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (FbBits); buf = xalloc (paddedWidth * height); if (!buf) return FALSE; - if (screen->fb[fb].shadow) - xfree (screen->fb[fb].frameBuffer); - screen->fb[fb].shadow = TRUE; - screen->fb[fb].frameBuffer = buf; - screen->fb[fb].byteStride = paddedWidth; - screen->fb[fb].pixelStride = paddedWidth * 8 / bpp; + if (screen->fb.shadow) + xfree (screen->fb.frameBuffer); + screen->fb.shadow = TRUE; + screen->fb.frameBuffer = buf; + screen->fb.byteStride = paddedWidth; + screen->fb.pixelStride = paddedWidth * 8 / bpp; return TRUE; } void -KdShadowFbFree (KdScreenInfo *screen, int fb) +KdShadowFbFree (KdScreenInfo *screen) { - if (screen->fb[fb].shadow) + if (screen->fb.shadow) { - xfree (screen->fb[fb].frameBuffer); - screen->fb[fb].frameBuffer = 0; - screen->fb[fb].shadow = FALSE; + xfree (screen->fb.frameBuffer); + screen->fb.frameBuffer = 0; + screen->fb.shadow = FALSE; } } @@ -64,14 +64,12 @@ KdShadowSet (ScreenPtr pScreen, int randr, ShadowUpdateProc update, ShadowWindow { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; - int fb; shadowRemove (pScreen, pScreen->GetScreenPixmap(pScreen)); - for (fb = 0; fb < KD_MAX_FB && screen->fb[fb].depth; fb++) + if(screen->fb.shadow) { - if (screen->fb[fb].shadow) - return shadowAdd (pScreen, pScreen->GetScreenPixmap(pScreen), - update, window, randr, 0); + return shadowAdd (pScreen, pScreen->GetScreenPixmap(pScreen), + update, window, randr, 0); } return TRUE; } |