summaryrefslogtreecommitdiff
path: root/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Additions/common/crOpenGL/pack/packspu_context.c')
-rw-r--r--src/VBox/Additions/common/crOpenGL/pack/packspu_context.c70
1 files changed, 69 insertions, 1 deletions
diff --git a/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c b/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
index 90fb5f90..08e41300 100644
--- a/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
+++ b/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
@@ -130,6 +130,8 @@ packspu_VBoxConFlush(GLint con)
CRASSERT(CRPACKSPU_IS_WDDM_CRHGSMI());
CRASSERT(thread->packer);
packspuFlush((void *) thread);
+#else
+ crError("VBoxConFlush not implemented!");
#endif
}
@@ -148,8 +150,17 @@ packspu_VBoxConDestroy(GLint con)
crPackDeleteContext(thread->packer);
+ if (thread->buffer.pack)
+ {
+ crNetFree(thread->netServer.conn, thread->buffer.pack);
+ thread->buffer.pack = NULL;
+ }
+
crNetFreeConnection(thread->netServer.conn);
+ if (thread->netServer.name)
+ crFree(thread->netServer.name);
+
pack_spu.numThreads--;
/*note can't shift the array here, because other threads have TLS references to array elements*/
crMemZero(thread, sizeof(ThreadInfo));
@@ -173,6 +184,63 @@ packspu_VBoxConDestroy(GLint con)
#endif
}
+GLvoid PACKSPU_APIENTRY
+packspu_VBoxConChromiumParameteriCR(GLint con, GLenum param, GLint value)
+{
+ GET_THREAD(thread);
+ CRPackContext * curPacker = crPackGetContext();
+ ThreadInfo *curThread = thread;
+ int writeback = 1;
+ GLint serverCtx = (GLint) -1;
+
+ CRASSERT(!curThread == !curPacker);
+ CRASSERT(!curThread || !curPacker || curThread->packer == curPacker);
+#ifdef CHROMIUM_THREADSAFE
+ crLockMutex(&_PackMutex);
+#endif
+
+#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
+ CRASSERT(!con == !CRPACKSPU_IS_WDDM_CRHGSMI());
+#endif
+
+ if (CRPACKSPU_IS_WDDM_CRHGSMI())
+ {
+ if (!con)
+ {
+ crError("connection should be specified!");
+ return;
+ }
+ thread = GET_THREAD_VAL_ID(con);
+ }
+ else
+ {
+ CRASSERT(!con);
+ if (!thread)
+ {
+ thread = packspuNewThread(
+#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
+ NULL
+#endif
+ );
+ }
+ }
+ CRASSERT(thread);
+ CRASSERT(thread->packer);
+
+ crPackSetContext( thread->packer );
+
+ packspu_ChromiumParameteriCR(param, value);
+
+#ifdef CHROMIUM_THREADSAFE
+ crUnlockMutex(&_PackMutex);
+#endif
+
+ if (CRPACKSPU_IS_WDDM_CRHGSMI())
+ {
+ /* restore the packer context to the tls */
+ crPackSetContext(curPacker);
+ }
+}
GLint PACKSPU_APIENTRY
packspu_VBoxCreateContext( GLint con, const char *dpyName, GLint visual, GLint shareCtx )
@@ -412,7 +480,7 @@ void PACKSPU_APIENTRY packspu_MakeCurrent( GLint window, GLint nativeWindow, GLi
}
else
{
- if (!newCtx->fAutoFlush)
+ if (newCtx->fAutoFlush)
{
if (newCtx->currentThread && newCtx->currentThread != thread)
{