Changeset 48356 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/render
- Timestamp:
- Sep 6, 2013 1:54:29 PM (11 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/render
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r48322 r48356 535 535 WindowInfo *window; 536 536 537 GLboolean showIt;538 539 537 if (id <= 0) 540 538 { … … 588 586 if (pCtx->currentWindow==pWindow) 589 587 { 590 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, pCtx->BltInfo.Base.id); 591 pCtx->currentWindow=0; 588 WindowInfo* pDummy = renderspuGetDummyWindow(pCtx->BltInfo.Base.visualBits); 589 if (pDummy) 590 { 591 renderspuPerformMakeCurrent(pDummy, 0, pCtx); 592 } 593 else 594 { 595 crWarning("failed to get dummy window"); 596 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, pCtx->BltInfo.Base.id); 597 } 592 598 } 593 599 } … … 596 602 { 597 603 GET_CONTEXT(pOldCtx); 604 WindowInfo * pOldWindow = pOldCtx ? pOldCtx->currentWindow : NULL; 605 CRASSERT(!pOldCtx == !pOldWindow); 598 606 /* ensure no concurrent draws can take place */ 599 607 renderspuVBoxCompositorSet(window, NULL); … … 606 614 { 607 615 GET_CONTEXT(pNewCtx); 608 if (pNewCtx!=pOldCtx) 609 { 610 renderspuMakeCurrent(pOldCtx&&pOldCtx->currentWindow ? pOldCtx->currentWindow->BltInfo.Base.id:CR_RENDER_DEFAULT_WINDOW_ID, 0, 611 pOldCtx ? pOldCtx->BltInfo.Base.id:CR_RENDER_DEFAULT_CONTEXT_ID); 616 WindowInfo * pNewWindow = pNewCtx ? pNewCtx->currentWindow : NULL; 617 CRASSERT(!pNewCtx == !pNewWindow); 618 619 if (pOldWindow == window) 620 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID); 621 else if (pNewCtx != pOldCtx || pOldWindow != pNewWindow) 622 { 623 if (pOldCtx) 624 renderspuPerformMakeCurrent(pOldWindow, 0, pOldCtx); 625 else 626 renderspuMakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID); 612 627 } 613 628 } … … 1711 1726 } 1712 1727 1728 static void renderspuReparentWindowCB(unsigned long key, void *data1, void *data2) 1729 { 1730 WindowInfo *pWindow = (WindowInfo *)data1; 1731 1732 renderspu_SystemReparentWindow(pWindow); 1733 } 1734 1713 1735 DECLEXPORT(void) renderspuReparentWindow(GLint window) 1714 1736 { … … 1725 1747 1726 1748 renderspu_SystemReparentWindow(pWindow); 1749 1750 /* special case: reparent all internal windows as well */ 1751 if (window == CR_RENDER_DEFAULT_WINDOW_ID) 1752 { 1753 crHashtableWalk(render_spu.dummyWindowTable, renderspuReparentWindowCB, NULL); 1754 } 1727 1755 } 1728 1756 -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c
r48291 r48356 1222 1222 { 1223 1223 LONG_PTR oldVal = SetWindowLongPtr(window->hWnd, GWLP_USERDATA, (LONG_PTR)window); 1224 Assert(!oldVal && GetLastError() == NO_ERROR); 1224 DWORD winEr = GetLastError(); 1225 Assert(!oldVal && winEr == NO_ERROR); 1225 1226 } 1226 1227 … … 1311 1312 static GLboolean renderspuChkActivateSharedContext(ContextInfo *sharedContext) 1312 1313 { 1313 GLint crWindow;1314 1314 WindowInfo *window; 1315 1315 … … 1322 1322 renderspuChkActivateSharedContext(sharedContext->shared); 1323 1323 1324 crWindow = renderspuWindowCreate(sharedContext->visual->displayName, sharedContext->visual->visAttribs); 1325 if (!crWindow) 1326 { 1327 crError("renderspuChkActivateSharedContext: renderspuWindowCreate failed!"); 1328 return GL_FALSE; 1329 } 1330 1331 window = (WindowInfo *) crHashtableSearch(render_spu.windowTable, crWindow); 1324 window = renderspuGetDummyWindow(sharedContext->visual->visAttribs); 1332 1325 if (!window) 1333 1326 { 1334 crError("renderspuChkActivateSharedContext: crHashtableSearch failed!"); 1335 renderspuWindowDestroy(crWindow); 1327 crError("renderspuChkActivateSharedContext: renderspuGetDummyWindow failed!"); 1336 1328 return GL_FALSE; 1337 1329 } … … 1345 1337 { 1346 1338 crError( "Render SPU: (renderspuChkActivateSharedContext) Couldn't create the context for the window (error 0x%x)", GetLastError() ); 1347 renderspuWindowDestroy(crWindow);1348 1339 return GL_FALSE; 1349 1340 } … … 1368 1359 * various tables. This is hack which just hides the root case. 1369 1360 */ 1370 //crWarning("Recreating window in renderspu_SystemMakeCurrent\n");1361 crWarning("Recreating window in renderspu_SystemMakeCurrent\n"); 1371 1362 renderspu_SystemDestroyWindow( window ); 1372 1363 renderspu_SystemVBoxCreateWindow( context->visual, window->visible, window );
Note:
See TracChangeset
for help on using the changeset viewer.