Index: /trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h	(revision 48290)
+++ /trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h	(revision 48291)
@@ -45,4 +45,9 @@
 }
 
+DECLINLINE(bool) CrGlslIsInited(const CR_GLSL_CACHE *pCache)
+{
+    return !!pCache->pDispatch;
+}
+
 /* clients should set proper context before calling these funcs */
 VBOXBLITTERDECL(bool) CrGlslIsSupported(CR_GLSL_CACHE *pCache);
@@ -52,5 +57,5 @@
 VBOXBLITTERDECL(int) CrGlslProgUseNoAlpha(const CR_GLSL_CACHE *pCache, GLenum enmTexTarget);
 VBOXBLITTERDECL(void) CrGlslProgClear(const CR_GLSL_CACHE *pCache);
-VBOXBLITTERDECL(bool) CrGlslNeedsCleanup(CR_GLSL_CACHE *pCache);
+VBOXBLITTERDECL(bool) CrGlslNeedsCleanup(const CR_GLSL_CACHE *pCache);
 VBOXBLITTERDECL(void) CrGlslCleanup(CR_GLSL_CACHE *pCache);
 VBOXBLITTERDECL(void) CrGlslTerm(CR_GLSL_CACHE *pCache);
Index: /trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp	(revision 48290)
+++ /trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp	(revision 48291)
@@ -841,14 +841,15 @@
 #define CR_GLSL_STR_V_120 "#version 120\n"
 #define CR_GLSL_STR_EXT_TR "#extension GL_ARB_texture_rectangle : enable\n"
-#define CR_GLSL_STR_TEX2D "texture2D"
-#define CR_GLSL_STR_TEX2DRECT "texture2DRect"
+#define CR_GLSL_STR_2D "2D"
+#define CR_GLSL_STR_2DRECT "2DRect"
 
 #define CR_GLSL_PATTERN_FS_NOALPHA(_ver, _ext, _tex) \
         _ver \
         _ext \
+        "uniform sampler" _tex " sampler0;\n" \
         "void main()\n" \
         "{\n" \
             "vec2 srcCoord = vec2(gl_TexCoord[0]);\n" \
-            "gl_FragData[0].xyz = (" _tex "(0, srcCoord).xyz);\n" \
+            "gl_FragData[0].xyz = (texture" _tex "(sampler0, srcCoord).xyz);\n" \
             "gl_FragData[0].w = 1.0;\n" \
         "}\n"
@@ -865,7 +866,7 @@
     {
         if (enmTexTarget == GL_TEXTURE_2D)
-            return CR_GLSL_PATTERN_FS_NOALPHA(CR_GLSL_STR_V_120, "", CR_GLSL_STR_TEX2D);
+            return CR_GLSL_PATTERN_FS_NOALPHA(CR_GLSL_STR_V_120, "", CR_GLSL_STR_2D);
         else if (enmTexTarget == GL_TEXTURE_RECTANGLE_ARB)
-            return CR_GLSL_PATTERN_FS_NOALPHA(CR_GLSL_STR_V_120, CR_GLSL_STR_EXT_TR, CR_GLSL_STR_TEX2DRECT);
+            return CR_GLSL_PATTERN_FS_NOALPHA(CR_GLSL_STR_V_120, CR_GLSL_STR_EXT_TR, CR_GLSL_STR_2DRECT);
 
         crWarning("invalid enmTexTarget %#x", enmTexTarget);
@@ -875,7 +876,7 @@
     {
         if (enmTexTarget == GL_TEXTURE_2D)
-            return CR_GLSL_PATTERN_FS_NOALPHA("", "", CR_GLSL_STR_TEX2D);
+            return CR_GLSL_PATTERN_FS_NOALPHA("", "", CR_GLSL_STR_2D);
         else if (enmTexTarget == GL_TEXTURE_RECTANGLE_ARB)
-            return CR_GLSL_PATTERN_FS_NOALPHA("", CR_GLSL_STR_EXT_TR, CR_GLSL_STR_TEX2DRECT);
+            return CR_GLSL_PATTERN_FS_NOALPHA("", CR_GLSL_STR_EXT_TR, CR_GLSL_STR_2DRECT);
 
         crWarning("invalid enmTexTarget %#x", enmTexTarget);
@@ -901,4 +902,5 @@
     GLchar * pBuf = NULL;
     GLuint uiProgram = 0;
+    GLint iUniform = -1;
     GLuint uiShader = pCache->pDispatch->CreateShader(GL_FRAGMENT_SHADER);
     if (!uiShader)
@@ -924,9 +926,10 @@
 #ifdef DEBUG_misha
         if (compiled)
-            crDebug("compile success:\n-------------------\n%d\n--------\n", pBuf);
+            crDebug("compile success:\n-------------------\n%s\n--------\n", pBuf);
         else
 #endif
         {
-            crWarning("compile FAILURE:\n-------------------\n%d\n--------\n", pBuf);
+            Assert(0);
+            crWarning("compile FAILURE:\n-------------------\n%s\n--------\n", pBuf);
             rc = VERR_NOT_SUPPORTED;
             goto end;
@@ -958,9 +961,10 @@
 #ifdef DEBUG_misha
         if (linked)
-            crDebug("link success:\n-------------------\n%d\n--------\n", pBuf);
+            crDebug("link success:\n-------------------\n%s\n--------\n", pBuf);
         else
 #endif
         {
-            crWarning("link FAILURE:\n-------------------\n%d\n--------\n", pBuf);
+            Assert(0);
+            crWarning("link FAILURE:\n-------------------\n%s\n--------\n", pBuf);
             rc = VERR_NOT_SUPPORTED;
             goto end;
@@ -969,4 +973,14 @@
 
     Assert(linked);
+
+    iUniform = pCache->pDispatch->GetUniformLocation(uiProgram, "sampler0");
+    if (iUniform == -1)
+    {
+        crWarning("GetUniformLocation failed for sampler0");
+    }
+    else
+    {
+        pCache->pDispatch->Uniform1i(iUniform, 0);
+    }
 
     *puiProgram = uiProgram;
@@ -1088,5 +1102,5 @@
 }
 
-VBOXBLITTERDECL(bool) CrGlslNeedsCleanup(CR_GLSL_CACHE *pCache)
+VBOXBLITTERDECL(bool) CrGlslNeedsCleanup(const CR_GLSL_CACHE *pCache)
 {
     return pCache->uNoAlpha2DProg || pCache->uNoAlpha2DRectProg;
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c	(revision 48290)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c	(revision 48291)
@@ -298,6 +298,5 @@
     if (render_spu.defaultSharedContext == context)
     {
-        renderspuContextRelease(render_spu.defaultSharedContext);
-        render_spu.defaultSharedContext = NULL;
+        renderspuSetDefaultSharedContext(NULL);
     }
 
@@ -317,18 +316,31 @@
 }
 
-
-void RENDER_APIENTRY
-renderspuMakeCurrent(GLint crWindow, GLint nativeWindow, GLint ctx)
-{
-    WindowInfo *window;
-    ContextInfo *context;
-
-    /*
-    crDebug("%s win=%d native=0x%x ctx=%d", __FUNCTION__, crWindow, (int) nativeWindow, ctx);
-    */
-
-    window = (WindowInfo *) crHashtableSearch(render_spu.windowTable, crWindow);
-    context = (ContextInfo *) crHashtableSearch(render_spu.contextTable, ctx);
-
+WindowInfo* renderspuGetDummyWindow(GLint visBits)
+{
+    WindowInfo *window = (WindowInfo *) crHashtableSearch(render_spu.dummyWindowTable, visBits);
+    if (!window)
+    {
+        window = (WindowInfo *)crAlloc(sizeof (*window));
+        if (!window)
+        {
+            crWarning("crAlloc failed");
+            return NULL;
+        }
+
+        if (!renderspuWindowInit(window, NULL, visBits, -1))
+        {
+            crWarning("renderspuWindowInit failed");
+            crFree(window);
+            return NULL;
+        }
+
+        crHashtableAdd(render_spu.dummyWindowTable, visBits, window);
+    }
+
+    return window;
+}
+
+void renderspuPerformMakeCurrent(WindowInfo *window, GLint nativeWindow, ContextInfo *context)
+{
     if (window && context)
     {
@@ -341,10 +353,10 @@
         if (!window)
         {
-            crDebug("Render SPU: MakeCurrent invalid window id: %d", crWindow);
+            crDebug("Render SPU: MakeCurrent invalid window id: %d", window->BltInfo.Base.id);
             return;
         }
         if (!context)
         {
-            crDebug("Render SPU: MakeCurrent invalid context id: %d", ctx);
+            crDebug("Render SPU: MakeCurrent invalid context id: %d", context->BltInfo.Base.id);
             return;
         }
@@ -367,5 +379,5 @@
             context->everCurrent = GL_TRUE;
         }
-        if (crWindow == CR_RENDER_DEFAULT_WINDOW_ID && window->mapPending &&
+        if (window->BltInfo.Base.id == CR_RENDER_DEFAULT_WINDOW_ID && window->mapPending &&
                 !render_spu.render_to_app_window && !render_spu.render_to_crut_window) {
             /* Window[CR_RENDER_DEFAULT_CONTEXT_ID] is special, it's the default window and normally hidden.
@@ -378,5 +390,5 @@
         window->everCurrent = GL_TRUE;
     }
-    else if (!crWindow && !ctx)
+    else if (!window && !context)
     {
         renderspu_SystemMakeCurrent( NULL, 0, NULL );
@@ -389,9 +401,50 @@
     else
     {
-        crError("renderspuMakeCurrent invalid ids: crWindow(%d), ctx(%d)", crWindow, ctx);
-    }
-}
-
-GLboolean renderspuWindowInit( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id )
+        crError("renderspuMakeCurrent invalid ids: crWindow(%d), ctx(%d)",
+                window ? window->BltInfo.Base.id : 0,
+                context ? context->BltInfo.Base.id : 0);
+    }
+}
+
+void RENDER_APIENTRY
+renderspuMakeCurrent(GLint crWindow, GLint nativeWindow, GLint ctx)
+{
+    WindowInfo *window = NULL;
+    ContextInfo *context = NULL;
+
+    /*
+    crDebug("%s win=%d native=0x%x ctx=%d", __FUNCTION__, crWindow, (int) nativeWindow, ctx);
+    */
+
+    if (crWindow)
+    {
+        window = (WindowInfo *) crHashtableSearch(render_spu.windowTable, crWindow);
+        if (!window)
+        {
+            crWarning("invalid window %d specified", crWindow);
+            return;
+        }
+    }
+
+    if (ctx)
+    {
+        context = (ContextInfo *) crHashtableSearch(render_spu.contextTable, ctx);
+        if (!context)
+        {
+            crWarning("invalid context %d specified", ctx);
+            return;
+        }
+    }
+
+    if (!context != !window)
+    {
+        crWarning("either window %d or context %d are zero", crWindow, ctx);
+        return;
+    }
+
+    renderspuPerformMakeCurrent(window, nativeWindow, context);
+}
+
+GLboolean renderspuWindowInitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id )
 {
     crMemset(window, 0, sizeof (*window));
@@ -449,29 +502,9 @@
  * Window functions
  */
-
-GLint renderspuWindowCreateEx( const char *dpyName, GLint visBits, GLint id )
-{
-    WindowInfo *window;
+GLboolean renderspuWindowInit(WindowInfo *pWindow, const char *dpyName, GLint visBits, GLint id)
+{
     VisualInfo *visual;
-    GLboolean showIt;
-
-    if (id <= 0)
-    {
-        id = (GLint)crHashtableAllocKeys(render_spu.windowTable, 1);
-        if (id <= 0)
-        {
-            crWarning("failed to allocate window id");
-            return -1;
-        }
-    }
-    else
-    {
-        if (crHashtableIsKeyUsed(render_spu.windowTable, id))
-        {
-            crWarning("the specified window key %d is in use", id);
-            return -1;
-        }
-    }
-
+
+    crMemset(pWindow, 0, sizeof (*pWindow));
 
     if (!dpyName || crStrlen(render_spu.display_string) > 0)
@@ -482,18 +515,6 @@
     {
         crWarning( "Render SPU: Couldn't create a window, renderspuFindVisual returned NULL" );
-        return -1;
-    }
-
-    /* Allocate WindowInfo */
-    window = (WindowInfo *) crCalloc(sizeof(WindowInfo));
-    if (!window)
-    {
-        crWarning( "Render SPU: Couldn't create a window" );
-        return -1;
-    }
-    
-    crHashtableAdd(render_spu.windowTable, id, window);
-
-    showIt = 0;
+        return GL_FALSE;
+    }
 
     /*
@@ -501,11 +522,53 @@
     */
     /* Have GLX/WGL/AGL create the window */
-    if (!renderspuWindowInit( window, visual, showIt, id ))
-    {
+    if (!renderspuWindowInitWithVisual( pWindow, visual, 0, id ))
+    {
+        crWarning( "Render SPU: Couldn't create a window, renderspu_SystemCreateWindow failed" );
+        return GL_FALSE;
+    }
+
+    return GL_TRUE;
+}
+
+GLint renderspuWindowCreateEx( const char *dpyName, GLint visBits, GLint id )
+{
+    WindowInfo *window;
+
+    GLboolean showIt;
+
+    if (id <= 0)
+    {
+        id = (GLint)crHashtableAllocKeys(render_spu.windowTable, 1);
+        if (id <= 0)
+        {
+            crWarning("failed to allocate window id");
+            return -1;
+        }
+    }
+    else
+    {
+        if (crHashtableIsKeyUsed(render_spu.windowTable, id))
+        {
+            crWarning("the specified window key %d is in use", id);
+            return -1;
+        }
+    }
+
+    /* Allocate WindowInfo */
+    window = (WindowInfo *) crCalloc(sizeof(WindowInfo));
+    if (!window)
+    {
+        crWarning( "Render SPU: Couldn't create a window" );
+        return -1;
+    }
+    
+    if (!renderspuWindowInit(window, dpyName, visBits, id))
+    {
+        crWarning("renderspuWindowInit failed");
         crFree(window);
-        crWarning( "Render SPU: Couldn't create a window, renderspu_SystemCreateWindow failed" );
         return -1;
     }
-    
+
+    crHashtableAdd(render_spu.windowTable, id, window);
     return window->BltInfo.Base.id;
 }
@@ -1260,5 +1323,17 @@
  * Misc functions
  */
-
+void renderspuSetDefaultSharedContext(ContextInfo *pCtx)
+{
+    if (pCtx == render_spu.defaultSharedContext)
+        return;
+
+    renderspu_SystemDefaultSharedContextChanged(render_spu.defaultSharedContext, pCtx);
+
+    if (render_spu.defaultSharedContext)
+        renderspuContextRelease(render_spu.defaultSharedContext);
+
+    renderspuContextRetain(pCtx);
+    render_spu.defaultSharedContext = pCtx;
+}
 
 
@@ -1269,20 +1344,14 @@
     {
         case GL_HH_SET_DEFAULT_SHARED_CTX:
-            if (render_spu.defaultSharedContext)
-            {
-                renderspuContextRelease(render_spu.defaultSharedContext);
-                render_spu.defaultSharedContext = NULL;
-            }
-
+        {
+            ContextInfo * pCtx = NULL;
             if (value)
-            {
-                render_spu.defaultSharedContext = (ContextInfo *) crHashtableSearch(render_spu.contextTable, value);
-                if (render_spu.defaultSharedContext)
-                    renderspuContextRetain(render_spu.defaultSharedContext);
-                else
-                    crWarning("invalid default shared context id %d", value);
-            }
-
+                pCtx = (ContextInfo *)crHashtableSearch(render_spu.contextTable, value);
+            else
+                crWarning("invalid default shared context id %d", value);
+
+            renderspuSetDefaultSharedContext(pCtx);
             break;
+        }
         default:
 //            crWarning("Unhandled target in renderspuChromiumParameteriCR()");
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h	(revision 48290)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h	(revision 48291)
@@ -259,4 +259,6 @@
     CRHashTable *contextTable;
 
+    CRHashTable *dummyWindowTable;
+
     ContextInfo *defaultSharedContext;
 
@@ -308,5 +310,7 @@
 
 #ifdef RT_OS_DARWIN
-# ifndef VBOX_WITH_COCOA_QT
+# ifdef VBOX_WITH_COCOA_QT
+    CR_GLSL_CACHE GlobalShaders;
+# else
     RgnHandle hRootVisibleRegion;
     RTSEMFASTMUTEX syncMutex;
@@ -364,5 +368,5 @@
 
 
-
+extern void renderspuSetDefaultSharedContext(ContextInfo *pCtx);
 extern void renderspuSetVBoxConfiguration( RenderSPU *spu );
 extern void renderspuMakeVisString( GLbitfield visAttribs, char *s );
@@ -379,9 +383,7 @@
 extern void renderspu_SystemWindowPosition( WindowInfo *window, GLint x, GLint y );
 extern void renderspu_SystemWindowVisibleRegion(WindowInfo *window, GLint cRects, const GLint* pRects);
-
-#ifdef GLX
 extern int renderspu_SystemInit();
 extern int renderspu_SystemTerm();
-#endif
+extern void renderspu_SystemDefaultSharedContextChanged(ContextInfo *fromContext, ContextInfo *toContext);
 extern void renderspu_SystemShowWindow( WindowInfo *window, GLboolean showIt );
 extern void renderspu_SystemMakeCurrent( WindowInfo *window, GLint windowInfor, ContextInfo *context );
@@ -405,5 +407,8 @@
 extern PCR_BLITTER renderspuVBoxPresentBlitterEnsureCreated( WindowInfo *window, int32_t i32MakeCurrentUserData );
 extern void renderspuWindowTerm( WindowInfo *window );
-extern GLboolean renderspuWindowInit( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id );
+extern WindowInfo* renderspuGetDummyWindow(GLint visBits);
+extern void renderspuPerformMakeCurrent(WindowInfo *window, GLint nativeWindow, ContextInfo *context);
+extern GLboolean renderspuWindowInit(WindowInfo *pWindow, const char *dpyName, GLint visBits, GLint id);
+extern GLboolean renderspuWindowInitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id );
 extern GLboolean renderspuInitVisual(VisualInfo *pVisInfo, const char *displayName, GLbitfield visAttribs);
 extern void renderspuVBoxCompositorBlit ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter);
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c	(revision 48290)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c	(revision 48291)
@@ -887,2 +887,16 @@
 }
 
+int renderspu_SystemInit()
+{
+    return VINF_SUCCESS;
+}
+
+int renderspu_SystemTerm()
+{
+    return VINF_SUCCESS;
+}
+
+void renderspu_SystemDefaultSharedContextChanged(ContextInfo *fromContext, ContextInfo *toContext)
+{
+
+}
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c	(revision 48290)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c	(revision 48291)
@@ -187,2 +187,105 @@
 {
 }
+
+int renderspu_SystemInit()
+{
+    return VINF_SUCCESS;
+}
+
+int renderspu_SystemTerm()
+{
+    CrGlslTerm(&render_spu.GlobalShaders);
+    return VINF_SUCCESS;
+}
+
+typedef struct CR_RENDER_CTX_INFO
+{
+    ContextInfo * pContext;
+    WindowInfo * pWindow;
+} CR_RENDER_CTX_INFO;
+
+void renderspuCtxInfoInitCurrent(CR_RENDER_CTX_INFO *pInfo)
+{
+    GET_CONTEXT(pCurCtx);
+    pInfo->pContext = pCurCtx;
+    pInfo->pWindow = pCurCtx->currentWindow;
+}
+
+void renderspuCtxInfoRestoreCurrent(CR_RENDER_CTX_INFO *pInfo)
+{
+    GET_CONTEXT(pCurCtx);
+    if (pCurCtx == pInfo->pContext && (!pCurCtx || pCurCtx->currentWindow == pInfo->pWindow))
+        return;
+    renderspuPerformMakeCurrent(pInfo->pWindow, 0, pInfo->pContext);
+}
+
+GLboolean renderspuCtxSetCurrentWithAnyWindow(ContextInfo * pContext, CR_RENDER_CTX_INFO *pInfo)
+{
+    WindowInfo * window;
+    renderspuCtxInfoInitCurrent(pInfo);
+
+    if (pInfo->pContext == pContext)
+        return GL_TRUE;
+
+    window = pContext->currentWindow;
+    if (!window)
+    {
+        window = renderspuGetDummyWindow(pContext->BltInfo.Base.visualBits);
+        if (!window)
+        {
+            crWarning("renderspuGetDummyWindow failed");
+            return GL_FALSE;
+        }
+    }
+
+    Assert(window);
+
+    renderspuPerformMakeCurrent(window, 0, pContext);
+    return GL_TRUE;
+}
+
+void renderspu_SystemDefaultSharedContextChanged(ContextInfo *fromContext, ContextInfo *toContext)
+{
+    CRASSERT(fromContext != toContext);
+
+    if (!CrGlslIsInited(&render_spu.GlobalShaders))
+    {
+        CrGlslInit(&render_spu.GlobalShaders, render_spu.blitterDispatch);
+    }
+
+    if (fromContext)
+    {
+        if (CrGlslNeedsCleanup(&render_spu.GlobalShaders))
+        {
+            CR_RENDER_CTX_INFO Info;
+            if (renderspuCtxSetCurrentWithAnyWindow(fromContext, &Info))
+            {
+                CrGlslCleanup(&render_spu.GlobalShaders);
+                renderspuCtxInfoRestoreCurrent(&Info);
+            }
+            else
+                crWarning("renderspuCtxSetCurrentWithAnyWindow failed!");
+        }
+    }
+    else
+    {
+        CRASSERT(!CrGlslNeedsCleanup(&render_spu.GlobalShaders));
+    }
+
+    CRASSERT(!CrGlslNeedsCleanup(&render_spu.GlobalShaders));
+
+    if (toContext)
+    {
+        CR_RENDER_CTX_INFO Info;
+        if (renderspuCtxSetCurrentWithAnyWindow(toContext, &Info))
+        {
+            int rc = CrGlslProgGenAllNoAlpha(&render_spu.GlobalShaders);
+            if (!RT_SUCCESS(rc))
+                crWarning("CrGlslProgGenAllNoAlpha failed, rc %d", rc);
+
+            renderspuCtxInfoRestoreCurrent(&Info);
+        }
+        else
+            crWarning("renderspuCtxSetCurrentWithAnyWindow failed!");
+    }
+}
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m	(revision 48290)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m	(revision 48291)
@@ -1089,5 +1089,5 @@
                 if (m_pBlitter)
                 {
-                    int rc = CrBltInit(m_pBlitter, NULL, false, false, NULL, render_spu.blitterDispatch);
+                    int rc = CrBltInit(m_pBlitter, NULL, false, false, &render_spu.GlobalShaders, render_spu.blitterDispatch);
                     if (RT_SUCCESS(rc))
                     {
@@ -1328,5 +1328,5 @@
                     }
                     
-                    CrBltBlitTexMural(m_pBlitter, true, &pEntry->Tex, pSrcRect, pDstRect, 1, fFlags);
+                    CrBltBlitTexMural(m_pBlitter, true, &pEntry->Tex, pSrcRect, pDstRect, 1, fFlags | CRBLT_F_NOALPHA);
                 }
                 CrBltLeave(m_pBlitter);
@@ -1452,5 +1452,5 @@
                             }
                     
-                            CrBltBlitTexMural(m_pBlitter, true, &pEntry->Tex, pSrcRect, pDstRect, 1, fFlags);
+                            CrBltBlitTexMural(m_pBlitter, true, &pEntry->Tex, pSrcRect, pDstRect, 1, fFlags | CRBLT_F_NOALPHA);
                         }
                         CrBltLeave(m_pBlitter);
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c	(revision 48290)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c	(revision 48291)
@@ -448,5 +448,5 @@
             if (bRc)
             {
-                bRc = renderspuWindowInit(&render_spu.WinCmdWindow, &render_spu.WinCmdVisual, GL_FALSE, CR_RENDER_WINCMD_ID);
+                bRc = renderspuWindowInitWithVisual(&render_spu.WinCmdWindow, &render_spu.WinCmdVisual, GL_FALSE, CR_RENDER_WINCMD_ID);
                 if (bRc)
                 {
@@ -458,5 +458,5 @@
                 else
                 {
-                    crError("renderspuWindowInit failed");
+                    crError("renderspuWindowInitWithVisual failed");
                 }
                 /* there is no visual destroy impl currently
@@ -2078,2 +2078,7 @@
     XSync(window->visual->dpy, False);
 }
+
+void renderspu_SystemDefaultSharedContextChanged(ContextInfo *fromContext, ContextInfo *toContext)
+{
+
+}
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c	(revision 48290)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c	(revision 48291)
@@ -142,4 +142,5 @@
     WindowInfo *windowInfo;
     const char * pcpwSetting;
+    int rc;
 
     (void) child;
@@ -194,4 +195,6 @@
     render_spu.contextTable = crAllocHashtableEx(1, INT32_MAX);
     render_spu.windowTable = crAllocHashtableEx(1, INT32_MAX);
+
+    render_spu.dummyWindowTable = crAllocHashtable();
 
     pcpwSetting = crGetenv("CR_RENDER_ENABLE_SINGLE_PRESENT_CONTEXT");
@@ -217,15 +220,10 @@
     CRASSERT(render_spu.default_visual & CR_RGB_BIT);
     
-#ifdef GLX
-    {
-        int rc = renderspu_SystemInit();
-        if (!RT_SUCCESS(rc))
-        {
-            crError("renderspu_SystemInit failed rc %d", rc);
-            return NULL;
-        }
-    }
-#endif
-
+    rc = renderspu_SystemInit();
+    if (!RT_SUCCESS(rc))
+    {
+        crError("renderspu_SystemInit failed rc %d", rc);
+        return NULL;
+    }
 #ifdef USE_OSMESA
     if (render_spu.use_osmesa) {
@@ -444,11 +442,9 @@
     {
         crHashtableWalk(render_spu.windowTable, renderspuBlitterCleanupCB, NULL);
-    }
-
-    if (render_spu.defaultSharedContext)
-    {
-        renderspuContextRelease(render_spu.defaultSharedContext);
-        render_spu.defaultSharedContext = NULL;
-    }
+
+        crHashtableWalk(render_spu.dummyWindowTable, renderspuBlitterCleanupCB, NULL);
+    }
+
+    renderspuSetDefaultSharedContext(NULL);
 
     crFreeHashtable(render_spu.contextTable, DeleteContextCallback);
@@ -456,4 +452,6 @@
     crFreeHashtable(render_spu.windowTable, DeleteWindowCallback);
     render_spu.windowTable = NULL;
+    crFreeHashtable(render_spu.dummyWindowTable, DeleteWindowCallback);
+    render_spu.dummyWindowTable = NULL;
     crFreeHashtable(render_spu.barrierHash, crFree);
     render_spu.barrierHash = NULL;
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c	(revision 48290)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c	(revision 48291)
@@ -1678,2 +1678,17 @@
     SetParent(window->hWnd, (HWND)render_spu_parent_window_id);
 }
+
+int renderspu_SystemInit()
+{
+    return VINF_SUCCESS;
+}
+
+int renderspu_SystemTerm()
+{
+    return VINF_SUCCESS;
+}
+
+void renderspu_SystemDefaultSharedContextChanged(ContextInfo *fromContext, ContextInfo *toContext)
+{
+
+}
