Changeset 45248 in vbox
- Timestamp:
- Mar 29, 2013 2:57:24 PM (12 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r45217 r45248 100 100 101 101 GLboolean bVisible; /*guest window is visible*/ 102 GLubyte fUseFBO; /*redirect to FBO instead of real host window*/102 GLubyte u8Unused; /*redirect to FBO instead of real host window*/ 103 103 GLboolean bFbDraw; /*GL_FRONT buffer is drawn to directly*/ 104 104 GLboolean fDataPresented; … … 128 128 129 129 GLuint cDisabled; 130 131 GLuint fPresentMode; /*redirect to FBO instead of real host window*/ 132 133 GLboolean fHasParentWindow; 130 134 131 135 GLboolean fRootVrOn; … … 219 223 /* @todo: 220 224 * 1. use compositor stored inside mural to use current MuralFBO and window-related API 221 * 2. CR_SERVER_REDIR_ NONE and CR_SERVER_REDIR_FBO_BLTshould be trated identically for presented window222 * since we just need to blit the given textures to it if we are NOT in CR_SERVER_REDIR_F BO_RAM mode */225 * 2. CR_SERVER_REDIR_F_NONE and CR_SERVER_REDIR_F_FBO should be trated identically for presented window 226 * since we just need to blit the given textures to it if we are NOT in CR_SERVER_REDIR_F_FBO_RAM mode */ 223 227 typedef struct CR_DISPLAY 224 228 { … … 388 392 389 393 PFNCRSERVERPRESENTFBO pfnPresentFBO; 390 GLu byte bForceOffscreenRendering; /*Force server to render 3d data offscreen394 GLuint fPresentMode; /*Force server to render 3d data offscreen 391 395 *using callback above to update vbox framebuffers*/ 392 GLu byte bOffscreenRenderingDefault; /*can be set with CR_SERVER_DEFAULT_RENDER_TYPE*/396 GLuint fPresentModeDefault; /*can be set with CR_SERVER_DEFAULT_RENDER_TYPE*/ 393 397 GLboolean bUsePBOForReadback; /*Use PBO's for data readback*/ 394 398 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r45148 r45248 130 130 GLboolean crServerSupportRedirMuralFBO(void); 131 131 132 #define CR_SERVER_REDIR_NONE 0 133 #define CR_SERVER_REDIR_FBO_BLT 1 134 #define CR_SERVER_REDIR_FBO_RAM 2 135 #define CR_SERVER_REDIR_MAXVAL CR_SERVER_REDIR_FBO_RAM 132 #define CR_SERVER_REDIR_F_NONE 0x00 133 /* the data should be displayed on host (unset when is on or when CR_SERVER_REDIR_F_FBO_RAM_VMFB is set) */ 134 #define CR_SERVER_REDIR_F_DISPLAY 0x01 135 /* guest window data get redirected to FBO on host */ 136 #define CR_SERVER_REDIR_F_FBO 0x02 137 /* used with CR_SERVER_REDIR_F_FBO only 138 * makes a separate texture to be used for maintaining the window framebuffer presented data */ 139 #define CR_SERVER_REDIR_F_FBO_VMFB_TEX 0x04 140 /* used with CR_SERVER_REDIR_F_FBO only 141 * indicates that FBO data should be copied to RAM for further processing */ 142 #define CR_SERVER_REDIR_F_FBO_RAM 0x08 143 /* used with CR_SERVER_REDIR_F_FBO_RAM only 144 * indicates that FBO data should be passed to VRDP backend */ 145 #define CR_SERVER_REDIR_F_FBO_RAM_VRDP 0x10 146 /* used with CR_SERVER_REDIR_F_FBO_RAM only 147 * indicates that FBO data should be passed to VM Framebuffer */ 148 #define CR_SERVER_REDIR_F_FBO_RAM_VMFB 0x20 136 149 137 int32_t crServerSetOffscreenRenderingMode(GLubyte value); 138 void crServerRedirMuralFBO(CRMuralInfo *mural, GLubyte redir); 150 #define CR_SERVER_REDIR_F_ALL 0x3f 151 152 #define CR_SERVER_REDIR_FGROUP_REQUIRE_FBO (CR_SERVER_REDIR_F_ALL & ~CR_SERVER_REDIR_F_DISPLAY) 153 #define CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM (CR_SERVER_REDIR_F_FBO_RAM_VRDP | CR_SERVER_REDIR_F_FBO_RAM_VMFB) 154 155 DECLINLINE(GLuint) crServerRedirModeAdjust(GLuint value) 156 { 157 /* sanitize values */ 158 value &= CR_SERVER_REDIR_F_ALL; 159 160 if (value & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO) 161 value |= CR_SERVER_REDIR_F_FBO; 162 if (value & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM) 163 value |= CR_SERVER_REDIR_F_FBO_RAM; 164 165 return value; 166 } 167 168 int32_t crServerSetOffscreenRenderingMode(GLuint value); 169 void crServerRedirMuralFBO(CRMuralInfo *mural, GLuint redir); 170 void crServerEnableDisplayMuralFBO(CRMuralInfo *mural, GLboolean fEnable); 139 171 void crServerDeleteMuralFBO(CRMuralInfo *mural); 140 172 void crServerPresentFBO(CRMuralInfo *mural); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_config.c
r44951 r45248 52 52 53 53 cr_server.screenCount = 0; 54 cr_server. bForceOffscreenRendering = CR_SERVER_REDIR_NONE;55 cr_server. bOffscreenRenderingDefault = cr_server.bForceOffscreenRendering;54 cr_server.fPresentMode = CR_SERVER_REDIR_F_NONE; 55 cr_server.fPresentModeDefault = cr_server.fPresentMode; 56 56 cr_server.bUsePBOForReadback = GL_FALSE; 57 57 cr_server.bUseOutputRedirect = GL_FALSE; 58 } 59 60 static int crServerVBoxParseNumerics(const char *pszStr, const int defaultVal) 61 { 62 int result = 0; 63 bool neg = false; 64 unsigned char iDigit = 0; 65 if (!pszStr || pszStr[0] == '\0') 66 return defaultVal; 67 68 for (;;) 69 { 70 if (pszStr[0] == '\0') 71 return defaultVal; 72 73 if (pszStr[0] == ' ' || pszStr[0] == '\t' || pszStr[0] == '\n') 74 { 75 ++pszStr; 76 continue; 77 } 78 79 if (pszStr[0] == '-') 80 { 81 if (neg) 82 return defaultVal; 83 84 neg = true; 85 ++pszStr; 86 continue; 87 } 88 89 break; 90 } 91 92 for (;;) 93 { 94 unsigned char digit; 95 if (pszStr[0] == '\0') 96 { 97 if (!iDigit) 98 return defaultVal; 99 break; 100 } 101 102 digit = pszStr[0] - '0'; 103 if (digit > 9) 104 return defaultVal; 105 106 result *= 10; 107 result += digit; 108 ++iDigit; 109 110 ++pszStr; 111 } 112 113 return !neg ? result : -result; 58 114 } 59 115 … … 155 211 156 212 env = crGetenv( "CR_SERVER_DEFAULT_RENDER_TYPE" ); 157 if (env != NULL )158 { 159 GLubyte redir = (env[0] - 0x30);160 if (redir <= CR_SERVER_REDIR_ MAXVAL)213 if (env != NULL && env[0] != '\0') 214 { 215 unsigned int redir = (unsigned int)crServerVBoxParseNumerics(env, CR_SERVER_REDIR_F_NONE); 216 if (redir <= CR_SERVER_REDIR_F_ALL) 161 217 { 162 218 int rc = crServerSetOffscreenRenderingMode(redir); … … 168 224 } 169 225 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(GLX) 170 else 171 { 172 int rc = crServerSetOffscreenRenderingMode(CR_SERVER_REDIR_FBO_BLT); 226 if (cr_server.fPresentMode == CR_SERVER_REDIR_F_NONE) 227 { 228 /* the CR_SERVER_REDIR_F_FBO_BLT is set only if parent window is received, which means we are not in headles */ 229 int rc = crServerSetOffscreenRenderingMode(CR_SERVER_REDIR_F_FBO | CR_SERVER_REDIR_F_DISPLAY); 173 230 if (!RT_SUCCESS(rc)) 174 231 crWarning("offscreen rendering unsupported, no offscreen rendering will be used.."); … … 176 233 } 177 234 #endif 178 cr_server. bOffscreenRenderingDefault = cr_server.bForceOffscreenRendering;235 cr_server.fPresentModeDefault = cr_server.fPresentMode; 179 236 180 237 /* Need to do this as early as possible */ … … 297 354 298 355 env = crGetenv( "CR_SERVER_DEFAULT_RENDER_TYPE" ); 299 if (env != NULL )300 { 301 GLubyte redir = (env[0] - 0x30);302 if (redir <= CR_SERVER_REDIR_ MAXVAL)356 if (env != NULL && env[0] != '\0') 357 { 358 unsigned int redir = (unsigned int)crServerVBoxParseNumerics(env, CR_SERVER_REDIR_F_NONE); 359 if (redir <= CR_SERVER_REDIR_F_ALL) 303 360 { 304 361 int rc = crServerSetOffscreenRenderingMode(redir); 305 362 if (!RT_SUCCESS(rc)) 306 363 crWarning("offscreen rendering unsupported, no offscreen rendering will be used.."); 307 364 } 308 365 else … … 310 367 } 311 368 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(GLX) 312 else 313 { 314 int rc = crServerSetOffscreenRenderingMode(CR_SERVER_REDIR_FBO_BLT); 369 if (cr_server.fPresentMode == CR_SERVER_REDIR_F_NONE) 370 { 371 /* the CR_SERVER_REDIR_F_FBO_BLT is set only if parent window is received, which means we are not in headles */ 372 int rc = crServerSetOffscreenRenderingMode(CR_SERVER_REDIR_F_FBO | CR_SERVER_REDIR_F_DISPLAY); 315 373 if (!RT_SUCCESS(rc)) 316 374 crWarning("offscreen rendering unsupported, no offscreen rendering will be used.."); … … 318 376 } 319 377 #endif 320 cr_server. bOffscreenRenderingDefault = cr_server.bForceOffscreenRendering;378 cr_server.fPresentModeDefault = cr_server.fPresentMode; 321 379 322 380 cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_POSITION_CR, 0, GL_INT, 2, &dims[0]); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
r45009 r45248 295 295 * while crStateSwitchPostprocess restores it back to the original values */ 296 296 oldCtx = crStateGetCurrent(); 297 if (oldMural && oldMural->fUseFBO&& crServerSupportRedirMuralFBO())297 if (oldMural && (oldMural->fPresentMode & CR_SERVER_REDIR_F_FBO) && crServerSupportRedirMuralFBO()) 298 298 { 299 299 idDrawFBO = oldMural->aidFBOs[oldMural->iCurDrawBuffer]; … … 374 374 crStateMakeCurrent( ctx ); 375 375 376 if (mural && mural->fUseFBO&& crServerSupportRedirMuralFBO())376 if (mural && (mural->fPresentMode & CR_SERVER_REDIR_F_FBO) && crServerSupportRedirMuralFBO()) 377 377 { 378 378 GLuint id = crServerMuralFBOIdxFromBufferName(mural, ctx->buffer.drawBuffer); … … 404 404 cr_server.curClient->currentMural->bFbDraw = GL_TRUE; 405 405 406 if (! mural->fUseFBO)406 if (!(mural->fPresentMode & CR_SERVER_REDIR_F_FBO)) 407 407 { 408 408 ctx->buffer.width = mural->width; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r45217 r45248 1081 1081 return VINF_SUCCESS; 1082 1082 1083 pData->idFBO = pMural->fUseFBO? pMural->aidColorTexs[fWrite ? pMural->iCurDrawBuffer : pMural->iCurReadBuffer] : 0;1083 pData->idFBO = (pMural->fPresentMode & CR_SERVER_REDIR_F_FBO) ? pMural->aidColorTexs[fWrite ? pMural->iCurDrawBuffer : pMural->iCurReadBuffer] : 0; 1084 1084 pData->cElements = 0; 1085 1085 1086 1086 pEl = &pData->aElements[pData->cElements]; 1087 pEl->idFBO = pMural->fUseFBO? pMural->aidFBOs[CR_SERVER_FBO_FB_IDX(pMural)] : 0;1087 pEl->idFBO = (pMural->fPresentMode & CR_SERVER_REDIR_F_FBO) ? pMural->aidFBOs[CR_SERVER_FBO_FB_IDX(pMural)] : 0; 1088 1088 pEl->enmBuffer = pData->aElements[1].idFBO ? GL_COLOR_ATTACHMENT0 : GL_FRONT; 1089 1089 pEl->posX = 0; … … 1112 1112 { 1113 1113 pEl = &pData->aElements[pData->cElements]; 1114 pEl->idFBO = pMural->fUseFBO? pMural->aidFBOs[CR_SERVER_FBO_BB_IDX(pMural)] : 0;1114 pEl->idFBO = (pMural->fPresentMode & CR_SERVER_REDIR_F_FBO) ? pMural->aidFBOs[CR_SERVER_FBO_BB_IDX(pMural)] : 0; 1115 1115 pEl->enmBuffer = pData->aElements[1].idFBO ? GL_COLOR_ATTACHMENT0 : GL_BACK; 1116 1116 pEl->posX = 0; … … 1142 1142 AssertCompile(sizeof (GLfloat) == 4); 1143 1143 pEl = &pData->aElements[pData->cElements]; 1144 pEl->idFBO = pMural->fUseFBO? pMural->aidFBOs[CR_SERVER_FBO_FB_IDX(pMural)] : 0;1144 pEl->idFBO = (pMural->fPresentMode & CR_SERVER_REDIR_F_FBO) ? pMural->aidFBOs[CR_SERVER_FBO_FB_IDX(pMural)] : 0; 1145 1145 pEl->enmBuffer = 0; /* we do not care */ 1146 1146 pEl->posX = 0; … … 1173 1173 AssertCompile(sizeof (GLuint) == 4); 1174 1174 pEl = &pData->aElements[pData->cElements]; 1175 pEl->idFBO = pMural->fUseFBO? pMural->aidFBOs[CR_SERVER_FBO_FB_IDX(pMural)] : 0;1175 pEl->idFBO = (pMural->fPresentMode & CR_SERVER_REDIR_F_FBO) ? pMural->aidFBOs[CR_SERVER_FBO_FB_IDX(pMural)] : 0; 1176 1176 pEl->enmBuffer = 0; /* we do not care */ 1177 1177 pEl->posX = 0; … … 1198 1198 { 1199 1199 pEl = &pData->aElements[pData->cElements]; 1200 pEl->idFBO = pMural->fUseFBO? pMural->aidFBOs[CR_SERVER_FBO_FB_IDX(pMural)] : 0;1200 pEl->idFBO = (pMural->fPresentMode & CR_SERVER_REDIR_F_FBO) ? pMural->aidFBOs[CR_SERVER_FBO_FB_IDX(pMural)] : 0; 1201 1201 pEl->enmBuffer = 0; /* we do not care */ 1202 1202 pEl->posX = 0; … … 1853 1853 crVBoxServerFBImageDataTerm(&Data.data); 1854 1854 1855 if ( pMural->fUseFBO&& pMural->fDataPresented && crServerVBoxCompositionPresentNeeded(pMural))1855 if ((pMural->fPresentMode & CR_SERVER_REDIR_F_FBO) && pMural->fDataPresented && crServerVBoxCompositionPresentNeeded(pMural)) 1856 1856 { 1857 1857 crServerPresentFBO(pMural); … … 2309 2309 2310 2310 renderspuSetWindowId(SCREEN(0).winID); 2311 2312 crHashtableWalk(cr_server.muralTable, crVBoxServerCheckMuralCB, NULL); 2313 2311 2314 return VINF_SUCCESS; 2312 2315 } … … 2402 2405 { 2403 2406 crWarning("CrVrScrCompositorInit failed, rc %d", rc); 2404 return rc;2407 goto end; 2405 2408 } 2406 2409 … … 2417 2420 { 2418 2421 crWarning("crServerMuralSynchRootVr failed, rc %d", rc); 2419 return rc;2422 goto end; 2420 2423 } 2421 2424 … … 2430 2433 { 2431 2434 crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc); 2432 return rc;2435 goto end; 2433 2436 } 2434 2437 … … 2441 2444 pMI->fRootVrOn = cr_server.fRootVrOn; 2442 2445 2446 end: 2443 2447 crServerVBoxCompositionDisableLeave(pMI, fForcePresent); 2444 2448 … … 2496 2500 } 2497 2501 2498 int32_t crServerSetOffscreenRenderingMode(GLubyte value) 2499 { 2500 if (cr_server.bForceOffscreenRendering==value) 2502 int32_t crServerSetOffscreenRenderingMode(GLuint value) 2503 { 2504 /* sanitize values */ 2505 value = crServerRedirModeAdjust(value); 2506 2507 if (value == CR_SERVER_REDIR_F_NONE) 2508 { 2509 crWarning("crServerSetOffscreenRenderingMode: value undefined"); 2510 } 2511 2512 if (cr_server.fPresentMode==value) 2501 2513 { 2502 2514 return VINF_SUCCESS; 2503 2515 } 2504 2516 2505 if (value > CR_SERVER_REDIR_MAXVAL) 2506 { 2507 crWarning("crServerSetOffscreenRenderingMode: invalid arg: %d", value); 2508 return VERR_INVALID_PARAMETER; 2509 } 2510 2511 if (value && !crServerSupportRedirMuralFBO()) 2512 { 2517 if ((value & CR_SERVER_REDIR_F_FBO) && !crServerSupportRedirMuralFBO()) 2518 { 2519 crWarning("crServerSetOffscreenRenderingMode: FBO not supported"); 2513 2520 return VERR_NOT_SUPPORTED; 2514 2521 } 2515 2522 2516 cr_server. bForceOffscreenRendering=value;2523 cr_server.fPresentMode=value; 2517 2524 2518 2525 crHashtableWalk(cr_server.muralTable, crVBoxServerCheckMuralCB, NULL); … … 2523 2530 DECLEXPORT(int32_t) crVBoxServerSetOffscreenRendering(GLboolean value) 2524 2531 { 2525 return crServerSetOffscreenRenderingMode(value ? CR_SERVER_REDIR_FBO_RAM : cr_server.bOffscreenRenderingDefault); 2532 return crServerSetOffscreenRenderingMode(value ? 2533 cr_server.fPresentModeDefault | CR_SERVER_REDIR_F_FBO_RAM_VRDP 2534 : cr_server.fPresentModeDefault); 2526 2535 } 2527 2536 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c
r45217 r45248 663 663 GLuint hwid; 664 664 665 if ( mural->fUseFBO == CR_SERVER_REDIR_NONE)665 if (!(mural->fPresentMode & CR_SERVER_REDIR_F_FBO)) 666 666 return VERR_NOT_IMPLEMENTED; 667 667 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c
r45179 r45248 110 110 { 111 111 int tlS, brS, trS, blS; 112 int overlappingScreenCount, primaryS, i; 112 int overlappingScreenCount = 0, primaryS = -1 , i; 113 uint64_t winID = 0; 114 GLuint fPresentMode; 113 115 114 116 if (!mural->CreateInfo.externalID) 115 117 return; 116 118 119 CRASSERT(mural->spuWindow); 120 CRASSERT(mural->spuWindow != CR_RENDER_DEFAULT_WINDOW_ID); 121 117 122 if (!mural->width || !mural->height) 118 123 { 119 crServerRedirMuralFBO(mural, CR_SERVER_REDIR_ NONE);124 crServerRedirMuralFBO(mural, CR_SERVER_REDIR_F_NONE); 120 125 crServerDeleteMuralFBO(mural); 121 126 return; … … 123 128 124 129 crServerVBoxCompositionDisableEnter(mural); 125 126 if (cr_server.screenCount<2 && !cr_server.bForceOffscreenRendering)127 {128 CRScreenViewportInfo *pVieport = &cr_server.screenVieport[mural->screenId];129 CRASSERT(cr_server.screenCount>0);130 CRASSERT(mural->fUseFBO == CR_SERVER_REDIR_NONE);131 132 mural->hX = mural->gX-cr_server.screen[0].x;133 mural->hY = mural->gY-cr_server.screen[0].y;134 135 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX - pVieport->x, mural->hY - pVieport->y);136 137 crServerVBoxCompositionDisableLeave(mural, GL_FALSE);138 139 return;140 }141 130 142 131 tlS = crServerGetPointScreen(mural->gX, mural->gY); 143 132 brS = crServerGetPointScreen(mural->gX+mural->width-1, mural->gY+mural->height-1); 144 133 145 if (tlS==brS && tlS>=0) 146 { 147 overlappingScreenCount = 1; 148 primaryS = tlS; 134 if ((tlS==brS && tlS>=0) || cr_server.screenCount <= 1) 135 { 136 if (cr_server.screenCount <= 1) 137 { 138 if (tlS != brS) 139 { 140 if (tlS >= 0) 141 brS = tlS; 142 else 143 tlS = brS; 144 } 145 146 primaryS = 0; 147 } 148 149 Assert(brS == tlS); 150 151 if (tlS>=0 && cr_server.screen[tlS].winID) 152 { 153 overlappingScreenCount = 1; 154 } 149 155 } 150 156 else 151 157 { 158 bool fFoundWindIdScreen = false; 152 159 trS = crServerGetPointScreen(mural->gX+mural->width-1, mural->gY); 153 160 blS = crServerGetPointScreen(mural->gX, mural->gY+mural->height-1); … … 159 166 || crServerMuralCoverScreen(mural, i)) 160 167 { 161 overlappingScreenCount++; 162 primaryS = primaryS<0 ? i:primaryS; 163 } 164 } 165 166 if (!overlappingScreenCount) 168 if ((!fFoundWindIdScreen && cr_server.screen[i].winID) || primaryS<0) 169 primaryS = i; 170 171 if (cr_server.screen[i].winID) 172 { 173 overlappingScreenCount++; 174 fFoundWindIdScreen = true; 175 } 176 } 177 } 178 179 if (primaryS<0) 167 180 { 168 181 primaryS = 0; … … 170 183 } 171 184 172 if (primaryS!=mural->screenId) 173 { 174 mural->screenId = primaryS; 175 176 renderspuSetWindowId(cr_server.screen[primaryS].winID); 185 winID = overlappingScreenCount ? cr_server.screen[primaryS].winID : 0; 186 187 if (!winID == !mural->fHasParentWindow 188 || (winID && primaryS!=mural->screenId)) 189 { 190 mural->fHasParentWindow = !!winID; 191 192 renderspuSetWindowId(winID); 177 193 renderspuReparentWindow(mural->spuWindow); 178 194 renderspuSetWindowId(cr_server.screen[0].winID); 179 195 } 180 196 197 mural->screenId = primaryS; 198 181 199 mural->hX = mural->gX-cr_server.screen[primaryS].x; 182 200 mural->hY = mural->gY-cr_server.screen[primaryS].y; 183 201 184 if (overlappingScreenCount<2 && !cr_server.bForceOffscreenRendering) 202 fPresentMode = cr_server.fPresentMode; 203 if (!overlappingScreenCount) 204 fPresentMode &= ~CR_SERVER_REDIR_F_DISPLAY; 205 else if (overlappingScreenCount > 1) 206 fPresentMode = (fPresentMode | CR_SERVER_REDIR_F_FBO_RAM_VMFB) & ~CR_SERVER_REDIR_F_DISPLAY; 207 208 fPresentMode = crServerRedirModeAdjust(fPresentMode); 209 210 if (!(fPresentMode & CR_SERVER_REDIR_F_FBO)) 211 { 212 crServerRedirMuralFBO(mural, fPresentMode); 213 crServerDeleteMuralFBO(mural); 214 } 215 else 216 { 217 if (mural->fPresentMode & CR_SERVER_REDIR_F_FBO) 218 { 219 if (mural->width!=mural->fboWidth 220 || mural->height!=mural->fboHeight) 221 { 222 crServerRedirMuralFBO(mural, fPresentMode & CR_SERVER_REDIR_F_DISPLAY); 223 crServerDeleteMuralFBO(mural); 224 } 225 } 226 227 crServerRedirMuralFBO(mural, fPresentMode); 228 } 229 230 if (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY) 185 231 { 186 232 CRScreenViewportInfo *pVieport = &cr_server.screenVieport[mural->screenId]; 187 233 188 if (mural->fUseFBO)189 {190 crServerRedirMuralFBO(mural, CR_SERVER_REDIR_NONE);191 crServerDeleteMuralFBO(mural);192 }193 194 234 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX - pVieport->x, mural->hY - pVieport->y); 195 }196 else197 {198 GLubyte redir = overlappingScreenCount >= 2 ? CR_SERVER_REDIR_FBO_RAM : cr_server.bForceOffscreenRendering;199 200 if (mural->spuWindow)201 {202 if (mural->fUseFBO)203 {204 if (mural->width!=mural->fboWidth205 || mural->height!=mural->fboHeight)206 {207 crServerRedirMuralFBO(mural, CR_SERVER_REDIR_NONE);208 crServerDeleteMuralFBO(mural);209 }210 }211 212 if (mural->fUseFBO != redir)213 {214 crServerRedirMuralFBO(mural, redir);215 }216 }217 #ifdef DEBUG_misha218 else219 {220 Assert(!mural->fUseFBO);221 }222 #endif223 224 if (mural->fUseFBO != CR_SERVER_REDIR_FBO_RAM)225 {226 CRScreenViewportInfo *pVieport = &cr_server.screenVieport[mural->screenId];227 228 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX - pVieport->x, mural->hY - pVieport->y);229 }230 235 } 231 236 … … 258 263 static void crServerCreateMuralFBO(CRMuralInfo *mural); 259 264 260 void crServerRedirMuralFBO(CRMuralInfo *mural, GLubyte redir) 261 { 262 if (mural->fUseFBO == redir) 263 { 264 if (redir) 265 crWarning("crServerRedirMuralFBO called with the same redir status %d", redir); 265 void crServerEnableDisplayMuralFBO(CRMuralInfo *mural, GLboolean fEnable) 266 { 267 if (!mural->CreateInfo.externalID) 268 return; 269 270 if (fEnable) 271 { 272 if (!(mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)) 273 { 274 if (mural->bVisible) 275 cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, GL_TRUE); 276 mural->fPresentMode |= CR_SERVER_REDIR_F_DISPLAY; 277 } 278 } 279 else 280 { 281 if ((mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)) 282 { 283 if (mural->bVisible) 284 cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, GL_FALSE); 285 mural->fPresentMode &= ~CR_SERVER_REDIR_F_DISPLAY; 286 } 287 } 288 } 289 290 void crServerRedirMuralFBO(CRMuralInfo *mural, GLuint redir) 291 { 292 if (mural->fPresentMode == redir) 293 { 294 // if (redir) 295 // crWarning("crServerRedirMuralFBO called with the same redir status %d", redir); 266 296 return; 267 297 } … … 269 299 crServerVBoxCompositionDisableEnter(mural); 270 300 271 if (redir )301 if (redir & CR_SERVER_REDIR_F_FBO) 272 302 { 273 303 if (!crServerSupportRedirMuralFBO()) 274 304 { 275 305 crWarning("FBO not supported, can't redirect window output"); 276 crServerVBoxCompositionDisableLeave(mural, GL_FALSE); 277 return; 278 } 279 280 if (redir == CR_SERVER_REDIR_FBO_RAM) 281 cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, GL_FALSE); 282 else 283 cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, mural->bVisible); 306 goto end; 307 } 284 308 285 309 if (mural->aidFBOs[0]==0) … … 288 312 } 289 313 290 if (cr_server.cur rentMural == mural)314 if (cr_server.curClient && cr_server.curClient->currentMural == mural) 291 315 { 292 316 if (!crStateGetCurrent()->framebufferobject.drawFB) … … 305 329 else 306 330 { 307 if (mural->fUseFBO == CR_SERVER_REDIR_FBO_RAM) 308 cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, mural->bVisible); 309 310 if (cr_server.currentMural == mural) 331 if (cr_server.curClient && cr_server.curClient->currentMural == mural) 311 332 { 312 333 if (!crStateGetCurrent()->framebufferobject.drawFB) … … 324 345 } 325 346 326 mural->fUseFBO = redir; 347 crServerEnableDisplayMuralFBO(mural, !!(redir & CR_SERVER_REDIR_F_DISPLAY)); 348 349 mural->fPresentMode = redir; 350 351 end: 327 352 crServerVBoxCompositionDisableLeave(mural, GL_FALSE); 328 353 } … … 448 473 void crServerDeleteMuralFBO(CRMuralInfo *mural) 449 474 { 450 CRASSERT(! mural->fUseFBO);475 CRASSERT(!(mural->fPresentMode & CR_SERVER_REDIR_F_FBO)); 451 476 452 477 if (mural->aidFBOs[0]!=0) … … 539 564 CRASSERT(curCtx == crStateGetCurrent()); 540 565 566 Assert(mural->fPresentMode & CR_SERVER_REDIR_F_FBO); 567 Assert(mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY); 568 541 569 mural->fDataPresented = GL_TRUE; 542 570 … … 571 599 static void crServerVBoxCompositionReenable(CRMuralInfo *mural, GLboolean fForcePresent) 572 600 { 573 if ( mural->fUseFBO != CR_SERVER_REDIR_FBO_BLT601 if ((mural->fPresentMode & (CR_SERVER_REDIR_F_FBO | CR_SERVER_REDIR_F_DISPLAY)) != (CR_SERVER_REDIR_F_FBO | CR_SERVER_REDIR_F_DISPLAY) 574 602 || !mural->fDataPresented 575 603 || (!fForcePresent … … 582 610 static void crServerVBoxCompositionDisable(CRMuralInfo *mural) 583 611 { 584 if ( mural->fUseFBO != CR_SERVER_REDIR_FBO_BLT612 if ((mural->fPresentMode & (CR_SERVER_REDIR_F_FBO | CR_SERVER_REDIR_F_DISPLAY)) != (CR_SERVER_REDIR_F_FBO | CR_SERVER_REDIR_F_DISPLAY) 585 613 || !mural->fDataPresented) 586 614 return; … … 636 664 VBOXVR_TEXTURE Tex; 637 665 638 CRASSERT(mural->fUseFBO); 639 CRASSERT(cr_server.pfnPresentFBO || mural->fUseFBO == CR_SERVER_REDIR_FBO_BLT); 640 641 if (mural->fUseFBO == CR_SERVER_REDIR_FBO_BLT) 642 { 643 crServerVBoxCompositionPresent(mural); 644 return; 645 } 666 CRASSERT(mural->fPresentMode & CR_SERVER_REDIR_F_FBO); 667 CRASSERT(cr_server.pfnPresentFBO || (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)); 646 668 647 669 if (!crServerVBoxCompositionPresentNeeded(mural)) 648 670 return; 649 671 672 if (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY) 673 { 674 crServerVBoxCompositionPresentPerform(mural); 675 } 676 650 677 mural->fDataPresented = GL_TRUE; 678 679 if (!(mural->fPresentMode & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM)) 680 return; 651 681 652 682 Tex.width = mural->width; … … 675 705 } 676 706 677 for (i=0; i<cr_server.screenCount; ++i) 678 { 679 if (crServerIntersectScreen(mural, i, &rect)) 680 { 681 /* rect in window relative coords */ 682 crServerTransformRect(&rectwr, &rect, -mural->gX, -mural->gY); 683 684 if (!mural->pVisibleRects) 685 { 686 /*we don't get any rects info for guest compiz windows, so we treat windows as visible unless explicitly received 0 visible rects*/ 687 if (!mural->bReceivedRects) 707 if (mural->fPresentMode & CR_SERVER_REDIR_F_FBO_RAM_VMFB) 708 { 709 for (i=0; i<cr_server.screenCount; ++i) 710 { 711 if (crServerIntersectScreen(mural, i, &rect)) 712 { 713 /* rect in window relative coords */ 714 crServerTransformRect(&rectwr, &rect, -mural->gX, -mural->gY); 715 716 if (!mural->pVisibleRects) 688 717 { 689 tmppixels = crAlloc(4*(rect.x2-rect.x1)*(rect.y2-rect.y1));690 if (! tmppixels)718 /*we don't get any rects info for guest compiz windows, so we treat windows as visible unless explicitly received 0 visible rects*/ 719 if (!mural->bReceivedRects) 691 720 { 692 crWarning("Out of memory in crServerPresentFBO"); 693 crFree(pixels); 694 return; 695 } 696 697 crServerCopySubImage(tmppixels, pixels, &rectwr, mural->fboWidth, mural->fboHeight); 698 /*Note: pfnPresentFBO would free tmppixels*/ 699 cr_server.pfnPresentFBO(tmppixels, i, rect.x1-cr_server.screen[i].x, rect.y1-cr_server.screen[i].y, rect.x2-rect.x1, rect.y2-rect.y1); 700 } 701 } 702 else 703 { 704 for (j=0; j<mural->cVisibleRects; ++j) 705 { 706 if (crServerIntersectRect(&rectwr, (CRrecti*) &mural->pVisibleRects[4*j], §r)) 707 { 708 tmppixels = crAlloc(4*(sectr.x2-sectr.x1)*(sectr.y2-sectr.y1)); 721 tmppixels = crAlloc(4*(rect.x2-rect.x1)*(rect.y2-rect.y1)); 709 722 if (!tmppixels) 710 723 { … … 714 727 } 715 728 716 crServerCopySubImage(tmppixels, pixels, & sectr, mural->fboWidth, mural->fboHeight);729 crServerCopySubImage(tmppixels, pixels, &rectwr, mural->fboWidth, mural->fboHeight); 717 730 /*Note: pfnPresentFBO would free tmppixels*/ 718 cr_server.pfnPresentFBO(tmppixels, i, 719 sectr.x1+mural->gX-cr_server.screen[i].x, 720 sectr.y1+mural->gY-cr_server.screen[i].y, 721 sectr.x2-sectr.x1, sectr.y2-sectr.y1); 731 cr_server.pfnPresentFBO(tmppixels, i, rect.x1-cr_server.screen[i].x, rect.y1-cr_server.screen[i].y, rect.x2-rect.x1, rect.y2-rect.y1); 732 } 733 } 734 else 735 { 736 for (j=0; j<mural->cVisibleRects; ++j) 737 { 738 if (crServerIntersectRect(&rectwr, (CRrecti*) &mural->pVisibleRects[4*j], §r)) 739 { 740 tmppixels = crAlloc(4*(sectr.x2-sectr.x1)*(sectr.y2-sectr.y1)); 741 if (!tmppixels) 742 { 743 crWarning("Out of memory in crServerPresentFBO"); 744 crFree(pixels); 745 return; 746 } 747 748 crServerCopySubImage(tmppixels, pixels, §r, mural->fboWidth, mural->fboHeight); 749 /*Note: pfnPresentFBO would free tmppixels*/ 750 cr_server.pfnPresentFBO(tmppixels, i, 751 sectr.x1+mural->gX-cr_server.screen[i].x, 752 sectr.y1+mural->gY-cr_server.screen[i].y, 753 sectr.x2-sectr.x1, sectr.y2-sectr.y1); 754 } 722 755 } 723 756 } … … 749 782 return cr_server.curClient 750 783 && cr_server.curClient->currentMural 751 && cr_server.curClient->currentMural->fUseFBO;784 && (cr_server.curClient->currentMural->fPresentMode & CR_SERVER_REDIR_F_FBO); 752 785 } 753 786 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r45201 r45248 83 83 mural->spuWindow = spuWindow; 84 84 mural->screenId = 0; 85 mural->fHasParentWindow = !!cr_server.screen[0].winID; 85 86 mural->bVisible = !!dims[0]; 86 mural->f UseFBO = CR_SERVER_REDIR_NONE;87 mural->fPresentMode = CR_SERVER_REDIR_F_NONE; 87 88 88 89 mural->cVisibleRects = 0; … … 266 267 } 267 268 268 crServerRedirMuralFBO(mural, CR_SERVER_REDIR_ NONE);269 crServerRedirMuralFBO(mural, CR_SERVER_REDIR_F_NONE); 269 270 crServerDeleteMuralFBO(mural); 270 271 … … 437 438 void crServerMuralSize(CRMuralInfo *mural, GLint width, GLint height) 438 439 { 439 if (mural->width != width || mural->height != height) 440 { 441 uint32_t cRects; 442 const RTRECT *pRects; 443 RTRECT Rect; 444 VBOXVR_TEXTURE Tex; 445 int rc = VINF_SUCCESS; 446 Tex.width = width; 447 Tex.height = height; 448 Tex.target = GL_TEXTURE_2D; 449 Tex.hwid = 0; 450 451 452 /* since we're going to change the current compositor & the window we need to avoid 453 * renderspu fron dealing with inconsistent data, i.e. modified compositor and 454 * still unmodified window. 455 * So what we do is: 456 * 1. tell renderspu to stop using the current compositor -> renderspu would do necessary synchronization with its redraw thread to ensure compositor is no longer used 457 * 2. do necessary modifications 458 * 3. (so far not needed for resize, but in case it is in the future) re-set the compositor */ 459 460 /* 1. tell renderspu to stop using the current compositor (see above comment) */ 461 crServerVBoxCompositionDisableEnter(mural); 462 463 /* 2. do necessary modifications (see above comment) */ 464 /* NOTE: we can do it even if mural->fUseFBO == CR_SERVER_REDIR_NONE to make sure the compositor data is always up to date */ 465 /* the compositor lock is not needed actually since we have prevented renderspu from using the compositor */ 466 /* CrVrScrCompositorLock(&mural->Compositor); */ 467 rc = CrVrScrCompositorEntryRemove(&mural->Compositor, &mural->CEntry); 440 uint32_t cRects; 441 const RTRECT *pRects; 442 RTRECT Rect; 443 VBOXVR_TEXTURE Tex; 444 int rc = VINF_SUCCESS; 445 Tex.width = width; 446 Tex.height = height; 447 Tex.target = GL_TEXTURE_2D; 448 Tex.hwid = 0; 449 450 if (mural->width == width && mural->height == height) 451 return; 452 453 454 /* since we're going to change the current compositor & the window we need to avoid 455 * renderspu fron dealing with inconsistent data, i.e. modified compositor and 456 * still unmodified window. 457 * So what we do is: 458 * 1. tell renderspu to stop using the current compositor -> renderspu would do necessary synchronization with its redraw thread to ensure compositor is no longer used 459 * 2. do necessary modifications 460 * 3. (so far not needed for resize, but in case it is in the future) re-set the compositor */ 461 462 /* 1. tell renderspu to stop using the current compositor (see above comment) */ 463 crServerVBoxCompositionDisableEnter(mural); 464 465 /* 2. do necessary modifications (see above comment) */ 466 /* NOTE: we can do it even if mural->fPresentMode == CR_SERVER_REDIR_F_NONE to make sure the compositor data is always up to date */ 467 /* the compositor lock is not needed actually since we have prevented renderspu from using the compositor */ 468 /* CrVrScrCompositorLock(&mural->Compositor); */ 469 rc = CrVrScrCompositorEntryRemove(&mural->Compositor, &mural->CEntry); 470 if (!RT_SUCCESS(rc)) 471 { 472 crWarning("CrVrScrCompositorEntryRemove failed, rc %d", rc); 473 goto end; 474 } 475 CrVrScrCompositorEntryInit(&mural->CEntry, &Tex); 476 /* initially set regions to all visible since this is what some guest assume 477 * and will not post any more visible regions command */ 478 Rect.xLeft = 0; 479 Rect.xRight = width; 480 Rect.yTop = 0; 481 Rect.yBottom = height; 482 rc = CrVrScrCompositorEntryRegionsSet(&mural->Compositor, &mural->CEntry, NULL, 1, &Rect, NULL); 483 if (!RT_SUCCESS(rc)) 484 { 485 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc); 486 goto end; 487 } 488 /* CrVrScrCompositorUnlock(&mural->Compositor); */ 489 mural->width = width; 490 mural->height = height; 491 492 mural->fDataPresented = GL_FALSE; 493 494 if (cr_server.currentMural == mural) 495 { 496 crStateGetCurrent()->buffer.width = mural->width; 497 crStateGetCurrent()->buffer.height = mural->height; 498 } 499 500 if (mural->fRootVrOn) 501 { 502 rc = CrVrScrCompositorEntryRemove(&mural->RootVrCompositor, &mural->RootVrCEntry); 468 503 if (!RT_SUCCESS(rc)) 469 504 { 470 505 crWarning("CrVrScrCompositorEntryRemove failed, rc %d", rc); 471 return;472 } 473 CrVrScrCompositorEntryInit(&mural-> CEntry, &Tex);506 goto end; 507 } 508 CrVrScrCompositorEntryInit(&mural->RootVrCEntry, &Tex); 474 509 /* initially set regions to all visible since this is what some guest assume 475 510 * and will not post any more visible regions command */ … … 478 513 Rect.yTop = 0; 479 514 Rect.yBottom = height; 480 rc = CrVrScrCompositorEntryRegionsSet(&mural-> Compositor, &mural->CEntry, NULL, 1, &Rect, NULL);515 rc = CrVrScrCompositorEntryRegionsSet(&mural->RootVrCompositor, &mural->RootVrCEntry, NULL, 1, &Rect, NULL); 481 516 if (!RT_SUCCESS(rc)) 482 517 { 483 518 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc); 484 return; 485 } 486 /* CrVrScrCompositorUnlock(&mural->Compositor); */ 487 mural->width = width; 488 mural->height = height; 489 490 mural->fDataPresented = GL_FALSE; 491 492 if (cr_server.currentMural == mural) 493 { 494 crStateGetCurrent()->buffer.width = mural->width; 495 crStateGetCurrent()->buffer.height = mural->height; 496 } 497 519 goto end; 520 } 521 522 crServerVBoxRootVrTranslateForMural(mural); 523 rc = CrVrScrCompositorEntryListIntersect(&mural->RootVrCompositor, &mural->RootVrCEntry, &cr_server.RootVr, NULL); 524 if (!RT_SUCCESS(rc)) 525 { 526 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc); 527 goto end; 528 } 529 530 rc = CrVrScrCompositorEntryRegionsGet(&mural->RootVrCompositor, &mural->RootVrCEntry, &cRects, NULL, &pRects); 531 if (!RT_SUCCESS(rc)) 532 { 533 crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc); 534 goto end; 535 } 536 } 537 else 538 { 539 rc = CrVrScrCompositorEntryRegionsGet(&mural->Compositor, &mural->CEntry, &cRects, NULL, &pRects); 540 if (!RT_SUCCESS(rc)) 541 { 542 crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc); 543 goto end; 544 } 545 } 546 547 crServerCheckMuralGeometry(mural); 548 549 cr_server.head_spu->dispatch_table.WindowSize(mural->spuWindow, width, height); 550 551 cr_server.head_spu->dispatch_table.WindowVisibleRegion(mural->spuWindow, cRects, pRects); 552 553 if (mural->pvOutputRedirectInstance) 554 { 498 555 if (mural->fRootVrOn) 499 {500 rc = CrVrScrCompositorEntryRemove(&mural->RootVrCompositor, &mural->RootVrCEntry);501 if (!RT_SUCCESS(rc))502 {503 crWarning("CrVrScrCompositorEntryRemove failed, rc %d", rc);504 return;505 }506 CrVrScrCompositorEntryInit(&mural->RootVrCEntry, &Tex);507 /* initially set regions to all visible since this is what some guest assume508 * and will not post any more visible regions command */509 Rect.xLeft = 0;510 Rect.xRight = width;511 Rect.yTop = 0;512 Rect.yBottom = height;513 rc = CrVrScrCompositorEntryRegionsSet(&mural->RootVrCompositor, &mural->RootVrCEntry, NULL, 1, &Rect, NULL);514 if (!RT_SUCCESS(rc))515 {516 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc);517 return;518 }519 520 crServerVBoxRootVrTranslateForMural(mural);521 rc = CrVrScrCompositorEntryListIntersect(&mural->RootVrCompositor, &mural->RootVrCEntry, &cr_server.RootVr, NULL);522 if (!RT_SUCCESS(rc))523 {524 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc);525 return;526 }527 528 rc = CrVrScrCompositorEntryRegionsGet(&mural->RootVrCompositor, &mural->RootVrCEntry, &cRects, NULL, &pRects);529 if (!RT_SUCCESS(rc))530 {531 crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc);532 return;533 }534 }535 else536 556 { 537 557 rc = CrVrScrCompositorEntryRegionsGet(&mural->Compositor, &mural->CEntry, &cRects, NULL, &pRects); … … 539 559 { 540 560 crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc); 541 return; 542 } 543 } 544 545 crServerCheckMuralGeometry(mural); 546 547 cr_server.head_spu->dispatch_table.WindowSize(mural->spuWindow, width, height); 548 549 cr_server.head_spu->dispatch_table.WindowVisibleRegion(mural->spuWindow, cRects, pRects); 550 551 if (mural->pvOutputRedirectInstance) 552 { 553 if (mural->fRootVrOn) 554 { 555 rc = CrVrScrCompositorEntryRegionsGet(&mural->Compositor, &mural->CEntry, &cRects, NULL, &pRects); 556 if (!RT_SUCCESS(rc)) 557 { 558 crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc); 559 return; 560 } 561 } 562 /* @todo the code assumes that RTRECT == four GLInts. */ 563 cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance, 564 cRects, pRects); 565 } 566 567 /* 3. (so far not needed for resize, but in case it is in the future) re-set the compositor (see above comment) */ 568 /* uncomment when needed */ 569 /* NOTE: !!! we have mural->fHasPresentationData set to GL_FALSE above, so crServerVBoxCompositionReenable will have no effect in any way 570 571 */ 572 crServerVBoxCompositionDisableLeave(mural, GL_FALSE); 573 } 561 goto end; 562 } 563 } 564 /* @todo the code assumes that RTRECT == four GLInts. */ 565 cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance, 566 cRects, pRects); 567 } 568 569 end: 570 /* 3. (so far not needed for resize, but in case it is in the future) re-set the compositor (see above comment) */ 571 /* uncomment when needed */ 572 /* NOTE: !!! we have mural->fHasPresentationData set to GL_FALSE above, so crServerVBoxCompositionReenable will have no effect in any way 573 574 */ 575 crServerVBoxCompositionDisableLeave(mural, GL_FALSE); 576 574 577 } 575 578 … … 623 626 624 627 /* 2. do necessary modifications (see above comment) */ 625 /* NOTE: we can do it even if mural->fUseFBO == CR_SERVER_REDIR_NONEto make sure the compositor data is always up to date */628 /* NOTE: we can do it even if !(mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY) to make sure the compositor data is always up to date */ 626 629 627 630 if (mural->gX != x || mural->gY != y) … … 709 712 } 710 713 711 /* NOTE: we can do it even if mural->fUseFBO = CR_SERVER_REDIR_NONEto make sure the compositor data is always up to date */714 /* NOTE: we can do it even if !(mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY) to make sure the compositor data is always up to date */ 712 715 /* the compositor lock is not needed actually since we have prevented renderspu from using the compositor */ 713 716 /* CrVrScrCompositorLock(&mural->Compositor); */ … … 717 720 { 718 721 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc); 719 return;722 goto end; 720 723 } 721 724 … … 731 734 { 732 735 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc); 733 return;736 goto end; 734 737 } 735 738 … … 739 742 { 740 743 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc); 741 return;744 goto end; 742 745 } 743 746 … … 746 749 { 747 750 crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc); 748 return;751 goto end; 749 752 } 750 753 } … … 755 758 { 756 759 crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc); 757 return;760 goto end; 758 761 } 759 762 } … … 769 772 { 770 773 crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc); 771 return;774 goto end; 772 775 } 773 776 } … … 776 779 } 777 780 } 778 781 end: 779 782 /* 3. re-set the compositor (see above comment) */ 780 783 crServerVBoxCompositionDisableLeave(mural, fForcePresent); … … 792 795 } 793 796 794 if (mural->f UseFBO != CR_SERVER_REDIR_FBO_RAM)797 if (mural->fPresentMode && CR_SERVER_REDIR_F_DISPLAY) 795 798 { 796 799 cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, state);
Note:
See TracChangeset
for help on using the changeset viewer.