renderspu_glx.c revision 8be5264d31d6a6ec949ff2285764c9af57298b52
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan/* Copyright (c) 2001, Stanford University
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan * All rights reserved
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan * See the file LICENSE.txt for information on redistributing this software.
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan#if 00 /*TEMPORARY*/
0253a7dc97ec1ab462376979562c69636573904aJnRouvignactypedef struct
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan unsigned long flags;
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan unsigned long functions;
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan unsigned long decorations;
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan unsigned long status;
0253a7dc97ec1ab462376979562c69636573904aJnRouvignacWindowExistsErrorHandler( Display *dpy, XErrorEvent *xerr )
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan oldXErrorHandler = XSetErrorHandler(WindowExistsErrorHandler);
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan XGetWindowAttributes(dpy, w, &xwa); /* dummy request */
fb4950772f3b4402dcf3ae8b6bc9e56c743b6762coulbeck oldXErrorHandler = XSetErrorHandler(WindowExistsErrorHandler);
fb4950772f3b4402dcf3ae8b6bc9e56c743b6762coulbeck XGetWindowAttributes(dpy, w, &xwa); /* dummy request */
fb4950772f3b4402dcf3ae8b6bc9e56c743b6762coulbeck * Garbage collection function.
fb4950772f3b4402dcf3ae8b6bc9e56c743b6762coulbeck * Loop over all known windows and check if corresponding X window still
fb4950772f3b4402dcf3ae8b6bc9e56c743b6762coulbeck * exists. If it doesn't, destroy the render SPU window.
fb4950772f3b4402dcf3ae8b6bc9e56c743b6762coulbeck * XXX seems to blow up with threadtest.conf tests.
fb4950772f3b4402dcf3ae8b6bc9e56c743b6762coulbeck for (i = 0; i < (int)render_spu.window_id - 1; i++) {
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter window = (WindowInfo *) crHashtableSearch(render_spu.windowTable, i);
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan if (!WindowExists (window->visual->dpy, window->appWindow) ) {
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan if(WindowExists(window->visual->dpy, window->window)) {
c9d44c649b67bea43e7549e2bf52870db9e770d0dugan renderDestroyWindow(window->visual->dpy, window->window);
0253a7dc97ec1ab462376979562c69636573904aJnRouvignac crError( "No support for non-DirectColor visuals with LUTs" );
0253a7dc97ec1ab462376979562c69636573904aJnRouvignac cmap = XCreateColormap( dpy, RootWindow(dpy, vi->screen),
return cmap;
static Colormap
int i, numCmaps;
for (i = 0 ; i < numCmaps ; i++)
return cmap;
return cmap;
(void)display;
int value = 0;
return value;
static XVisualInfo *
if (vis)
return vis;
return NULL;
#ifdef GLX_VERSION_1_3
static GLXFBConfig
return fbconfig[0];
for (i = 0; i < numConfigs; i++) {
return fbconfig[i];
return fbconfig[0];
const char *dpyName;
int screen;
#ifdef USE_OSMESA
return GL_TRUE;
if (!dpyName)
return GL_FALSE;
if (dpyName &&
return GL_FALSE;
return GL_FALSE;
#ifdef GLX_VERSION_1_3
dpyName, s );
return GL_FALSE;
dpyName, s );
return GL_FALSE;
int id;
return GL_TRUE;
const char *ext;
Bool b;
crWarning("Render SPU: nv_swap_group is set but GLX_NV_swap_group is not supported on this system!");
static GLboolean
char *name;
unsigned long flags;
unsigned int vncWin;
#ifdef USE_OSMESA
return GL_TRUE;
window->x = 0;
window->y = 0;
CRASSERT(window->BltInfo.height >= 1);*/
if ( !cmap ) {
return GL_FALSE;
* See dmx.conf for example.
if (vncWin)
if (render_spu_parent_window_id>0)
return GL_FALSE;
/* Disable border/decorations with an MWM property (observed by most
if (prop) {
char clearByte = 0;
if(!pixmap){
return GL_FALSE;
if(!cursor){
return GL_FALSE;
if (showIt) {
return GL_TRUE;
static GLboolean
window->x = 0;
window->y = 0;
#ifdef GLX_VERSION_1_3
attribs[i++] = w;
attribs[i++] = h;
return GL_TRUE;
return GL_FALSE;
return GL_FALSE;
#ifdef USE_OSMESA
#ifdef GLX_VERSION_1_3
renderspu_SystemCreateContext( VisualInfo *visual, ContextInfo *context, ContextInfo *sharedContext )
#ifdef USE_OSMESA
return GL_TRUE;
return GL_FALSE;
#ifdef GLX_VERSION_1_3
return GL_FALSE;
return GL_FALSE;
return GL_TRUE;
#define USE_GLX_COPYCONTEXT 0
#if !USE_GLX_COPYCONTEXT
struct saved_state
if (s->Lighting) {
if (s->LightEnabled[i]) {
if (s->DepthTest)
long templateFlags;
if (!vis)
#ifdef USE_OSMESA
#ifdef USE_OSMESA
crDebug("Render SPU: dimensions changed to %d x %d", window->BltInfo.width, window->BltInfo.height);
Bool b;
#ifdef USE_OSMESA
crDebug("Render SPU: MakeCurrent visual mismatch (win(%d) bits:0x%x != ctx(%d) bits:0x%x); remaking window.",
#ifndef SOLARIS_9_X_BUG
if (!conn)
&& nativeWindow)
#if !USE_GLX_COPYCONTEXT
CRASSERT(b);
#if !USE_GLX_COPYCONTEXT
if (recreated) {
(unsigned int) nativeWindow,
CRASSERT(b);
if (pCurCtx)
/* XXX disabled for now due to problem with threadtest.conf */
#ifdef USE_OSMESA
#ifdef CHROMIUM_THREADSAFE
int attempt;
#ifdef USE_OSMESA
*x = rx;
*y = ry;
*w = (int) width;
*h = (int) height;
int scrn;
#ifdef USE_OSMESA
#ifdef USE_OSMESA
#ifdef USE_OSMESA
if (cRects>0)
for (i=0; i<cRects; ++i)
pXRects[0].x = 0;
pXRects[0].y = 0;
crDebug("Render SPU: XShapeCombineRectangles (%x, %x, cRects=%i)", window->visual->dpy, window->window, cRects);
#ifdef USE_OSMESA
if (showIt)
void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
if (!gc) {
CRASSERT(w);
if (first) {
first = 0;
usleep(k);
if (w->nativeWindow) {
MarkWindow(w);
(void) MarkWindow;