diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-11-02 15:26:35 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-11-02 15:26:35 +0000 |
commit | dbca69c8a4f3e2d1ccb4f89152213b2861b33af6 (patch) | |
tree | f8963ef73903a7b4374adc2354dffbaa905112ac /xserver/fb/fbscreen.c | |
parent | 33b2029f322f3c238b7ba528083195ad8dde33e1 (diff) |
xserver 1.5.2. tested by ckuethe@, oga@, and others.
Diffstat (limited to 'xserver/fb/fbscreen.c')
-rw-r--r-- | xserver/fb/fbscreen.c | 85 |
1 files changed, 43 insertions, 42 deletions
diff --git a/xserver/fb/fbscreen.c b/xserver/fb/fbscreen.c index b88375810..12b19e419 100644 --- a/xserver/fb/fbscreen.c +++ b/xserver/fb/fbscreen.c @@ -38,7 +38,7 @@ fbCloseScreen (int index, ScreenPtr pScreen) xfree (pScreen->visuals); xfree (pScreen->devPrivate); #ifdef FB_SCREEN_PRIVATE - xfree (pScreen->devPrivates[fbScreenPrivateIndex].ptr); + xfree (dixLookupPrivate(&pScreen->devPrivates, fbGetScreenPrivateKey())); #endif return TRUE; } @@ -81,7 +81,6 @@ fbQueryBestSize (int class, } } -#ifndef FB_OLD_SCREEN PixmapPtr _fbGetWindowPixmap (WindowPtr pWindow) { @@ -94,10 +93,9 @@ _fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap) #ifdef FB_NO_WINDOW_PIXMAPS FatalError ("Attempted to set window pixmap without fb support\n"); #else - pWindow->devPrivates[fbWinPrivateIndex].ptr = (pointer) pPixmap; + dixSetPrivate(&pWindow->devPrivates, fbGetWinPrivateKey(), pPixmap); #endif } -#endif Bool fbSetupScreen(ScreenPtr pScreen, @@ -109,7 +107,7 @@ fbSetupScreen(ScreenPtr pScreen, int width, /* pixel width of frame buffer */ int bpp) /* bits per pixel for screen */ { - if (!fbAllocatePrivates(pScreen, (int *) 0)) + if (!fbAllocatePrivates(pScreen, NULL)) return FALSE; pScreen->defColormap = FakeClientID(0); /* let CreateDefColormap do whatever it wants for pixels */ @@ -124,8 +122,6 @@ fbSetupScreen(ScreenPtr pScreen, pScreen->ChangeWindowAttributes = fbChangeWindowAttributes; pScreen->RealizeWindow = fbMapWindow; pScreen->UnrealizeWindow = fbUnmapWindow; - pScreen->PaintWindowBackground = fbPaintWindow; - pScreen->PaintWindowBorder = fbPaintWindow; pScreen->CopyWindow = fbCopyWindow; pScreen->CreatePixmap = fbCreatePixmap; pScreen->DestroyPixmap = fbDestroyPixmap; @@ -141,20 +137,25 @@ fbSetupScreen(ScreenPtr pScreen, pScreen->ResolveColor = fbResolveColor; pScreen->BitmapToRegion = fbPixmapToRegion; -#ifndef FB_OLD_SCREEN pScreen->GetWindowPixmap = _fbGetWindowPixmap; pScreen->SetWindowPixmap = _fbSetWindowPixmap; - pScreen->BackingStoreFuncs.SaveAreas = fbSaveAreas; - pScreen->BackingStoreFuncs.RestoreAreas = fbRestoreAreas; - pScreen->BackingStoreFuncs.SetClipmaskRgn = 0; - pScreen->BackingStoreFuncs.GetImagePixmap = 0; - pScreen->BackingStoreFuncs.GetSpansPixmap = 0; -#endif - return TRUE; } +#ifdef FB_ACCESS_WRAPPER +Bool +wfbFinishScreenInit(ScreenPtr pScreen, + pointer pbits, + int xsize, + int ysize, + int dpix, + int dpiy, + int width, + int bpp, + SetupWrapProcPtr setupWrap, + FinishWrapProcPtr finishWrap) +#else Bool fbFinishScreenInit(ScreenPtr pScreen, pointer pbits, @@ -164,6 +165,7 @@ fbFinishScreenInit(ScreenPtr pScreen, int dpiy, int width, int bpp) +#endif { VisualPtr visuals; DepthPtr depths; @@ -222,6 +224,10 @@ fbFinishScreenInit(ScreenPtr pScreen, fbGetScreenPrivate(pScreen)->win32bpp = 32; fbGetScreenPrivate(pScreen)->pix32bpp = 32; } +#ifdef FB_ACCESS_WRAPPER + fbGetScreenPrivate(pScreen)->setupWrap = setupWrap; + fbGetScreenPrivate(pScreen)->finishWrap = finishWrap; +#endif #endif rootdepth = 0; if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth, @@ -229,11 +235,7 @@ fbFinishScreenInit(ScreenPtr pScreen, return FALSE; if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, rootdepth, ndepths, depths, - defaultVisual, nvisuals, visuals -#ifdef FB_OLD_MISCREENINIT - , (miBSFuncPtr) 0 -#endif - )) + defaultVisual, nvisuals, visuals)) return FALSE; /* overwrite miCloseScreen with our own */ pScreen->CloseScreen = fbCloseScreen; @@ -256,6 +258,27 @@ fbFinishScreenInit(ScreenPtr pScreen, } /* dts * (inch/dot) * (25.4 mm / inch) = mm */ +#ifdef FB_ACCESS_WRAPPER +Bool +wfbScreenInit(ScreenPtr pScreen, + pointer pbits, + int xsize, + int ysize, + int dpix, + int dpiy, + int width, + int bpp, + SetupWrapProcPtr setupWrap, + FinishWrapProcPtr finishWrap) +{ + if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp)) + return FALSE; + if (!wfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, + width, bpp, setupWrap, finishWrap)) + return FALSE; + return TRUE; +} +#else Bool fbScreenInit(ScreenPtr pScreen, pointer pbits, @@ -273,26 +296,4 @@ fbScreenInit(ScreenPtr pScreen, return FALSE; return TRUE; } - - -#ifdef FB_OLD_SCREEN -const miBSFuncRec fbBSFuncRec = { - fbSaveAreas, - fbRestoreAreas, - (void (*)(GCPtr, RegionPtr)) 0, - (PixmapPtr (*)(void)) 0, - (PixmapPtr (*)(void)) 0, -}; -#endif - -#if 0 -void -fbInitializeBackingStore (ScreenPtr pScreen) -{ -#ifdef FB_OLD_SCREEN - miInitializeBackingStore (pScreen, (miBSFuncRec *) &fbBSFuncRec); -#else - miInitializeBackingStore (pScreen); -#endif -} #endif |