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)
This commit is contained in:
parent
46472cbee6
commit
85e4e54452
|
@ -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;
|
||||
|
||||
/* 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); */
|
||||
/* Defaul visual is 8bit PseudoColor */
|
||||
defaultVisual = visuals[1].vid;
|
||||
rootDepth = visuals[1].nplanes;
|
||||
|
||||
#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;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $XdotOrg: xc/programs/Xserver/mi/miinitext.c,v 1.1.4.7 2004/04/15 10:17:22 eich Exp $ */
|
||||
/* $XdotOrg: xc/programs/Xserver/mi/miinitext.c,v 1.2 2004/04/23 19:54:26 eich Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.67 2003/01/12 02:44:27 dawes Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
|
@ -69,7 +69,6 @@ SOFTWARE.
|
|||
#undef PANORAMIX
|
||||
#undef RES
|
||||
#undef XIE
|
||||
#undef GLXEXT /* not yet */
|
||||
#undef XINPUT
|
||||
#undef XV
|
||||
#undef SCREENSAVER
|
||||
|
@ -379,14 +378,12 @@ InitExtensions(argc, argv)
|
|||
#endif
|
||||
#endif
|
||||
#ifdef GLXEXT
|
||||
#ifndef XPRINT /* we don't want Glx in the Xprint server */
|
||||
#ifndef __DARWIN__
|
||||
GlxExtensionInit();
|
||||
#else
|
||||
DarwinGlxExtensionInit();
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifdef DPSEXT
|
||||
#ifndef XPRINT
|
||||
DPSExtensionInit();
|
||||
|
@ -408,14 +405,12 @@ InitVisualWrap()
|
|||
{
|
||||
miResetInitVisuals();
|
||||
#ifdef GLXEXT
|
||||
#ifndef XPRINT
|
||||
#ifndef __DARWIN__
|
||||
GlxWrapInitVisuals(&miInitVisualsProc);
|
||||
#else
|
||||
DarwinGlxWrapInitVisuals(&miInitVisualsProc);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#else /* XFree86LOADER */
|
||||
|
|
Loading…
Reference in New Issue
Block a user