diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2004-04-26 11:07:03 +0000 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2004-04-26 11:07:03 +0000 |
commit | 85e4e5445218d70f627fb132a8e8f18470e6749d (patch) | |
tree | 9272fb247022f617ea2d8085761ee3503da79340 /Xprint | |
parent | 46472cbee679f9757c4003a0dcf158aeb3852f47 (diff) |
Work-in-progress for
http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=542 - GLX
support for PS DDX / part #1: Fix visual setup (attachment #243)
Diffstat (limited to 'Xprint')
-rw-r--r-- | Xprint/ps/PsInit.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/Xprint/ps/PsInit.c b/Xprint/ps/PsInit.c index 224d08335..f2e064921 100644 --- a/Xprint/ps/PsInit.c +++ b/Xprint/ps/PsInit.c @@ -83,6 +83,7 @@ in this Software without prior written authorization from The Open Group. #include "Ps.h" #include "mi.h" +#include "micmap.h" #include "AttrValid.h" #include "../../mfb/mfb.h" @@ -100,6 +101,10 @@ int PsContextPrivateIndex; int PsPixmapPrivateIndex; int PsWindowPrivateIndex; +#ifdef GLXEXT +extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); +#endif /* GLXEXT */ + Bool InitializePsDriver(ndx, pScreen, argc, argv) int ndx; @@ -118,6 +123,8 @@ InitializePsDriver(ndx, pScreen, argc, argv) int nDepths; VisualPtr visuals; DepthPtr depths; + VisualID defaultVisual; + int rootDepth; /* * Register this driver's InitContext function with the print @@ -203,27 +210,35 @@ InitializePsDriver(ndx, pScreen, argc, argv) depths[0].depth = 24; depths[0].numVids = 1; - depths[0].vids = &visuals[0].vid; + depths[0].vids = (VisualID *)xalloc(sizeof(VisualID)); + depths[0].vids[0] = visuals[0].vid; depths[1].depth = 8; depths[1].numVids = 1; - depths[1].vids = &visuals[1].vid; + depths[1].vids = (VisualID *)xalloc(sizeof(VisualID)); + depths[1].vids[0] = visuals[1].vid; + + /* Defaul visual is 8bit PseudoColor */ + defaultVisual = visuals[1].vid; + rootDepth = visuals[1].nplanes; -/* THE FOLLOWING CAUSES SERVER DEFAULT VISUAL TO BE 24 BIT */ -/* miScreenInit(pScreen, (pointer)0, - pScreen->width, pScreen->height, - pScreen->width / (pScreen->mmWidth / 25.40), - pScreen->height / (pScreen->mmHeight / 25.40), - 0, 24, nDepths, - depths, visuals[1].vid, nVisuals, visuals); */ +#ifdef GLXEXT + { + miInitVisualsProcPtr proc = NULL; + + GlxWrapInitVisuals(&proc); + /* GlxInitVisuals ignores the last three arguments. */ + proc(&visuals, &depths, &nVisuals, &nDepths, + &rootDepth, &defaultVisual, 0, 0, 0); + } +#endif /* GLXEXT */ -/* THE FOLLOWING CAUSES SERVER DEFAULT VISUAL TO BE 8 BIT */ miScreenInit(pScreen, (pointer)0, - pScreen->width, pScreen->height, - (int) (pScreen->width / (pScreen->mmWidth / 25.40)), - (int) (pScreen->height / (pScreen->mmHeight / 25.40)), - 0, 8, nDepths, - depths, visuals[1].vid, nVisuals, visuals); + pScreen->width, pScreen->height, + (int) (pScreen->width / (pScreen->mmWidth / 25.40)), + (int) (pScreen->height / (pScreen->mmHeight / 25.40)), + 0, rootDepth, nDepths, + depths, defaultVisual, nVisuals, visuals); if( cfbCreateDefColormap(pScreen)==FALSE ) return FALSE; |