Changeset 50095 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/render
- Timestamp:
- Jan 17, 2014 4:34:07 PM (11 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/render
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r50041 r50095 766 766 767 767 static void RENDER_APIENTRY 768 renderspuVBoxPresentComposition( GLint win, struct VBOXVR_SCR_COMPOSITOR * pCompositor,struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )768 renderspuVBoxPresentComposition( GLint win, const struct VBOXVR_SCR_COMPOSITOR * pCompositor, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ) 769 769 { 770 770 WindowInfo *window; … … 789 789 } 790 790 791 void renderspuVBoxCompositorBlitStretched ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY)792 { 793 VBOXVR_SCR_COMPOSITOR_ ITERATOR CIter;794 PVBOXVR_SCR_COMPOSITOR_ENTRYpEntry;795 CrVrScrCompositor IterInit(pCompositor, &CIter);796 while ((pEntry = CrVrScrCompositor IterNext(&CIter)) != NULL)791 void renderspuVBoxCompositorBlitStretched ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY) 792 { 793 VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR CIter; 794 const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry; 795 CrVrScrCompositorConstIterInit(pCompositor, &CIter); 796 while ((pEntry = CrVrScrCompositorConstIterNext(&CIter)) != NULL) 797 797 { 798 798 uint32_t cRegions; … … 806 806 { 807 807 RTRECT DstRect; 808 const CR_TEXDATA *pTexData = CrVrScrCompositorEntryTexGet(pEntry); 808 809 DstRect.xLeft = paDstRegions[i].xLeft * scaleX; 809 810 DstRect.yTop = paDstRegions[i].yTop * scaleY; 810 811 DstRect.xRight = paDstRegions[i].xRight * scaleX; 811 812 DstRect.yBottom = paDstRegions[i].yBottom * scaleY; 812 CrBltBlitTexMural(pBlitter, true, &pEntry->Tex, &paSrcRegions[i], &DstRect, 1, fFlags);813 CrBltBlitTexMural(pBlitter, true, CrTdTexGet(pTexData), &paSrcRegions[i], &DstRect, 1, fFlags); 813 814 } 814 815 } … … 820 821 } 821 822 822 void renderspuVBoxCompositorBlit ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter)823 { 824 VBOXVR_SCR_COMPOSITOR_ ITERATOR CIter;825 PVBOXVR_SCR_COMPOSITOR_ENTRYpEntry;826 CrVrScrCompositor IterInit(pCompositor, &CIter);827 while ((pEntry = CrVrScrCompositor IterNext(&CIter)) != NULL)823 void renderspuVBoxCompositorBlit ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter) 824 { 825 VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR CIter; 826 const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry; 827 CrVrScrCompositorConstIterInit(pCompositor, &CIter); 828 while ((pEntry = CrVrScrCompositorConstIterNext(&CIter)) != NULL) 828 829 { 829 830 uint32_t cRegions; … … 833 834 if (RT_SUCCESS(rc)) 834 835 { 835 CrBltBlitTexMural(pBlitter, true, &pEntry->Tex, paSrcRegions, paDstRegions, cRegions, fFlags); 836 const CR_TEXDATA *pTexData = CrVrScrCompositorEntryTexGet(pEntry); 837 CrBltBlitTexMural(pBlitter, true, CrTdTexGet(pTexData), paSrcRegions, paDstRegions, cRegions, fFlags); 836 838 } 837 839 else … … 850 852 { 851 853 const CR_BLITTER_WINDOW * pBltInfo = CrBltMuralGetCurrentInfo(window->pBlitter); 852 if (pBltInfo ->Base.id == window->BltInfo.Base.id)853 { 854 CrBltMuralSetCurrent (window->pBlitter, NULL);854 if (pBltInfo && pBltInfo->Base.id == window->BltInfo.Base.id) 855 { 856 CrBltMuralSetCurrentInfo(window->pBlitter, NULL); 855 857 } 856 858 } … … 858 860 { 859 861 CRASSERT(CrBltMuralGetCurrentInfo(window->pBlitter)->Base.id == window->BltInfo.Base.id); 860 CrBltMuralSetCurrent (window->pBlitter, NULL);862 CrBltMuralSetCurrentInfo(window->pBlitter, NULL); 861 863 CrBltTerm(window->pBlitter); 862 864 } … … 895 897 } 896 898 897 rc = CrBltInit(pBlitter, &pDefaultCtxInfo->BltInfo, true, true, NULL, render_spu.blitterDispatch);899 rc = CrBltInit(pBlitter, &pDefaultCtxInfo->BltInfo, true, true, NULL, &render_spu.blitterDispatch); 898 900 899 901 /* we can release it either way, since it will be retained when used as a shared context */ … … 920 922 } 921 923 922 CrBltMuralSetCurrent (pBlitter, &window->BltInfo);924 CrBltMuralSetCurrentInfo(pBlitter, &window->BltInfo); 923 925 return pBlitter; 924 926 } … … 927 929 { 928 930 int rc; 929 PCR_BLITTER_CONTEXT pCtxInfo = NULL;930 PCR_BLITTER_WINDOW pWindowInfo = NULL;931 GET_CONTEXT(pCtx);932 933 if (pCtx)934 {935 if (pCtx->currentWindow)936 {937 pCtxInfo = &pCtx->BltInfo;938 pWindowInfo = &pCtx->currentWindow->BltInfo;939 }940 }941 931 942 932 CrBltSetMakeCurrentUserData(pBlitter, i32MakeCurrentUserData); 943 933 944 rc = CrBltEnter(pBlitter , pCtxInfo, pWindowInfo);934 rc = CrBltEnter(pBlitter); 945 935 if (!RT_SUCCESS(rc)) 946 936 { … … 969 959 if (!window->pBlitter) 970 960 { 971 struct VBOXVR_SCR_COMPOSITOR * pTmpCompositor;961 const struct VBOXVR_SCR_COMPOSITOR * pTmpCompositor; 972 962 /* just use compositor lock to synchronize */ 973 963 pTmpCompositor = renderspuVBoxCompositorAcquire(window); … … 1006 996 } 1007 997 1008 void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor,struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData )998 void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData ) 1009 999 { 1010 1000 PCR_BLITTER pBlitter = renderspuVBoxPresentBlitterGetAndEnter(window, i32MakeCurrentUserData); … … 1019 1009 } 1020 1010 1021 void renderspuVBoxCompositorSet( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor)1011 void renderspuVBoxCompositorSet( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor) 1022 1012 { 1023 1013 int rc; … … 1056 1046 } 1057 1047 1058 struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window)1048 const struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window) 1059 1049 { 1060 1050 int rc = RTCritSectEnter(&window->CompositorLock); 1061 1051 if (RT_SUCCESS(rc)) 1062 1052 { 1063 VBOXVR_SCR_COMPOSITOR * pCompositor = window->pCompositor;1053 const VBOXVR_SCR_COMPOSITOR * pCompositor = window->pCompositor; 1064 1054 if (pCompositor) 1065 1055 return pCompositor; … … 1089 1079 } 1090 1080 1091 int renderspuVBoxCompositorTryAcquire(WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR **ppCompositor)1081 int renderspuVBoxCompositorTryAcquire(WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR **ppCompositor) 1092 1082 { 1093 1083 int rc = RTCritSectTryEnter(&window->CompositorLock); … … 1551 1541 break; 1552 1542 1543 case GL_HH_SET_TMPCTX_MAKE_CURRENT: 1544 if (type == GL_BYTE && count == sizeof (void*)) 1545 memcpy(&render_spu.blitterDispatch.MakeCurrent, values, count); 1546 else 1547 crWarning("unexpected type(%#x) - count(%d) pair", type, count); 1548 break; 1549 1553 1550 default: 1554 1551 #if 0 -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
r50041 r50095 29 29 #include "cr_server.h" 30 30 #include "cr_blitter.h" 31 #include "cr_compositor.h" 31 32 32 33 #include <iprt/cdefs.h> … … 103 104 char *title; 104 105 105 PVBOXVR_SCR_COMPOSITORpCompositor;106 const VBOXVR_SCR_COMPOSITOR *pCompositor; 106 107 /* the composotor lock is used to synchronize the current compositor access, 107 108 * i.e. the compositor can be accessed by a gui refraw thread, … … 285 286 CRConnection **swap_conns; 286 287 287 SPUDispatchTable *blitterDispatch;288 SPUDispatchTable blitterDispatch; 288 289 CRHashTable *blitterTable; 289 290 … … 406 407 extern void renderspu_SystemSwapBuffers( WindowInfo *window, GLint flags ); 407 408 extern void renderspu_SystemReparentWindow(WindowInfo *window); 408 extern void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry );409 extern void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ); 409 410 uint32_t renderspu_SystemPostprocessFunctions(SPUNamedFunctionTable *aFunctions, uint32_t cFunctions, uint32_t cTable); 410 411 extern void renderspu_GCWindow(void); 411 412 extern int renderspuCreateFunctions( SPUNamedFunctionTable table[] ); 412 extern void renderspuVBoxCompositorSet( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor);413 extern void renderspuVBoxCompositorSet( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor); 413 414 extern void renderspuVBoxCompositorClearAll(); 414 415 extern int renderspuVBoxCompositorLock(WindowInfo *window); 415 416 extern int renderspuVBoxCompositorUnlock(WindowInfo *window); 416 extern struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window);417 extern int renderspuVBoxCompositorTryAcquire(WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR **ppCompositor);417 extern const struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window); 418 extern int renderspuVBoxCompositorTryAcquire(WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR **ppCompositor); 418 419 extern void renderspuVBoxCompositorRelease( WindowInfo *window); 419 extern void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor,struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData );420 extern void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData ); 420 421 extern PCR_BLITTER renderspuVBoxPresentBlitterGet( WindowInfo *window ); 421 422 void renderspuVBoxPresentBlitterCleanup( WindowInfo *window ); … … 429 430 extern GLboolean renderspuWindowInitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id ); 430 431 extern GLboolean renderspuInitVisual(VisualInfo *pVisInfo, const char *displayName, GLbitfield visAttribs); 431 extern void renderspuVBoxCompositorBlit ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter);432 extern void renderspuVBoxCompositorBlitStretched ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY);432 extern void renderspuVBoxCompositorBlit ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter); 433 extern void renderspuVBoxCompositorBlitStretched ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY); 433 434 extern GLint renderspuCreateContextEx(const char *dpyName, GLint visBits, GLint id, GLint shareCtx); 434 435 extern GLint renderspuWindowCreateEx( const char *dpyName, GLint visBits, GLint id ); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c
r48291 r50095 608 608 } 609 609 610 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor,struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )610 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ) 611 611 { 612 612 renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c
r50041 r50095 155 155 } 156 156 157 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )157 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ) 158 158 { 159 159 cocoaViewPresentComposition(window->window, pChangedEntry); … … 271 271 if (!CrGlslIsInited(&render_spu.GlobalShaders)) 272 272 { 273 CrGlslInit(&render_spu.GlobalShaders, render_spu.blitterDispatch);273 CrGlslInit(&render_spu.GlobalShaders, &render_spu.blitterDispatch); 274 274 } 275 275 -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h
r45132 r50095 23 23 #include <OpenGL/OpenGL.h> 24 24 #include <cr_vreg.h> 25 #include <cr_compositor.h> 26 25 27 26 28 RT_C_DECLS_BEGIN … … 47 49 void cocoaViewMakeCurrentContext(NativeNSViewRef pView, NativeNSOpenGLContextRef pCtx); 48 50 void cocoaViewSetVisibleRegion(NativeNSViewRef pView, GLint cRects, const GLint* paRects); 49 void cocoaViewPresentComposition(NativeNSViewRef pView, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry);51 void cocoaViewPresentComposition(NativeNSViewRef pView, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry); 50 52 51 53 RT_C_DECLS_END -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
r49868 r50095 373 373 - (void)vboxTryDraw; 374 374 - (void)vboxTryDrawUI; 375 - (void)vboxPresent:( PVBOXVR_SCR_COMPOSITOR)pCompositor;376 - (void)vboxPresentCS:( PVBOXVR_SCR_COMPOSITOR)pCompositor;377 - (void)vboxPresentToDockTileCS:( PVBOXVR_SCR_COMPOSITOR)pCompositor;378 - (void)vboxPresentToViewCS:( PVBOXVR_SCR_COMPOSITOR)pCompositor;379 - (void)presentComposition:( PVBOXVR_SCR_COMPOSITOR_ENTRY)pChangedEntry;375 - (void)vboxPresent:(const VBOXVR_SCR_COMPOSITOR*)pCompositor; 376 - (void)vboxPresentCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor; 377 - (void)vboxPresentToDockTileCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor; 378 - (void)vboxPresentToViewCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor; 379 - (void)presentComposition:(const VBOXVR_SCR_COMPOSITOR_ENTRY*)pChangedEntry; 380 380 - (void)vboxBlitterSyncWindow; 381 381 … … 790 790 [self deleteDockTile]; 791 791 792 if (m_pGLCtx) 793 { 794 if ([m_pGLCtx view] == self) 795 [m_pGLCtx clearDrawable]; 796 797 m_pGLCtx = nil; 798 } 792 [self setGLCtx:nil]; 793 799 794 if (m_pSharedGLCtx) 800 795 { … … 808 803 CrBltTerm(m_pBlitter); 809 804 805 RTMemFree(m_pBlitter); 806 810 807 m_pBlitter = nil; 811 808 } … … 836 833 /* ensure the context drawable is cleared to avoid holding a reference to inexistent view */ 837 834 if (m_pGLCtx) 835 { 838 836 [m_pGLCtx clearDrawable]; 837 [m_pGLCtx release]; 838 /*[m_pGLCtx performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];*/ 839 } 839 840 840 841 m_pGLCtx = pCtx; 842 if (pCtx) 843 [pCtx retain]; 841 844 } 842 845 … … 1113 1116 if ([self lockFocusIfCanDraw]) 1114 1117 { 1115 VBOXVR_SCR_COMPOSITOR *pCompositor = NULL;1118 const const VBOXVR_SCR_COMPOSITOR *pCompositor = NULL; 1116 1119 if (!m_pSharedGLCtx) 1117 1120 { … … 1123 1126 if (m_pBlitter) 1124 1127 { 1125 int rc = CrBltInit(m_pBlitter, NULL, false, false, &render_spu.GlobalShaders, render_spu.blitterDispatch);1128 int rc = CrBltInit(m_pBlitter, NULL, false, false, &render_spu.GlobalShaders, &render_spu.blitterDispatch); 1126 1129 if (RT_SUCCESS(rc)) 1127 1130 { … … 1218 1221 * while here we do a reverse order: acquire compositor lock being in gui thread. 1219 1222 * this is why we do only try acquire and re-submit repaint event if compositor lock is busy */ 1220 VBOXVR_SCR_COMPOSITOR *pCompositor = NULL;1223 const VBOXVR_SCR_COMPOSITOR *pCompositor = NULL; 1221 1224 int rc = renderspuVBoxCompositorTryAcquire(m_pWinInfo, &pCompositor); 1222 1225 if (RT_SUCCESS(rc)) … … 1228 1231 else if (rc == VERR_SEM_BUSY) 1229 1232 { 1233 Assert(!pCompositor); 1230 1234 /* re-issue to the gui thread */ 1231 1235 # ifdef DEBUG_misha … … 1234 1238 [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(vboxTryDrawUI) userInfo:nil repeats:NO]; 1235 1239 } 1236 else 1240 else if (rc != VERR_INVALID_STATE) /* VERR_INVALID_STATE means no compositor, which is ok */ 1237 1241 { 1242 Assert(!pCompositor); 1238 1243 /* this is somewhat we do not expect */ 1239 1244 DEBUG_WARN(("renderspuVBoxCompositorTryAcquire failed rc %d", rc)); 1240 1245 } 1241 1246 #else 1242 VBOXVR_SCR_COMPOSITOR *pCompositor = renderspuVBoxCompositorAcquire(m_pWinInfo);1247 const VBOXVR_SCR_COMPOSITOR *pCompositor = renderspuVBoxCompositorAcquire(m_pWinInfo); 1243 1248 if (pCompositor) 1244 1249 { … … 1261 1266 } 1262 1267 1263 - (void)vboxPresent:( PVBOXVR_SCR_COMPOSITOR)pCompositor1268 - (void)vboxPresent:(const VBOXVR_SCR_COMPOSITOR*)pCompositor 1264 1269 { 1265 1270 VBOX_CR_RENDER_CTX_INFO CtxInfo; … … 1285 1290 } 1286 1291 1287 - (void)vboxPresentCS:( PVBOXVR_SCR_COMPOSITOR)pCompositor1292 - (void)vboxPresentCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor 1288 1293 { 1289 1294 { … … 1338 1343 } 1339 1344 1340 - (void)vboxPresentToViewCS:( PVBOXVR_SCR_COMPOSITOR)pCompositor1345 - (void)vboxPresentToViewCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor 1341 1346 { 1342 1347 NSRect r = [self frame]; … … 1345 1350 1346 1351 #if 1 /* Set to 0 to see the docktile instead of the real output */ 1347 VBOXVR_SCR_COMPOSITOR_ ITERATOR CIter;1348 PVBOXVR_SCR_COMPOSITOR_ENTRYpEntry;1352 VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR CIter; 1353 const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry; 1349 1354 1350 CrVrScrCompositor IterInit(pCompositor, &CIter);1355 CrVrScrCompositorConstIterInit(pCompositor, &CIter); 1351 1356 1352 1357 glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); … … 1358 1363 CrVrScrCompositorGetStretching(pCompositor, &xStretch, &yStretch); 1359 1364 1360 while ((pEntry = CrVrScrCompositor IterNext(&CIter)) != NULL)1365 while ((pEntry = CrVrScrCompositorConstIterNext(&CIter)) != NULL) 1361 1366 { 1362 1367 uint32_t cRegions; … … 1367 1372 { 1368 1373 uint32_t i; 1369 int rc = CrBltEnter(m_pBlitter , NULL, NULL);1374 int rc = CrBltEnter(m_pBlitter); 1370 1375 if (RT_SUCCESS(rc)) 1371 1376 { … … 1374 1379 const RTRECT * pSrcRect = &paSrcRegions[i]; 1375 1380 const RTRECT * pDstRect = &paDstRegions[i]; 1376 RTRECT SrcRect, DstRect, RestrictSrcRect, RestrictDstRect; 1377 1381 RTRECT DstRect, RestrictDstRect; 1382 RTRECT SrcRect, RestrictSrcRect; 1383 1378 1384 vboxNSRectToRect(&m_RootRect, &RestrictDstRect); 1379 1385 VBoxRectIntersected(&RestrictDstRect, pDstRect, &DstRect); … … 1383 1389 1384 1390 VBoxRectTranslate(&DstRect, -RestrictDstRect.xLeft, -RestrictDstRect.yTop); 1385 1391 1386 1392 vboxNSRectToRectUnstretched(&m_RootRect, &RestrictSrcRect, xStretch, yStretch); 1393 VBoxRectTranslate(&RestrictSrcRect, -CrVrScrCompositorEntryRectGet(pEntry)->xLeft, -CrVrScrCompositorEntryRectGet(pEntry)->yTop); 1387 1394 VBoxRectIntersected(&RestrictSrcRect, pSrcRect, &SrcRect); 1388 1395 … … 1393 1400 pDstRect = &DstRect; 1394 1401 1395 CrBltBlitTexMural(m_pBlitter, true, &pEntry->Tex, pSrcRect, pDstRect, 1, fFlags | CRBLT_F_NOALPHA); 1402 const CR_TEXDATA *pTexData = CrVrScrCompositorEntryTexGet(pEntry); 1403 1404 CrBltBlitTexMural(m_pBlitter, true, CrTdTexGet(pTexData), pSrcRect, pDstRect, 1, fFlags | CRBLT_F_NOALPHA); 1396 1405 } 1397 1406 CrBltLeave(m_pBlitter); … … 1416 1425 } 1417 1426 1418 - (void)presentComposition:( PVBOXVR_SCR_COMPOSITOR_ENTRY)pChangedEntry1427 - (void)presentComposition:(const VBOXVR_SCR_COMPOSITOR_ENTRY*)pChangedEntry 1419 1428 { 1420 1429 [self vboxTryDraw]; … … 1438 1447 Assert(WinInfo.height = m_RootRect.size.height); 1439 1448 1440 /*CrBltMuralSetCurrent (m_pBlitter, NULL);*/1441 1442 CrBltMuralSetCurrent (m_pBlitter, &WinInfo);1449 /*CrBltMuralSetCurrentInfo(m_pBlitter, NULL);*/ 1450 1451 CrBltMuralSetCurrentInfo(m_pBlitter, &WinInfo); 1443 1452 CrBltCheckUpdateViewport(m_pBlitter); 1444 1453 } … … 1447 1456 static int g_cVBoxTgaCtr = 0; 1448 1457 #endif 1449 - (void)vboxPresentToDockTileCS:( PVBOXVR_SCR_COMPOSITOR)pCompositor1458 - (void)vboxPresentToDockTileCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor 1450 1459 { 1451 1460 NSRect r = [self frame]; … … 1460 1469 * heavy performance wise. */ 1461 1470 uint64_t uiNewTime = RTTimeMilliTS(); 1462 VBOXVR_SCR_COMPOSITOR_ ITERATOR CIter;1463 PVBOXVR_SCR_COMPOSITOR_ENTRYpEntry;1471 VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR CIter; 1472 const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry; 1464 1473 1465 1474 if (uiNewTime - m_uiDockUpdateTime > 200) … … 1492 1501 CrVrScrCompositorGetStretching(pCompositor, &xStretch, &yStretch); 1493 1502 1494 CrVrScrCompositor IterInit(pCompositor, &CIter);1495 while ((pEntry = CrVrScrCompositor IterNext(&CIter)) != NULL)1503 CrVrScrCompositorConstIterInit(pCompositor, &CIter); 1504 while ((pEntry = CrVrScrCompositorConstIterNext(&CIter)) != NULL) 1496 1505 { 1497 1506 uint32_t cRegions; … … 1502 1511 { 1503 1512 uint32_t i; 1504 int rc = CrBltEnter(m_pBlitter , NULL, NULL);1513 int rc = CrBltEnter(m_pBlitter); 1505 1514 if (RT_SUCCESS(rc)) 1506 1515 { … … 1522 1531 1523 1532 vboxNSRectToRectUnstretched(&m_RootRect, &RestrictSrcRect, xStretch, yStretch); 1533 VBoxRectTranslate(&RestrictSrcRect, -CrVrScrCompositorEntryRectGet(pEntry)->xLeft, -CrVrScrCompositorEntryRectGet(pEntry)->yTop); 1524 1534 VBoxRectIntersected(&RestrictSrcRect, pSrcRect, &SrcRect); 1525 1535 … … 1530 1540 pDstRect = &DstRect; 1531 1541 1532 CrBltBlitTexMural(m_pBlitter, true, &pEntry->Tex, pSrcRect, pDstRect, 1, fFlags); 1542 const CR_TEXDATA *pTexData = CrVrScrCompositorEntryTexGet(pEntry); 1543 1544 CrBltBlitTexMural(m_pBlitter, true, CrTdTexGet(pTexData), pSrcRect, pDstRect, 1, fFlags); 1533 1545 } 1534 1546 CrBltLeave(m_pBlitter); … … 1747 1759 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1748 1760 1749 /*1750 1761 [pCtx release]; 1751 */1762 /*[pCtx performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];*/ 1752 1763 1753 1764 [pPool release]; … … 1906 1917 } 1907 1918 1908 void cocoaViewPresentComposition(NativeNSViewRef pView, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry)1919 void cocoaViewPresentComposition(NativeNSViewRef pView, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry) 1909 1920 { 1910 1921 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c
r50041 r50095 579 579 if (pWindow) 580 580 { 581 struct VBOXVR_SCR_COMPOSITOR * pCompositor;581 const struct VBOXVR_SCR_COMPOSITOR * pCompositor; 582 582 583 583 pCompositor = renderspuVBoxCompositorAcquire(pWindow); … … 1969 1969 } 1970 1970 1971 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )1971 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ) 1972 1972 { 1973 1973 /* the CR_RENDER_FORCE_PRESENT_MAIN_THREAD is actually inherited from cocoa backend impl, … … 1976 1976 * @todo: change to some more generic macro name */ 1977 1977 #ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD 1978 struct VBOXVR_SCR_COMPOSITOR *pCompositor;1978 const struct VBOXVR_SCR_COMPOSITOR *pCompositor; 1979 1979 /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */ 1980 1980 int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c
r50041 r50095 386 386 crSPUCopyDispatchTable( &(render_spu.self), self ); 387 387 388 render_spu.blitterDispatch = &(render_spu.self); 388 crSPUInitDispatchTable( &(render_spu.blitterDispatch) ); 389 crSPUCopyDispatchTable( &(render_spu.blitterDispatch), self ); 389 390 390 391 render_spu.server = (CRServer *)(self->server); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c
r50041 r50095 431 431 if (pWindow) 432 432 { 433 struct VBOXVR_SCR_COMPOSITOR * pCompositor;433 const struct VBOXVR_SCR_COMPOSITOR * pCompositor; 434 434 435 435 pCompositor = renderspuVBoxCompositorAcquire(pWindow); … … 1252 1252 } 1253 1253 1254 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )1254 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ) 1255 1255 { 1256 1256 /* the CR_RENDER_FORCE_PRESENT_MAIN_THREAD is actually inherited from cocoa backend impl, … … 1259 1259 * @todo: change to some more generic macro name */ 1260 1260 #ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD 1261 struct VBOXVR_SCR_COMPOSITOR *pCompositor;1261 const struct VBOXVR_SCR_COMPOSITOR *pCompositor; 1262 1262 /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */ 1263 1263 int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor);
Note:
See TracChangeset
for help on using the changeset viewer.