diff options
Diffstat (limited to 'src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c')
| -rw-r--r-- | src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c index a6e6103f..64ef9462 100644 --- a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c +++ b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c @@ -427,18 +427,25 @@ crServerDispatchSwapBuffers( GLint window, GLint flags ) ctx = crStateGetCurrent(); + CRASSERT(cr_server.curClient && cr_server.curClient->currentMural == mural); + if (ctx->framebufferobject.drawFB || (ctx->buffer.drawBuffer != GL_FRONT && ctx->buffer.drawBuffer != GL_FRONT_LEFT)) - cr_server.curClient->currentMural->bFbDraw = GL_FALSE; + mural->bFbDraw = GL_FALSE; + + CR_SERVER_DUMP_SWAPBUFFERS_ENTER(); if (crServerIsRedirectedToFBO()) { + crServerMuralFBOSwapBuffers(mural); crServerPresentFBO(mural); } else { cr_server.head_spu->dispatch_table.SwapBuffers( mural->spuWindow, flags ); } + + CR_SERVER_DUMP_SWAPBUFFERS_LEAVE(); } void SERVER_DISPATCH_APIENTRY @@ -447,20 +454,19 @@ crServerDispatchFlush(void) CRContext *ctx = crStateGetCurrent(); cr_server.head_spu->dispatch_table.Flush(); - if (!cr_server.curClient->currentMural) /* <- on window destroy this will be zero */ - return; - - if (cr_server.curClient->currentMural->bFbDraw && crServerIsRedirectedToFBO()) + if (cr_server.curClient && cr_server.curClient->currentMural) { -#ifdef DEBUG_misha - CRASSERT(0); -#endif - crServerPresentFBO(cr_server.curClient->currentMural); - } + CRMuralInfo *mural = cr_server.curClient->currentMural; + if (mural->bFbDraw) + { + if (crServerIsRedirectedToFBO()) + crServerPresentFBO(mural); + } - if (ctx->framebufferobject.drawFB - || (ctx->buffer.drawBuffer != GL_FRONT && ctx->buffer.drawBuffer != GL_FRONT_LEFT)) - cr_server.curClient->currentMural->bFbDraw = GL_FALSE; + if (ctx->framebufferobject.drawFB + || (ctx->buffer.drawBuffer != GL_FRONT && ctx->buffer.drawBuffer != GL_FRONT_LEFT)) + mural->bFbDraw = GL_FALSE; + } } void SERVER_DISPATCH_APIENTRY @@ -470,15 +476,17 @@ crServerDispatchFinish(void) cr_server.head_spu->dispatch_table.Finish(); - if (cr_server.curClient->currentMural->bFbDraw && crServerIsRedirectedToFBO()) + if (cr_server.curClient && cr_server.curClient->currentMural) { -#ifdef DEBUG_misha - CRASSERT(0); -#endif - crServerPresentFBO(cr_server.curClient->currentMural); - } + CRMuralInfo *mural = cr_server.curClient->currentMural; + if (mural->bFbDraw) + { + if (crServerIsRedirectedToFBO()) + crServerPresentFBO(mural); + } - if (ctx->framebufferobject.drawFB - || (ctx->buffer.drawBuffer != GL_FRONT && ctx->buffer.drawBuffer != GL_FRONT_LEFT)) - cr_server.curClient->currentMural->bFbDraw = GL_FALSE; + if (ctx->framebufferobject.drawFB + || (ctx->buffer.drawBuffer != GL_FRONT && ctx->buffer.drawBuffer != GL_FRONT_LEFT)) + mural->bFbDraw = GL_FALSE; + } } |
