Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h	(revision 78250)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h	(revision 78251)
@@ -104,10 +104,4 @@
     int nvSwapGroup;
 
-#ifdef USE_OSMESA
-    GLubyte *buffer;    /**< for rendering to off screen buffer.  */
-    int in_buffer_width;
-    int in_buffer_height;
-#endif
-
 } WindowInfo;
 
@@ -253,17 +247,4 @@
 
     PFNVCRSERVER_CLIENT_CALLOUT pfnClientCallout;
-
-#ifdef USE_OSMESA
-    /** Off screen rendering hooks.  */
-    int use_osmesa;
-
-    OSMesaContext (*OSMesaCreateContext)( GLenum format, OSMesaContext sharelist );
-    GLboolean (* OSMesaMakeCurrent)( OSMesaContext ctx,
-                     GLubyte *buffer,
-                     GLenum type,
-                     GLsizei width,
-                     GLsizei height );
-    void (*OSMesaDestroyContext)( OSMesaContext ctx );
-#endif
 
 #if defined(GLX)
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c	(revision 78250)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c	(revision 78251)
@@ -669,12 +669,4 @@
 
     CRASSERT(visual);
-
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa) {
-        /* A dummy visual - being non null is enough.  */
-        visual->visual =(XVisualInfo *) "os";
-        return GL_TRUE;
-    }
-#endif
     
     dpyName = renderspuGetDisplayName();
@@ -862,9 +854,4 @@
     window->nativeWindow = 0;
 
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa)
-        return GL_TRUE;
-#endif
-
     dpy = visual->dpy;
 
@@ -1162,33 +1149,23 @@
     CRASSERT(window->visual);
 
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa) 
-    {
-        crFree(window->buffer);
-        window->buffer = NULL;
-    }
-    else
+    if (window->visual->visAttribs & CR_PBUFFER_BIT) {
+#ifdef GLX_VERSION_1_3
+        render_spu.ws.glXDestroyPbuffer(window->visual->dpy, window->window);
 #endif
-    {
-        if (window->visual->visAttribs & CR_PBUFFER_BIT) {
-#ifdef GLX_VERSION_1_3
-            render_spu.ws.glXDestroyPbuffer(window->visual->dpy, window->window);
-#endif
-        }
-        else {
-            /* The value window->nativeWindow will only be non-NULL if the
-             * render_to_app_window option is set to true.  In this case, we
-             * don't want to do anything, since we're not responsible for this
-             * window.  I know...personal responsibility and all...
-             */
-            if (!window->nativeWindow) {
-                if (window->BltInfo.Base.id != CR_RENDER_WINCMD_ID)
-                {
-                    int rc = renderspuWinCmdSubmit(CR_RENDER_WINCMD_TYPE_WIN_ON_DESTROY, window);
-                    AssertRC(rc);
-                }
-                XDestroyWindow(window->visual->dpy, window->window);
-                XSync(window->visual->dpy, 0);
-            }
+    }
+    else {
+        /* The value window->nativeWindow will only be non-NULL if the
+         * render_to_app_window option is set to true.  In this case, we
+         * don't want to do anything, since we're not responsible for this
+         * window.  I know...personal responsibility and all...
+         */
+        if (!window->nativeWindow) {
+            if (window->BltInfo.Base.id != CR_RENDER_WINCMD_ID)
+            {
+                int rc = renderspuWinCmdSubmit(CR_RENDER_WINCMD_TYPE_WIN_ON_DESTROY, window);
+                AssertRC(rc);
+            }
+            XDestroyWindow(window->visual->dpy, window->window);
+            XSync(window->visual->dpy, 0);
         }
     }
@@ -1212,16 +1189,4 @@
         sharedSystemContext = sharedContext->context;
     }
-
-
-
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa) {
-        context->context = (GLXContext) render_spu.OSMesaCreateContext(OSMESA_RGB, 0);
-        if (context->context)
-            return GL_TRUE;
-        else
-            return GL_FALSE;
-    }
-#endif
 
 #ifdef  GLX_VERSION_1_3
@@ -1380,41 +1345,11 @@
 renderspu_SystemDestroyContext( ContextInfo *context )
 {
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa) 
-    {
-        render_spu.OSMesaDestroyContext( (OSMesaContext) context->context );
-    }
-    else
+#if 0
+    /* XXX disable for now - causes segfaults w/ NVIDIA's driver */
+    render_spu.ws.glXDestroyContext( context->visual->dpy, context->context );
 #endif
-    {
-#if 0
-        /* XXX disable for now - causes segfaults w/ NVIDIA's driver */
-        render_spu.ws.glXDestroyContext( context->visual->dpy, context->context );
-#endif
-    }
     context->visual = NULL;
     context->context = 0;
 }
-
-
-#ifdef USE_OSMESA
-static void
-check_buffer_size( WindowInfo *window )
-{
-    if (window->BltInfo.width != window->in_buffer_width
-        || window->BltInfo.height != window->in_buffer_height
-        || ! window->buffer) {
-        crFree(window->buffer);
-
-        window->buffer = crCalloc(window->BltInfo.width * window->BltInfo.height
-                                                            * 4 * sizeof (GLubyte));
-        
-        window->in_buffer_width = window->BltInfo.width;
-        window->in_buffer_height = window->BltInfo.height;
-
-        crDebug("Render SPU: dimensions changed to %d x %d", window->BltInfo.width, window->BltInfo.height);
-    }
-}
-#endif
 
 
@@ -1428,14 +1363,4 @@
 
     /*crDebug("%s nativeWindow=0x%x", __FUNCTION__, (int) nativeWindow);*/
-
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa) {
-        check_buffer_size(window);
-        render_spu.OSMesaMakeCurrent( (OSMesaContext) context->context, 
-                                                                    window->buffer, GL_UNSIGNED_BYTE,
-                                                                    window->BltInfo.width, window->BltInfo.height);
-        return;
-    }
-#endif
 
     nativeWindow = 0;
@@ -1618,13 +1543,4 @@
 renderspu_SystemWindowSize( WindowInfo *window, GLint w, GLint h )
 {
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa) {
-        window->BltInfo.width = w;
-        window->BltInfo.height = h;
-        check_buffer_size(window);
-        return;
-    }
-#endif
-
     CRASSERT(window);
     CRASSERT(window->visual);
@@ -1730,12 +1646,4 @@
                                    GLint *x, GLint *y, GLint *w, GLint *h )
 {
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa) {
-        *w = window->BltInfo.width;
-        *h = window->BltInfo.height;
-        return;
-    }
-#endif
-
     CRASSERT(window);
     CRASSERT(window->visual);
@@ -1781,12 +1689,5 @@
 renderspu_SystemGetMaxWindowSize( WindowInfo *window, GLint *w, GLint *h )
 {
-     int scrn;
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa) {
-        *w = 2048;
-        *h = 2048;
-        return;
-    }
-#endif
+    int scrn;
 
     CRASSERT(window);
@@ -1803,9 +1704,4 @@
 renderspu_SystemWindowPosition( WindowInfo *window, GLint x, GLint y )
 {
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa)
-        return;
-#endif
-
     CRASSERT(window);
     CRASSERT(window->visual);
@@ -1826,9 +1722,4 @@
 renderspu_SystemWindowVisibleRegion( WindowInfo *window, GLint cRects, const GLint *pRects )
 {
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa)
-        return;
-#endif
-
     CRASSERT(window);
     CRASSERT(window->visual);
@@ -1879,9 +1770,4 @@
 renderspu_SystemShowWindow( WindowInfo *window, GLboolean showIt )
 {
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa)
-        return;
-#endif
-
     if (window->visual->dpy && window->window &&
             (window->visual->visAttribs & CR_PBUFFER_BIT) == 0)
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c	(revision 78250)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c	(revision 78251)
@@ -224,13 +224,4 @@
         return NULL;
     }
-#ifdef USE_OSMESA
-    if (render_spu.use_osmesa) {
-        if (!crLoadOSMesa(&render_spu.OSMesaCreateContext,
-                          &render_spu.OSMesaMakeCurrent,
-                          &render_spu.OSMesaDestroyContext)) {
-            crError("Unable to load OSMesa library");
-        }
-    }
-#endif
 
     rc = renderspuDefaultCtxInit();
