Changeset 45066 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
- Timestamp:
- Mar 18, 2013 5:08:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r45053 r45066 31 31 return -1; 32 32 } 33 34 mural->fCompositorPresented = GL_FALSE;35 33 36 34 /* … … 332 330 Tex.hwid = 0; 333 331 334 if (mural->fUseFBO != CR_SERVER_REDIR_NONE) 335 { 336 /* since we're going to change the current compositor & the window we need to avoid 337 * renderspu fron dealing with inconsistent data, i.e. modified compositor and 338 * still unmodified window. 339 * So what we do is: 340 * 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 341 * 2. do necessary modifications 342 * 3. (so far not needed for resize, but in case it is in the future) re-set the compositor */ 343 344 /* 1. tell renderspu to stop using the current compositor (see above comment) */ 345 crServerVBoxCompositionDisable(mural); 346 } 347 348 mural->fCompositorPresented = GL_FALSE; 332 333 /* since we're going to change the current compositor & the window we need to avoid 334 * renderspu fron dealing with inconsistent data, i.e. modified compositor and 335 * still unmodified window. 336 * So what we do is: 337 * 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 338 * 2. do necessary modifications 339 * 3. (so far not needed for resize, but in case it is in the future) re-set the compositor */ 340 341 /* 1. tell renderspu to stop using the current compositor (see above comment) */ 342 crServerVBoxCompositionDisable(mural); 349 343 350 344 /* 2. do necessary modifications (see above comment) */ … … 377 371 /* 3. (so far not needed for resize, but in case it is in the future) re-set the compositor (see above comment) */ 378 372 /* uncomment when needed */ 379 /* NOTE: !!! we have mural->fCompositorPresented set to GL_FALSE above, so crServerVBoxCompositionReenable will have no effect in any way 380 if (mural->fUseFBO != CR_SERVER_REDIR_NONE) 381 { 382 crServerVBoxCompositionReenable(mural); 383 } 373 /* NOTE: !!! we have mural->fHasPresentationData set to GL_FALSE above, so crServerVBoxCompositionReenable will have no effect in any way 374 crServerVBoxCompositionReenable(mural); 384 375 */ 385 376 } … … 423 414 // if (mural->gX != x || mural->gY != y) 424 415 { 425 if (mural->fUseFBO != CR_SERVER_REDIR_NONE)426 {427 /* since we're going to change the current compositor & the window we need to avoid428 * renderspu fron dealing with inconsistent data, i.e. modified compositor and429 * still unmodified window.430 * So what we do is:431 * 1. tell renderspu to stop using the current compositor -> renderspu would do necessary synchronization with its redraw thread to ensure compositor is no longer used432 * 2. do necessary modifications433 * 3. re-set the compositor */434 435 /* 1. tell renderspu to stop using the current compositor (see above comment) */436 crServerVBoxCompositionDisable(mural);437 }438 439 /* 2. do necessary modifications (see above comment) */440 /* NOTE: we can do it even if mural->fUseFBO == CR_SERVER_REDIR_NONE to make sure the compositor data is always up to date */441 Pos.x = x;442 Pos.y = y;443 444 /* the compositor lock is not needed actually since we have prevented renderspu from using the compositor */445 /* CrVrScrCompositorLock(&mural->Compositor); */446 /* no need to set position because the position is relative to window */447 /*CrVrScrCompositorEntryPosSet(&mural->Compositor, &mural->CEntry, &Pos);*/448 /*CrVrScrCompositorUnlock(&mural->Compositor);*/449 450 mural->gX = x;451 mural->gY = y;452 453 crServerCheckMuralGeometry(mural);454 455 /* 3. re-set the compositor (see above comment) */456 if (mural->fUseFBO != CR_SERVER_REDIR_NONE)457 {458 crServerVBoxCompositionReenable(mural, false);459 }460 }461 }462 463 void SERVER_DISPATCH_APIENTRY464 crServerDispatchWindowVisibleRegion( GLint window, GLint cRects, GLint *pRects )465 {466 CRMuralInfo *mural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, window);467 bool fContainedRegions;468 if (!mural) {469 #if EXTRA_WARN470 crWarning("CRServer: invalid window %d passed to WindowVisibleRegion()", window);471 #endif472 return;473 }474 475 if (mural->fUseFBO != CR_SERVER_REDIR_NONE)476 {477 416 /* since we're going to change the current compositor & the window we need to avoid 478 417 * renderspu fron dealing with inconsistent data, i.e. modified compositor and … … 485 424 /* 1. tell renderspu to stop using the current compositor (see above comment) */ 486 425 crServerVBoxCompositionDisable(mural); 487 } 488 489 fContainedRegions = !CrVrScrCompositorIsEmpty(&mural->Compositor); 426 427 /* 2. do necessary modifications (see above comment) */ 428 /* NOTE: we can do it even if mural->fUseFBO == CR_SERVER_REDIR_NONE to make sure the compositor data is always up to date */ 429 Pos.x = x; 430 Pos.y = y; 431 432 /* the compositor lock is not needed actually since we have prevented renderspu from using the compositor */ 433 /* CrVrScrCompositorLock(&mural->Compositor); */ 434 /* no need to set position because the position is relative to window */ 435 /*CrVrScrCompositorEntryPosSet(&mural->Compositor, &mural->CEntry, &Pos);*/ 436 /*CrVrScrCompositorUnlock(&mural->Compositor);*/ 437 438 mural->gX = x; 439 mural->gY = y; 440 441 crServerCheckMuralGeometry(mural); 442 443 /* 3. re-set the compositor (see above comment) */ 444 crServerVBoxCompositionReenable(mural, GL_FALSE); 445 } 446 } 447 448 void SERVER_DISPATCH_APIENTRY 449 crServerDispatchWindowVisibleRegion( GLint window, GLint cRects, GLint *pRects ) 450 { 451 CRMuralInfo *mural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, window); 452 GLboolean fForcePresent = crServerVBoxCompositionPresentNeeded(mural); 453 if (!mural) { 454 #if EXTRA_WARN 455 crWarning("CRServer: invalid window %d passed to WindowVisibleRegion()", window); 456 #endif 457 return; 458 } 459 460 /* since we're going to change the current compositor & the window we need to avoid 461 * renderspu fron dealing with inconsistent data, i.e. modified compositor and 462 * still unmodified window. 463 * So what we do is: 464 * 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 465 * 2. do necessary modifications 466 * 3. re-set the compositor */ 467 468 /* 1. tell renderspu to stop using the current compositor (see above comment) */ 469 crServerVBoxCompositionDisable(mural); 470 490 471 /* 2. do necessary modifications (see above comment) */ 491 472 /* NOTE: we can do it even if mural->fUseFBO = CR_SERVER_REDIR_NONE to make sure the compositor data is always up to date */ … … 523 504 524 505 /* 3. re-set the compositor (see above comment) */ 525 if (mural->fUseFBO != CR_SERVER_REDIR_NONE) 526 { 527 crServerVBoxCompositionReenable(mural, fContainedRegions && CrVrScrCompositorIsEmpty(&mural->Compositor)); 528 } 529 } 530 531 506 crServerVBoxCompositionReenable(mural, fForcePresent); 507 } 532 508 533 509 void SERVER_DISPATCH_APIENTRY
Note:
See TracChangeset
for help on using the changeset viewer.