Changeset 36843 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Apr 26, 2011 8:33:19 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 71402
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r36290 r36843 164 164 } 165 165 166 // @todo use critsect only to fetch the list and update the g_SvcPresentFBO's pQueueHead and pQueueTail. 166 167 rc = RTCritSectEnter(&g_SvcPresentFBO.hQueueLock); 167 168 AssertRCReturn(rc, rc); … … 1242 1243 g_pConsole = pConsole; 1243 1244 1244 /*rc = crVBoxServerSetOffscreenRendering(GL_TRUE);*/1245 1245 rc = VINF_SUCCESS; 1246 1246 } … … 1349 1349 1350 1350 rc = VINF_SUCCESS; 1351 } 1352 break; 1353 } 1354 case SHCRGL_HOST_FN_SET_OUTPUT_REDIRECT: 1355 { 1356 /* 1357 * OutputRedirect. 1358 * Note: the service calls OutputRedirect callbacks directly 1359 * and they must not block. If asynchronous processing is needed, 1360 * the callback provider must organize this. 1361 */ 1362 Log(("svcCall: SHCRGL_HOST_FN_SET_OUTPUT_REDIRECT\n")); 1363 1364 /* Verify parameter count and types. */ 1365 if (cParms != SHCRGL_CPARMS_SET_OUTPUT_REDIRECT) 1366 { 1367 rc = VERR_INVALID_PARAMETER; 1368 } 1369 else if (paParms[0].type != VBOX_HGCM_SVC_PARM_PTR) 1370 { 1371 rc = VERR_INVALID_PARAMETER; 1372 } 1373 else 1374 { 1375 /* Fetch parameters. */ 1376 H3DOUTPUTREDIRECT *pOutputRedirect = (H3DOUTPUTREDIRECT *)paParms[0].u.pointer.addr; 1377 uint32_t cbData = paParms[0].u.pointer.size; 1378 1379 /* Verify parameters values. */ 1380 if (cbData != sizeof (H3DOUTPUTREDIRECT)) 1381 { 1382 rc = VERR_INVALID_PARAMETER; 1383 } 1384 else /* Execute the function. */ 1385 { 1386 rc = crVBoxServerSetOffscreenRendering(GL_TRUE); 1387 1388 if (RT_SUCCESS(rc)) 1389 { 1390 CROutputRedirect or; 1391 or.pvContext = pOutputRedirect->pvContext; 1392 or.CRORBegin = pOutputRedirect->H3DORBegin; 1393 or.CRORGeometry = pOutputRedirect->H3DORGeometry; 1394 or.CRORVisibleRegion = pOutputRedirect->H3DORVisibleRegion; 1395 or.CRORFrame = pOutputRedirect->H3DORFrame; 1396 or.CROREnd = pOutputRedirect->H3DOREnd; 1397 or.CRORContextProperty = pOutputRedirect->H3DORContextProperty; 1398 rc = crVBoxServerOutputRedirectSet(&or); 1399 } 1400 } 1351 1401 } 1352 1402 break; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r31808 r36843 89 89 GLuint crServerTranslateProgramID(GLuint id); 90 90 91 void crServerSetupOutputRedirect(CRMuralInfo *mural); 91 92 void crServerCheckMuralGeometry(CRMuralInfo *mural); 92 93 GLboolean crServerSupportRedirMuralFBO(void); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_config.c
r36052 r36843 58 58 cr_server.bForceOffscreenRendering = GL_FALSE; 59 59 cr_server.bUsePBOForReadback = GL_FALSE; 60 cr_server.bUseOutputRedirect = GL_FALSE; 60 61 } 61 62 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r36052 r36843 1260 1260 return VINF_SUCCESS; 1261 1261 } 1262 1263 DECLEXPORT(int32_t) crVBoxServerOutputRedirectSet(const CROutputRedirect *pCallbacks) 1264 { 1265 /* No need for a synchronization as this is single threaded. */ 1266 if (pCallbacks) 1267 { 1268 cr_server.outputRedirect = *pCallbacks; 1269 cr_server.bUseOutputRedirect = true; 1270 } 1271 else 1272 { 1273 cr_server.bUseOutputRedirect = false; 1274 } 1275 1276 // @todo dynamically intercept already existing output: 1277 // crHashtableWalk(cr_server.muralTable, crVBoxServerOutputRedirectCB, NULL); 1278 1279 return VINF_SUCCESS; 1280 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c
r36052 r36843 46 46 } 47 47 48 /* Called when a new CRMuralInfo is created 49 * or when OutputRedirect status is changed. 50 */ 51 void crServerSetupOutputRedirect(CRMuralInfo *mural) 52 { 53 /* Unset the previous redirect. */ 54 if (mural->pvOutputRedirectInstance) 55 { 56 cr_server.outputRedirect.CROREnd(mural->pvOutputRedirectInstance); 57 mural->pvOutputRedirectInstance = NULL; 58 } 59 60 /* Setup a new redirect. */ 61 if (cr_server.bUseOutputRedirect) 62 { 63 /* Query supported formats. */ 64 uint32_t cbFormats = 4096; 65 char *pachFormats = (char *)crAlloc(cbFormats); 66 67 if (pachFormats) 68 { 69 int rc = cr_server.outputRedirect.CRORContextProperty(cr_server.outputRedirect.pvContext, 70 0 /* H3DOR_PROP_FORMATS */, // @todo from a header 71 pachFormats, cbFormats, &cbFormats); 72 if (RT_SUCCESS(rc)) 73 { 74 if (strstr(pachFormats, "H3DOR_FMT_RGBA_TOPDOWN")) 75 { 76 cr_server.outputRedirect.CRORBegin(cr_server.outputRedirect.pvContext, 77 &mural->pvOutputRedirectInstance, 78 "H3DOR_FMT_RGBA_TOPDOWN"); // @todo from a header 79 } 80 } 81 82 crFree(pachFormats); 83 } 84 85 /* If this is not NULL then there was a supported format. */ 86 if (mural->pvOutputRedirectInstance) 87 { 88 cr_server.outputRedirect.CRORGeometry(mural->pvOutputRedirectInstance, 89 mural->hX, mural->hY, 90 mural->width, mural->height); 91 // @todo the code assumes that RTRECT == four of GLInts 92 cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance, 93 mural->cVisibleRects, (RTRECT *)mural->pVisibleRects); 94 } 95 } 96 } 97 48 98 void crServerCheckMuralGeometry(CRMuralInfo *mural) 49 99 { … … 136 186 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX, mural->hY); 137 187 } 188 } 189 190 if (mural->pvOutputRedirectInstance) 191 { 192 cr_server.outputRedirect.CRORGeometry(mural->pvOutputRedirectInstance, 193 mural->hX, mural->hY, 194 mural->width, mural->height); 138 195 } 139 196 } … … 455 512 } 456 513 514 if (mural->pvOutputRedirectInstance) 515 { 516 /* @todo find out why presentfbo is not called but crorframe is called. */ 517 cr_server.outputRedirect.CRORFrame(mural->pvOutputRedirectInstance, 518 pixels, 519 4 * mural->fboWidth * mural->fboHeight); 520 } 521 457 522 if (bUsePBO) 458 523 { -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r35998 r36843 88 88 mural->bReceivedRects = GL_FALSE; 89 89 90 mural->pvOutputRedirectInstance = NULL; 91 90 92 /* generate ID for this new window/mural (special-case for file conns) */ 91 93 if (cr_server.curClient && cr_server.curClient->conn->type == CR_FILE) … … 99 101 pCreateInfo->visualBits = visBits; 100 102 crHashtableAdd(cr_server.pWindowCreateInfoTable, windowID, pCreateInfo); 103 104 crServerSetupOutputRedirect(mural); 101 105 } 102 106 … … 148 152 } 149 153 154 if (mural->pvOutputRedirectInstance) 155 { 156 cr_server.outputRedirect.CROREnd(mural->pvOutputRedirectInstance); 157 mural->pvOutputRedirectInstance = NULL; 158 } 159 150 160 if (cr_server.currentWindow == window) 151 161 { … … 295 305 296 306 cr_server.head_spu->dispatch_table.WindowVisibleRegion(mural->spuWindow, cRects, pRects); 307 308 if (mural->pvOutputRedirectInstance) 309 { 310 /* @todo the code assumes that RTRECT == four GLInts. */ 311 cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance, 312 cRects, (RTRECT *)pRects); 313 } 297 314 } 298 315
Note:
See TracChangeset
for help on using the changeset viewer.