Changeset 36843 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Timestamp:
- Apr 26, 2011 8:33:19 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 71402
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
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.