summaryrefslogtreecommitdiff
path: root/src/VBox/HostServices/SharedOpenGL
diff options
context:
space:
mode:
authorFelix Geyer <debfx-pkg@fobos.de>2010-05-08 14:05:01 +0200
committerFelix Geyer <debfx-pkg@fobos.de>2010-05-08 14:05:01 +0200
commit33961db1e2718be932cefe0b32aae173ae760cea (patch)
tree800f8bf4b1d5e4b9505a30270f0c170342abb43d /src/VBox/HostServices/SharedOpenGL
parent4749e3a0c5d3a159d3ae751e6780b537c860923a (diff)
downloadvirtualbox-33961db1e2718be932cefe0b32aae173ae760cea.tar.gz
Imported Upstream version 3.1.52-dfsgupstream/3.1.52-dfsg
Diffstat (limited to 'src/VBox/HostServices/SharedOpenGL')
-rw-r--r--src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp4
-rw-r--r--src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c20
-rw-r--r--src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c7
-rw-r--r--src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c2
-rw-r--r--src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c2
-rw-r--r--src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m14
6 files changed, 42 insertions, 7 deletions
diff --git a/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp b/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
index b6c0b78db..818a9e550 100644
--- a/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
+++ b/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
@@ -1,4 +1,4 @@
-/* $Id: crservice.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */
+/* $Id: crservice.cpp 29019 2010-05-04 13:57:05Z vboxsync $ */
/** @file
* VBox crOpenGL: Host service entry points.
@@ -64,7 +64,7 @@ static PVM g_pVM = NULL;
#endif
static const char* gszVBoxOGLSSMMagic = "***OpenGL state data***";
-#define SHCROGL_SSM_VERSION 18
+#define SHCROGL_SSM_VERSION 19
static DECLCALLBACK(int) svcUnload (void *)
{
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
index 51cf52b9c..ebcc614b7 100644
--- a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
+++ b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
@@ -181,7 +181,7 @@ crServerDispatchDestroyContext( GLint ctx )
void SERVER_DISPATCH_APIENTRY
crServerDispatchMakeCurrent( GLint window, GLint nativeWindow, GLint context )
{
- CRMuralInfo *mural;
+ CRMuralInfo *mural, *oldMural;
CRContext *ctx;
if (context >= 0 && window >= 0) {
@@ -204,6 +204,14 @@ crServerDispatchMakeCurrent( GLint window, GLint nativeWindow, GLint context )
}
}
else {
+ oldMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, cr_server.currentWindow);
+ if (oldMural && oldMural->bUseFBO
+ && crServerSupportRedirMuralFBO()
+ && !crStateGetCurrent()->framebufferobject.drawFB)
+ {
+ cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ }
+
ctx = cr_server.DummyContext;
window = -1;
mural = NULL;
@@ -245,6 +253,8 @@ crServerDispatchMakeCurrent( GLint window, GLint nativeWindow, GLint context )
cr_server.currentWindow, window);
*/
+ oldMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, cr_server.currentWindow);
+
if (1/*cr_server.firstCallMakeCurrent ||
cr_server.currentWindow != window ||
cr_server.currentNativeWindow != nativeWindow*/) {
@@ -265,5 +275,13 @@ crServerDispatchMakeCurrent( GLint window, GLint nativeWindow, GLint context )
/* This used to be earlier, after crStateUpdateColorBits() call */
crStateMakeCurrent( ctx );
+
+ if (oldMural != mural && crServerSupportRedirMuralFBO())
+ {
+ if (!crStateGetCurrent()->framebufferobject.drawFB)
+ {
+ cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_FRAMEBUFFER_EXT, mural->bUseFBO ? mural->idFBO:0);
+ }
+ }
}
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
index f0246dd2c..695a6f7fc 100644
--- a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
+++ b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
@@ -871,7 +871,12 @@ DECLEXPORT(int32_t) crVBoxServerLoadState(PSSMHANDLE pSSM, uint32_t version)
/* Restore windows geometry info */
crServerDispatchWindowSize(key, muralInfo.width, muralInfo.height);
crServerDispatchWindowPosition(key, muralInfo.gX, muralInfo.gY);
- crServerDispatchWindowVisibleRegion(key, muralInfo.cVisibleRects, muralInfo.pVisibleRects);
+ /* Same workaround as described in stub.c:stubUpdateWindowVisibileRegions for compiz on a freshly booted VM*/
+ if (muralInfo.cVisibleRects)
+ {
+ crServerDispatchWindowVisibleRegion(key, muralInfo.cVisibleRects, muralInfo.pVisibleRects);
+ }
+ crServerDispatchWindowShow(key, muralInfo.bVisible);
if (muralInfo.pVisibleRects)
{
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
index 98aa4325e..2d04295b5 100644
--- a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
+++ b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
@@ -181,6 +181,8 @@ crServerDispatchWindowDestroy( GLint window )
if (cr_server.currentWindow == window)
{
cr_server.currentWindow = -1;
+ crServerRedirMuralFBO(mural, GL_FALSE);
+ crServerDeleteMuralFBO(mural);
}
crHashtableDelete(cr_server.pWindowCreateInfoTable, window, crServerCreateInfoDeleteCB);
diff --git a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c
index 920d55090..775d819cf 100644
--- a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c
+++ b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c
@@ -118,6 +118,8 @@ void renderspu_SystemWindowPosition(WindowInfo *pWinInfo, GLint x, GLint y)
NativeViewRef pParentWin = (NativeViewRef)(uint32_t)render_spu_parent_window_id;
#endif /* __LP64__ */
+ /*pParentWin is unused in the call, overwise it might hold incorrect value if for ex. last reparent call was for
+ a different screen*/
cocoaViewSetPosition(pWinInfo->window, pParentWin, x, y);
}
diff --git a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
index c6c6e46e8..32a5ac654 100644
--- a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
+++ b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
@@ -1352,12 +1352,20 @@ void cocoaViewReparent(NativeViewRef pView, NativeViewRef pParentView)
if (pOView)
{
/* Make sure the window is removed from any previous parent window. */
- [[[pOView overlayWin] parentWindow] removeChildWindow:[pOView overlayWin]];
+ if ([[pOView overlayWin] parentWindow] != nil)
+ {
+ [[[pOView overlayWin] parentWindow] removeChildWindow:[pOView overlayWin]];
+ }
+
/* Set the new parent view */
[pOView setParentView: pParentView];
+
/* Add the overlay window as a child to the new parent window */
- [[pParentView window] addChildWindow:[pOView overlayWin] ordered:NSWindowAbove];
- [pOView createFBO];
+ if (pParentView != nil)
+ {
+ [[pParentView window] addChildWindow:[pOView overlayWin] ordered:NSWindowAbove];
+ [pOView createFBO];
+ }
}
[pPool release];