VirtualBox

Ignore:
Timestamp:
Mar 18, 2013 5:08:39 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL: misc bugfixes & cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c

    r45053 r45066  
    3131        return -1;
    3232    }
    33 
    34     mural->fCompositorPresented = GL_FALSE;
    3533
    3634    /*
     
    332330        Tex.hwid = 0;
    333331
    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);
    349343
    350344        /* 2. do necessary modifications (see above comment) */
     
    377371        /* 3. (so far not needed for resize, but in case it is in the future) re-set the compositor (see above comment) */
    378372        /* 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);
    384375        */
    385376    }
     
    423414//    if (mural->gX != x || mural->gY != y)
    424415    {
    425         if (mural->fUseFBO != CR_SERVER_REDIR_NONE)
    426         {
    427             /* since we're going to change the current compositor & the window we need to avoid
    428              * renderspu fron dealing with inconsistent data, i.e. modified compositor and
    429              * 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 used
    432              * 2. do necessary modifications
    433              * 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_APIENTRY
    464 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_WARN
    470          crWarning("CRServer: invalid window %d passed to WindowVisibleRegion()", window);
    471 #endif
    472          return;
    473     }
    474 
    475     if (mural->fUseFBO != CR_SERVER_REDIR_NONE)
    476     {
    477416        /* since we're going to change the current compositor & the window we need to avoid
    478417         * renderspu fron dealing with inconsistent data, i.e. modified compositor and
     
    485424        /* 1. tell renderspu to stop using the current compositor (see above comment) */
    486425        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
     448void SERVER_DISPATCH_APIENTRY
     449crServerDispatchWindowVisibleRegion( 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
    490471    /* 2. do necessary modifications (see above comment) */
    491472    /* NOTE: we can do it even if mural->fUseFBO = CR_SERVER_REDIR_NONE to make sure the compositor data is always up to date */
     
    523504
    524505    /* 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}
    532508
    533509void SERVER_DISPATCH_APIENTRY
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette