VirtualBox

Ignore:
Timestamp:
May 3, 2019 9:51:02 PM (6 years ago)
Author:
vboxsync
Message:

Additions/common/crOpengl,GuestHost/OpenGL,HostServices/SharedOpenGL: Eliminate all global variables from the state tracker library (state_tracker) in preparation of the SPU DLL merging, bugref:9435

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.cpp

    r78263 r78375  
    328328  switch (target) {
    329329    case GL_SHARE_CONTEXT_RESOURCES_CR:
    330         crStateShareContext(value);
     330        crStateShareContext(&cr_server.StateTracker, value);
    331331        break;
    332332    case GL_RCUSAGE_TEXTURE_SET_CR:
    333         crStateSetTextureUsed(value, GL_TRUE);
     333        crStateSetTextureUsed(&cr_server.StateTracker, value, GL_TRUE);
    334334        break;
    335335    case GL_RCUSAGE_TEXTURE_CLEAR_CR:
    336         crStateSetTextureUsed(value, GL_FALSE);
     336        crStateSetTextureUsed(&cr_server.StateTracker, value, GL_FALSE);
    337337        break;
    338338    case GL_PIN_TEXTURE_SET_CR:
    339         crStatePinTexture(value, GL_TRUE);
     339        crStatePinTexture(&cr_server.StateTracker, value, GL_TRUE);
    340340        break;
    341341    case GL_PIN_TEXTURE_CLEAR_CR:
    342         crStatePinTexture(value, GL_FALSE);
     342        crStatePinTexture(&cr_server.StateTracker, value, GL_FALSE);
    343343        break;
    344344    case GL_SHARED_DISPLAY_LISTS_CR:
     
    502502            GLuint tID, fboID;
    503503            GLenum status;
    504             CRContext *ctx = crStateGetCurrent();
     504            CRContext *ctx = crStateGetCurrent(&cr_server.StateTracker);
    505505
    506506            gl->GenTextures(1, &tID);
     
    601601            GLint dRow;
    602602            GLuint pboId, sRow;
    603             CRContext *ctx = crStateGetCurrent();
     603            CRContext *ctx = crStateGetCurrent(&cr_server.StateTracker);
    604604
    605605            gl->GenBuffersARB(1, &pboId);
     
    897897    CR_BLITTER_CONTEXT Ctx;
    898898    CRMuralInfo *mural;
    899     CRContext *ctx = crStateGetCurrent();
     899    CRContext *ctx = crStateGetCurrent(&cr_server.StateTracker);
    900900    PVBOXVR_TEXTURE pDrawTex, pReadTex;
    901901    VBOXVR_TEXTURE DrawTex, ReadTex;
     
    992992                                   GLbitfield mask, GLenum filter)
    993993{
    994     CRContext *ctx = crStateGetCurrent();
     994    CRContext *ctx = crStateGetCurrent(&cr_server.StateTracker);
    995995    bool fTryBlitter = false;
    996996#ifdef CR_CHECK_BLITS
     
    12741274void SERVER_DISPATCH_APIENTRY crServerDispatchDrawBuffer( GLenum mode )
    12751275{
    1276     crStateDrawBuffer( mode );
    1277 
    1278     if (!crStateGetCurrent()->framebufferobject.drawFB)
     1276    crStateDrawBuffer(&cr_server.StateTracker, mode );
     1277
     1278    if (!crStateGetCurrent(&cr_server.StateTracker)->framebufferobject.drawFB)
    12791279    {
    12801280        if (mode == GL_FRONT || mode == GL_FRONT_LEFT || mode == GL_FRONT_RIGHT)
     
    13621362void SERVER_DISPATCH_APIENTRY crServerDispatchReadBuffer( GLenum mode )
    13631363{
    1364     crStateReadBuffer( mode );
     1364    crStateReadBuffer(&cr_server.StateTracker, mode );
    13651365
    13661366    if (crServerIsRedirectedToFBO()
    13671367            && cr_server.curClient->currentMural->aidFBOs[0]
    1368             && !crStateGetCurrent()->framebufferobject.readFB)
     1368            && !crStateGetCurrent(&cr_server.StateTracker)->framebufferobject.readFB)
    13691369    {
    13701370        CRMuralInfo *mural = cr_server.curClient->currentMural;
     
    14331433{
    14341434    GLenum retval, err;
    1435     CRContext *ctx = crStateGetCurrent();
     1435    CRContext *ctx = crStateGetCurrent(&cr_server.StateTracker);
    14361436    retval = ctx->error;
    14371437
     
    14531453crServerMakeTmpCtxCurrent( GLint window, GLint nativeWindow, GLint context )
    14541454{
    1455     CRContext *pCtx = crStateGetCurrent();
     1455    CRContext *pCtx = crStateGetCurrent(&cr_server.StateTracker);
    14561456    CRContext *pCurCtx = NULL;
    14571457    GLuint idDrawFBO = 0, idReadFBO = 0;
     
    18901890GLvoid crServerSpriteCoordReplEnable(GLboolean fEnable)
    18911891{
    1892     CRContext *g = crStateGetCurrent();
     1892    CRContext *g = crStateGetCurrent(&cr_server.StateTracker);
    18931893    CRTextureState *t = &(g->texture);
    18941894    GLuint curTextureUnit = t->curTextureUnit;
     
    19481948void SERVER_DISPATCH_APIENTRY crServerDispatchEnd( void )
    19491949{
    1950     CRContext *g = crStateGetCurrent();
     1950    CRContext *g = crStateGetCurrent(&cr_server.StateTracker);
    19511951    GLenum mode = g->current.mode;
    19521952
    1953     crStateEnd();
     1953    crStateEnd(&cr_server.StateTracker);
    19541954    cr_server.head_spu->dispatch_table.End();
    19551955
     
    19631963{
    19641964#ifdef DEBUG
    1965     CRContext *ctx = crStateGetCurrent();
     1965    CRContext *ctx = crStateGetCurrent(&cr_server.StateTracker);
    19661966    SPUDispatchTable *gl = &cr_server.head_spu->dispatch_table;
    19671967
     
    20122012    CR_SERVER_DUMP_DRAW_ENTER();
    20132013
    2014     crStateBegin(mode);
     2014    crStateBegin(&cr_server.StateTracker, mode);
    20152015    cr_server.head_spu->dispatch_table.Begin(mode);
    20162016}
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