Lines Matching defs:stub

17 #include "stub.h"
61 Stub stub;
74 numFuncs = crLoadOpenGL( &stub.wsInterface, gl_funcs );
76 stub.haveNativeOpenGL = (numFuncs > 0);
79 numFuncs += crLoadOpenGLExtensions( &stub.wsInterface, gl_funcs + numFuncs );
83 crSPUInitDispatchTable( &stub.nativeDispatch );
84 crSPUInitDispatch( &stub.nativeDispatch, gl_funcs );
85 crSPUInitDispatchNops( &stub.nativeDispatch );
123 if (stub.trackWindowVisibleRgn)
129 if (stub.trackWindowVisibility && window->type == CHROMIUM && window->drawable) {
133 stub.spu->dispatch_table.WindowShow(window->spuWindow, mapped);
141 stub.spu->dispatch_table.Flush();
201 CRASSERT(stub.trackWindowSize || stub.trackWindowPos);
207 if (stub.bRunningUnderWDDM)
212 crHashtableLock(stub.windowTable);
214 crLockMutex(&stub.mutex);
218 crHashtableWalkUnlocked(stub.windowTable, stubCheckWindowsCB, context);
221 crUnlockMutex(&stub.mutex);
223 crHashtableUnlock(stub.windowTable);
279 crSPUInitDispatchTable( &stub.spuDispatch );
280 crSPUCopyDispatchTable( &stub.spuDispatch, &(spu->dispatch_table) );
282 if (stub.trackWindowSize || stub.trackWindowPos || stub.trackWindowVisibleRgn) {
284 origClear = stub.spuDispatch.Clear;
285 origViewport = stub.spuDispatch.Viewport;
286 origSwapBuffers = stub.spuDispatch.SwapBuffers;
287 origDrawBuffer = stub.spuDispatch.DrawBuffer;
288 origScissor = stub.spuDispatch.Scissor;
289 stub.spuDispatch.Clear = trapClear;
290 stub.spuDispatch.Viewport = trapViewport;
292 /*stub.spuDispatch.SwapBuffers = trapSwapBuffers;
293 stub.spuDispatch.DrawBuffer = trapDrawBuffer;*/
296 crSPUCopyDispatchTable( &glim, &stub.spuDispatch );
320 ASMAtomicWriteBool(&stub.bShutdownSyncThread, true);
327 * this is why we need to take a windowTable lock since we will later do stub.windowTable access & locking */
328 crHashtableLock(stub.windowTable);
329 crHashtableWalk(stub.contextTable, hsWalkStubDestroyContexts, NULL);
330 crHashtableUnlock(stub.windowTable);
335 crSPUUnloadChain(stub.spu);
336 stub.spu = NULL;
347 if (stub.xshmSI.shmid>=0)
349 shmctl(stub.xshmSI.shmid, IPC_RMID, 0);
350 shmdt(stub.xshmSI.shmaddr);
352 crFreeHashtable(stub.pGLXPixmapsHash, crFree);
355 crFreeHashtable(stub.windowTable, crFree);
356 crFreeHashtable(stub.contextTable, NULL);
358 crMemset(&stub, 0, sizeof(stub));
387 mutex = &stub.mutex;
401 if (stub.hSyncThread && RTThreadGetState(stub.hSyncThread)!=RTTHREADSTATE_TERMINATED)
407 false, RTThreadGetNative(stub.hSyncThread));
414 crDebug("Got handle %p for thread %#x", hNative, RTThreadGetNative(stub.hSyncThread));
417 ASMAtomicWriteBool(&stub.bShutdownSyncThread, true);
419 if (PostThreadMessage(RTThreadGetNative(stub.hSyncThread), WM_QUIT, 0, 0))
421 RTThreadWait(stub.hSyncThread, 1000, NULL);
457 if (stub.hSyncThread!=NIL_RTTHREAD)
459 ASMAtomicWriteBool(&stub.bShutdownSyncThread, true);
461 int rc = RTThreadWait(stub.hSyncThread, RT_INDEFINITE_WAIT, NULL);
480 crMemset(&stub, 0, sizeof(stub));
512 * Init variables in the stub structure, install signal handler.
519 crInitMutex(&stub.mutex);
523 stub.haveNativeOpenGL = GL_FALSE;
524 stub.spu = NULL;
525 stub.appDrawCursor = 0;
526 stub.minChromiumWindowWidth = 0;
527 stub.minChromiumWindowHeight = 0;
528 stub.maxChromiumWindowWidth = 0;
529 stub.maxChromiumWindowHeight = 0;
530 stub.matchChromiumWindowCount = 0;
531 stub.matchChromiumWindowID = NULL;
532 stub.matchWindowTitle = NULL;
533 stub.ignoreFreeglutMenus = 0;
534 stub.threadSafe = GL_FALSE;
535 stub.trackWindowSize = 0;
536 stub.trackWindowPos = 0;
537 stub.trackWindowVisibility = 0;
538 stub.trackWindowVisibleRgn = 0;
539 stub.mothershipPID = 0;
540 stub.spu_dir = NULL;
542 stub.freeContextNumber = MAGIC_CONTEXT_BASE;
543 stub.contextTable = crAllocHashtable();
555 stub.windowTable = crAllocHashtable();
558 stub.bShutdownSyncThread = false;
559 stub.hSyncThread = NIL_RTTHREAD;
571 crHashtableAdd(stub.windowTable, 0, defaultWin);
719 stub.appDrawCursor = 0;
720 stub.minChromiumWindowWidth = 0;
721 stub.minChromiumWindowHeight = 0;
722 stub.maxChromiumWindowWidth = 0;
723 stub.maxChromiumWindowHeight = 0;
724 stub.matchChromiumWindowID = NULL;
725 stub.numIgnoreWindowID = 0;
726 stub.matchWindowTitle = NULL;
727 stub.ignoreFreeglutMenus = 0;
728 stub.trackWindowSize = 1;
729 stub.trackWindowPos = 1;
730 stub.trackWindowVisibility = 1;
731 stub.trackWindowVisibleRgn = 1;
732 stub.matchChromiumWindowCount = 0;
733 stub.spu_dir = NULL;
738 stub.force_pbuffers = 0;
742 stub.bRunningUnderWDDM = false;
761 stub.spuDispatch.WindowVisibleRegion(pWindow->spuWindow, lpRgnData->rdh.nCount, (GLint*) lpRgnData->Buffer);
799 stub.spu->dispatch_table.VBoxPackSetInjectID(pWindow->u32ClientID);
813 if (stub.bRunningUnderWDDM)
845 stub.trackWindowVisibleRgn = 0;
846 stub.bRunningUnderWDDM = true;
851 crLockMutex(&stub.mutex);
855 stub.spu->dispatch_table.VBoxPackSetInjectThread(NULL);
857 if (stub.bRunningUnderWDDM && !spuConnection)
862 crUnlockMutex(&stub.mutex);
866 while(!stub.bShutdownSyncThread)
872 if (stub.bRunningUnderWDDM)
879 crHashtableWalk(stub.windowTable, stubSyncTrCheckWindowsCB, NULL);
898 crHashtableLock(stub.windowTable);
899 crLockMutex(&stub.mutex);
900 crHashtableWalkUnlocked(stub.windowTable, stubSyncTrCheckWindowsCB, NULL);
901 crUnlockMutex(&stub.mutex);
902 crHashtableUnlock(stub.windowTable);
910 stub.spu->dispatch_table.VBoxConDestroy(spuConnection);
1019 stub.trackWindowVisibleRgn = 0;
1021 stub.trackWindowSize = 0;
1022 stub.trackWindowPos = 0;
1023 stub.trackWindowVisibility = 0;
1024 stub.bRunningUnderWDDM = true;
1028 stub.spu = crSPULoadChain( num_spus, spu_ids, spu_names, stub.spu_dir, NULL );
1037 if (!stub.spu) {
1045 stubInitSPUDispatch( stub.spu );
1047 /* we need to plug one special stub function into the dispatch table */
1051 /* Load pointers to native OpenGL functions into stub.nativeDispatch */
1055 /*crDebug("stub init");
1074 rc = RTThreadCreate(&stub.hSyncThread, stubSyncThreadProc, NULL, 0, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "Sync");
1079 RTThreadUserWait(stub.hSyncThread, 60 * 1000);
1080 RTThreadUserReset(stub.hSyncThread);
1088 stub.xshmSI.shmid = -1;
1089 stub.bShmInitFailed = GL_FALSE;
1090 stub.pGLXPixmapsHash = crAllocHashtable();
1092 stub.bXExtensionsChecked = GL_FALSE;
1093 stub.bHaveXComposite = GL_FALSE;
1094 stub.bHaveXFixes = GL_FALSE;
1472 CRASSERT(stub.spu);
1473 stub.spu->dispatch_table.VBoxDetachThread();
1493 CRASSERT(stub.spu);
1494 stub.spu->dispatch_table.VBoxAttachThread();
1504 CRASSERT(stub.spu);
1505 stub.spu->dispatch_table.VBoxDetachThread();