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/GuestHost/OpenGL/state_tracker/state_pixel.c

    r74890 r78375  
    1414{
    1515    CRPixelState *p = &ctx->pixel;
    16     CRStateBits *sb = GetCurrentBits();
     16    CRStateBits *sb = GetCurrentBits(ctx->pStateTracker);
    1717    CRPixelBits *pb = &(sb->pixel);
    1818    GLcolorf zero_color = {0.0f, 0.0f, 0.0f, 0.0f};
     
    5858}
    5959
    60 void STATE_APIENTRY crStatePixelTransferi (GLenum pname, GLint param)
    61 {
    62     crStatePixelTransferf( pname, (GLfloat) param );
    63 }
    64 
    65 void STATE_APIENTRY crStatePixelTransferf (GLenum pname, GLfloat param)
    66 {
    67     CRContext *g = GetCurrentContext();
     60void STATE_APIENTRY crStatePixelTransferi (PCRStateTracker pState, GLenum pname, GLint param)
     61{
     62    crStatePixelTransferf(pState, pname, (GLfloat) param );
     63}
     64
     65void STATE_APIENTRY crStatePixelTransferf (PCRStateTracker pState, GLenum pname, GLfloat param)
     66{
     67    CRContext *g = GetCurrentContext(pState);
    6868    CRPixelState *p = &(g->pixel);
    69     CRStateBits *sb = GetCurrentBits();
     69    CRStateBits *sb = GetCurrentBits(pState);
    7070    CRPixelBits *pb = &(sb->pixel);
    7171
    7272    if (g->current.inBeginEnd)
    7373    {
    74         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, "PixelTransfer{if} called in Begin/End");
     74        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION, "PixelTransfer{if} called in Begin/End");
    7575        return;
    7676    }
     
    123123            break;
    124124        default:
    125             crStateError( __LINE__, __FILE__, GL_INVALID_VALUE, "Unknown glPixelTransfer pname: %d", pname );
     125            crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "Unknown glPixelTransfer pname: %d", pname );
    126126            return;
    127127    }
     
    130130}
    131131
    132 void STATE_APIENTRY crStatePixelZoom (GLfloat xfactor, GLfloat yfactor)
    133 {
    134     CRContext *g = GetCurrentContext();
     132void STATE_APIENTRY crStatePixelZoom (PCRStateTracker pState, GLfloat xfactor, GLfloat yfactor)
     133{
     134    CRContext *g = GetCurrentContext(pState);
    135135    CRPixelState *p = &(g->pixel);
    136     CRStateBits *sb = GetCurrentBits();
     136    CRStateBits *sb = GetCurrentBits(pState);
    137137    CRPixelBits *pb = &(sb->pixel);
    138138
    139139    if (g->current.inBeginEnd)
    140140    {
    141         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, "PixelZoom called in Begin/End");
     141        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION, "PixelZoom called in Begin/End");
    142142        return;
    143143    }
     
    152152
    153153
    154 void STATE_APIENTRY crStateBitmap( GLsizei width, GLsizei height,
     154void STATE_APIENTRY crStateBitmap(PCRStateTracker pState, GLsizei width, GLsizei height,
    155155        GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove,
    156156        const GLubyte *bitmap)
    157157{
    158     CRContext *g = GetCurrentContext();
     158    CRContext *g = GetCurrentContext(pState);
    159159    CRCurrentState *c = &(g->current);
    160     CRStateBits *sb = GetCurrentBits();
     160    CRStateBits *sb = GetCurrentBits(pState);
    161161    CRCurrentBits *cb = &(sb->current);
    162162
     
    170170    if (g->current.inBeginEnd)
    171171    {
    172         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     172        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    173173            "Bitmap called in begin/end");
    174174        return;
     
    177177    if (width < 0 || height < 0)
    178178    {
    179         crStateError(__LINE__, __FILE__, GL_INVALID_VALUE,
     179        crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE,
    180180            "Bitmap called with neg dims: %dx%d", width, height);
    181181        return;
     
    201201#define CLAMP(x, min, max)  ((x) < (min) ? (min) : ((x) > (max) ? (max) : (x)))
    202202
    203 void STATE_APIENTRY crStatePixelMapfv (GLenum map, GLint mapsize, const GLfloat * values)
    204 {
    205     CRContext *g = GetCurrentContext();
     203void STATE_APIENTRY crStatePixelMapfv (PCRStateTracker pState, GLenum map, GLint mapsize, const GLfloat * values)
     204{
     205    CRContext *g = GetCurrentContext(pState);
    206206    CRPixelState *p = &(g->pixel);
    207     CRStateBits *sb = GetCurrentBits();
     207    CRStateBits *sb = GetCurrentBits(pState);
    208208    CRPixelBits *pb = &(sb->pixel);
    209209    GLint i;
    210     GLboolean unpackbuffer = crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB);
     210    GLboolean unpackbuffer = crStateIsBufferBound(pState, GL_PIXEL_UNPACK_BUFFER_ARB);
    211211
    212212    if (g->current.inBeginEnd) {
    213         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, "PixelMap called in Begin/End");
     213        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION, "PixelMap called in Begin/End");
    214214        return;
    215215    }
     
    218218
    219219    if (mapsize < 0 || mapsize > CR_MAX_PIXEL_MAP_TABLE) {
    220        crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "PixelMap(mapsize)");
     220       crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "PixelMap(mapsize)");
    221221       return;
    222222    }
     
    302302        break;
    303303    default:
    304         crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "PixelMap(map)");
     304        crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "PixelMap(map)");
    305305        return;
    306306    }
     
    310310}
    311311
    312 void STATE_APIENTRY crStatePixelMapuiv (GLenum map, GLint mapsize, const GLuint * values)
     312void STATE_APIENTRY crStatePixelMapuiv (PCRStateTracker pState, GLenum map, GLint mapsize, const GLuint * values)
    313313{
    314314    if (mapsize < 0 || mapsize > CR_MAX_PIXEL_MAP_TABLE)
     
    318318    }
    319319
    320     if (!crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
     320    if (!crStateIsBufferBound(pState, GL_PIXEL_UNPACK_BUFFER_ARB))
    321321    {
    322322        GLfloat fvalues[CR_MAX_PIXEL_MAP_TABLE];
     
    333333           }
    334334        }
    335         crStatePixelMapfv(map, mapsize, fvalues);
     335        crStatePixelMapfv(pState, map, mapsize, fvalues);
    336336    }
    337337    else
    338338    {
    339         crStatePixelMapfv(map, mapsize, (const GLfloat*) values);
     339        crStatePixelMapfv(pState, map, mapsize, (const GLfloat*) values);
    340340    }
    341341}
    342342 
    343 void STATE_APIENTRY crStatePixelMapusv (GLenum map, GLint mapsize, const GLushort * values)
     343void STATE_APIENTRY crStatePixelMapusv (PCRStateTracker pState, GLenum map, GLint mapsize, const GLushort * values)
    344344{
    345345    if (mapsize < 0 || mapsize > CR_MAX_PIXEL_MAP_TABLE)
     
    349349    }
    350350
    351     if (!crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
     351    if (!crStateIsBufferBound(pState, GL_PIXEL_UNPACK_BUFFER_ARB))
    352352    {
    353353        GLfloat fvalues[CR_MAX_PIXEL_MAP_TABLE];
     
    364364           }
    365365        }
    366         crStatePixelMapfv(map, mapsize, fvalues);
     366        crStatePixelMapfv(pState, map, mapsize, fvalues);
    367367    }
    368368    else
    369369    {
    370         crStatePixelMapfv(map, mapsize, (const GLfloat*) values);
     370        crStatePixelMapfv(pState, map, mapsize, (const GLfloat*) values);
    371371    }
    372372}
    373373
    374374 
    375 void STATE_APIENTRY crStateGetPixelMapfv (GLenum map, GLfloat * values)
    376 {
    377     CRContext *g = GetCurrentContext();
     375void STATE_APIENTRY crStateGetPixelMapfv (PCRStateTracker pState, GLenum map, GLfloat * values)
     376{
     377    CRContext *g = GetCurrentContext(pState);
    378378    CRPixelState *p = &(g->pixel);
    379379    GLint i;
    380380
    381381    if (g->current.inBeginEnd) {
    382         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     382        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    383383                     "GetPixelMapfv called in Begin/End");
    384384        return;
     
    421421        break;
    422422    default:
    423         crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "GetPixelMap(map)");
     423        crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "GetPixelMap(map)");
    424424        return;
    425425    }
    426426}
    427427 
    428 void STATE_APIENTRY crStateGetPixelMapuiv (GLenum map, GLuint * values)
    429 {
    430     CRContext *g = GetCurrentContext();
     428void STATE_APIENTRY crStateGetPixelMapuiv (PCRStateTracker pState, GLenum map, GLuint * values)
     429{
     430    CRContext *g = GetCurrentContext(pState);
    431431    const GLfloat maxUint = 4294967295.0F;
    432432    CRPixelState *p = &(g->pixel);
     
    434434
    435435    if (g->current.inBeginEnd) {
    436         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     436        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    437437                     "GetPixelMapuiv called in Begin/End");
    438438        return;
     
    491491        break;
    492492    default:
    493         crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "GetPixelMapuiv(map)");
     493        crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "GetPixelMapuiv(map)");
    494494        return;
    495495    }
    496496}
    497497 
    498 void STATE_APIENTRY crStateGetPixelMapusv (GLenum map, GLushort * values)
    499 {
    500     CRContext *g = GetCurrentContext();
     498void STATE_APIENTRY crStateGetPixelMapusv (PCRStateTracker pState, GLenum map, GLushort * values)
     499{
     500    CRContext *g = GetCurrentContext(pState);
    501501    const GLfloat maxUshort = 65535.0F;
    502502    CRPixelState *p = &(g->pixel);
     
    504504
    505505    if (g->current.inBeginEnd) {
    506         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     506        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    507507                     "GetPixelMapusv called in Begin/End");
    508508        return;
     
    561561        break;
    562562    default:
    563         crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "GetPixelMapusv(map)");
     563        crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "GetPixelMapusv(map)");
    564564        return;
    565565    }
     
    569569                      CRContext *fromCtx, CRContext *toCtx)
    570570{
     571    PCRStateTracker pState = fromCtx->pStateTracker;
    571572    CRPixelState *from = &(fromCtx->pixel);
    572573    CRPixelState *to = &(toCtx->pixel);
    573574    int j, i;
    574575    CRbitvalue nbitID[CR_MAX_BITARRAY];
     576
     577    CRASSERT(fromCtx->pStateTracker == toCtx->pStateTracker);
     578
    575579    for (j=0;j<CR_MAX_BITARRAY;j++)
    576580        nbitID[j] = ~bitID[j];
     
    580584        if (from->mapColor != to->mapColor)
    581585        {           
    582             diff_api.PixelTransferi (GL_MAP_COLOR, to->mapColor);
     586            pState->diff_api.PixelTransferi (GL_MAP_COLOR, to->mapColor);
    583587            from->mapColor = to->mapColor;
    584588        }
    585589        if (from->mapStencil != to->mapStencil)
    586590        {
    587             diff_api.PixelTransferi (GL_MAP_STENCIL, to->mapStencil);
     591            pState->diff_api.PixelTransferi (GL_MAP_STENCIL, to->mapStencil);
    588592            from->mapStencil = to->mapStencil;
    589593        }
    590594        if (from->indexOffset != to->indexOffset)
    591595        {
    592             diff_api.PixelTransferi (GL_INDEX_OFFSET, to->indexOffset);
     596            pState->diff_api.PixelTransferi (GL_INDEX_OFFSET, to->indexOffset);
    593597            from->indexOffset = to->indexOffset;
    594598        }
    595599        if (from->indexShift != to->indexShift)
    596600        {
    597             diff_api.PixelTransferi (GL_INDEX_SHIFT, to->indexShift);
     601            pState->diff_api.PixelTransferi (GL_INDEX_SHIFT, to->indexShift);
    598602            from->indexShift = to->indexShift;
    599603        }
    600604        if (from->scale.r != to->scale.r)
    601605        {
    602             diff_api.PixelTransferf (GL_RED_SCALE, to->scale.r);
     606            pState->diff_api.PixelTransferf (GL_RED_SCALE, to->scale.r);
    603607            from->scale.r = to->scale.r;
    604608        }
    605609        if (from->scale.g != to->scale.g)
    606610        {
    607             diff_api.PixelTransferf (GL_GREEN_SCALE, to->scale.g);
     611            pState->diff_api.PixelTransferf (GL_GREEN_SCALE, to->scale.g);
    608612            from->scale.g = to->scale.g;
    609613        }
    610614        if (from->scale.b != to->scale.b)
    611615        {
    612             diff_api.PixelTransferf (GL_BLUE_SCALE, to->scale.b);
     616            pState->diff_api.PixelTransferf (GL_BLUE_SCALE, to->scale.b);
    613617            from->scale.b = to->scale.b;
    614618        }
    615619        if (from->scale.a != to->scale.a)
    616620        {
    617             diff_api.PixelTransferf (GL_ALPHA_SCALE, to->scale.a);
     621            pState->diff_api.PixelTransferf (GL_ALPHA_SCALE, to->scale.a);
    618622            from->scale.a = to->scale.a;
    619623        }
    620624        if (from->bias.r != to->bias.r)
    621625        {
    622             diff_api.PixelTransferf (GL_RED_BIAS, to->bias.r);
     626            pState->diff_api.PixelTransferf (GL_RED_BIAS, to->bias.r);
    623627            from->bias.r = to->bias.r;
    624628        }
    625629        if (from->bias.g != to->bias.g)
    626630        {
    627             diff_api.PixelTransferf (GL_GREEN_BIAS, to->bias.g);
     631            pState->diff_api.PixelTransferf (GL_GREEN_BIAS, to->bias.g);
    628632            from->bias.g = to->bias.g;
    629633        }
    630634        if (from->bias.b != to->bias.b)
    631635        {
    632             diff_api.PixelTransferf (GL_BLUE_BIAS, to->bias.b);
     636            pState->diff_api.PixelTransferf (GL_BLUE_BIAS, to->bias.b);
    633637            from->bias.b = to->bias.b;
    634638        }
    635639        if (from->bias.a != to->bias.a)
    636640        {
    637             diff_api.PixelTransferf (GL_ALPHA_BIAS, to->bias.a);
     641            pState->diff_api.PixelTransferf (GL_ALPHA_BIAS, to->bias.a);
    638642            from->bias.a = to->bias.a;
    639643        }
    640644        if (from->depthScale != to->depthScale)
    641645        {
    642             diff_api.PixelTransferf (GL_DEPTH_SCALE, to->depthScale);
     646            pState->diff_api.PixelTransferf (GL_DEPTH_SCALE, to->depthScale);
    643647            from->depthScale = to->depthScale;
    644648        }
    645649        if (from->depthBias != to->depthBias)
    646650        {
    647             diff_api.PixelTransferf (GL_DEPTH_BIAS, to->depthBias);
     651            pState->diff_api.PixelTransferf (GL_DEPTH_BIAS, to->depthBias);
    648652            from->depthBias = to->depthBias;
    649653        }
     
    655659            from->yZoom != to->yZoom)
    656660        {
    657             diff_api.PixelZoom (to->xZoom,
    658                 to->yZoom);
     661            pState->diff_api.PixelZoom (to->xZoom, to->yZoom);
    659662            from->xZoom = to->xZoom;
    660663            from->yZoom = to->yZoom;
     
    665668    {
    666669        if (crMemcmp(to->mapStoS, from->mapStoS, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    667             diff_api.PixelMapfv(GL_PIXEL_MAP_S_TO_S,to->mapStoSsize,(GLfloat*)to->mapStoS);
     670            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_S_TO_S,to->mapStoSsize,(GLfloat*)to->mapStoS);
    668671        if (crMemcmp(to->mapItoI, from->mapItoI, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    669             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_I,to->mapItoIsize,(GLfloat*)to->mapItoI);
     672            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_I,to->mapItoIsize,(GLfloat*)to->mapItoI);
    670673        if (crMemcmp(to->mapItoR, from->mapItoR, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    671             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_R,to->mapItoRsize,(GLfloat*)to->mapItoR);
     674            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_R,to->mapItoRsize,(GLfloat*)to->mapItoR);
    672675        if (crMemcmp(to->mapItoG, from->mapItoG, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    673             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_G,to->mapItoGsize,(GLfloat*)to->mapItoG);
     676            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_G,to->mapItoGsize,(GLfloat*)to->mapItoG);
    674677        if (crMemcmp(to->mapItoB, from->mapItoB, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    675             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_B,to->mapItoBsize,(GLfloat*)to->mapItoB);
     678            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_B,to->mapItoBsize,(GLfloat*)to->mapItoB);
    676679        if (crMemcmp(to->mapItoA, from->mapItoA, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    677             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_A,to->mapItoAsize,(GLfloat*)to->mapItoA);
     680            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_A,to->mapItoAsize,(GLfloat*)to->mapItoA);
    678681        if (crMemcmp(to->mapRtoR, from->mapRtoR, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    679             diff_api.PixelMapfv(GL_PIXEL_MAP_R_TO_R,to->mapRtoRsize,(GLfloat*)to->mapRtoR);
     682            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_R_TO_R,to->mapRtoRsize,(GLfloat*)to->mapRtoR);
    680683        if (crMemcmp(to->mapGtoG, from->mapGtoG, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    681             diff_api.PixelMapfv(GL_PIXEL_MAP_G_TO_G,to->mapGtoGsize,(GLfloat*)to->mapGtoG);
     684            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_G_TO_G,to->mapGtoGsize,(GLfloat*)to->mapGtoG);
    682685        if (crMemcmp(to->mapBtoB, from->mapBtoB, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    683             diff_api.PixelMapfv(GL_PIXEL_MAP_B_TO_B,to->mapBtoBsize,(GLfloat*)to->mapBtoB);
     686            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_B_TO_B,to->mapBtoBsize,(GLfloat*)to->mapBtoB);
    684687        if (crMemcmp(to->mapAtoA, from->mapAtoA, CR_MAX_PIXEL_MAP_TABLE*sizeof(GLfloat)))
    685             diff_api.PixelMapfv(GL_PIXEL_MAP_A_TO_A,to->mapAtoAsize,(GLfloat*)to->mapAtoA);
     688            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_A_TO_A,to->mapAtoAsize,(GLfloat*)to->mapAtoA);
    686689        CLEARDIRTY(b->maps, nbitID);
    687690    }
     
    692695                      CRContext *fromCtx, CRContext *toCtx)
    693696{
     697    PCRStateTracker pState = fromCtx->pStateTracker;
    694698    CRPixelState *from = &(fromCtx->pixel);
    695699    CRPixelState *to = &(toCtx->pixel);
    696700    int j, i;
    697701    CRbitvalue nbitID[CR_MAX_BITARRAY];
     702
     703    CRASSERT(fromCtx->pStateTracker == toCtx->pStateTracker);
     704
    698705    for (j=0;j<CR_MAX_BITARRAY;j++)
    699706        nbitID[j] = ~bitID[j];
     
    703710        if (from->mapColor != to->mapColor)
    704711        {
    705             diff_api.PixelTransferi (GL_MAP_COLOR, to->mapColor);
     712            pState->diff_api.PixelTransferi (GL_MAP_COLOR, to->mapColor);
    706713            FILLDIRTY(b->transfer);
    707714            FILLDIRTY(b->dirty);
     
    709716        if (from->mapStencil != to->mapStencil)
    710717        {
    711             diff_api.PixelTransferi (GL_MAP_STENCIL, to->mapStencil);
     718            pState->diff_api.PixelTransferi (GL_MAP_STENCIL, to->mapStencil);
    712719            FILLDIRTY(b->transfer);
    713720            FILLDIRTY(b->dirty);
     
    715722        if (from->indexOffset != to->indexOffset)
    716723        {
    717             diff_api.PixelTransferi (GL_INDEX_OFFSET, to->indexOffset);
     724            pState->diff_api.PixelTransferi (GL_INDEX_OFFSET, to->indexOffset);
    718725            FILLDIRTY(b->transfer);
    719726            FILLDIRTY(b->dirty);
     
    721728        if (from->indexShift != to->indexShift)
    722729        {
    723             diff_api.PixelTransferi (GL_INDEX_SHIFT, to->indexShift);
     730            pState->diff_api.PixelTransferi (GL_INDEX_SHIFT, to->indexShift);
    724731            FILLDIRTY(b->transfer);
    725732            FILLDIRTY(b->dirty);
     
    727734        if (from->scale.r != to->scale.r)
    728735        {
    729             diff_api.PixelTransferf (GL_RED_SCALE, to->scale.r);
     736            pState->diff_api.PixelTransferf (GL_RED_SCALE, to->scale.r);
    730737            FILLDIRTY(b->transfer);
    731738            FILLDIRTY(b->dirty);
     
    733740        if (from->scale.g != to->scale.g)
    734741        {
    735             diff_api.PixelTransferf (GL_GREEN_SCALE, to->scale.g);
     742            pState->diff_api.PixelTransferf (GL_GREEN_SCALE, to->scale.g);
    736743            FILLDIRTY(b->transfer);
    737744            FILLDIRTY(b->dirty);
     
    739746        if (from->scale.b != to->scale.b)
    740747        {
    741             diff_api.PixelTransferf (GL_BLUE_SCALE, to->scale.b);
     748            pState->diff_api.PixelTransferf (GL_BLUE_SCALE, to->scale.b);
    742749            FILLDIRTY(b->transfer);
    743750            FILLDIRTY(b->dirty);
     
    745752        if (from->scale.a != to->scale.a)
    746753        {
    747             diff_api.PixelTransferf (GL_ALPHA_SCALE, to->scale.a);
     754            pState->diff_api.PixelTransferf (GL_ALPHA_SCALE, to->scale.a);
    748755            FILLDIRTY(b->transfer);
    749756            FILLDIRTY(b->dirty);
     
    751758        if (from->bias.r != to->bias.r)
    752759        {
    753             diff_api.PixelTransferf (GL_RED_BIAS, to->bias.r);
     760            pState->diff_api.PixelTransferf (GL_RED_BIAS, to->bias.r);
    754761            FILLDIRTY(b->transfer);
    755762            FILLDIRTY(b->dirty);
     
    757764        if (from->bias.g != to->bias.g)
    758765        {
    759             diff_api.PixelTransferf (GL_GREEN_BIAS, to->bias.g);
     766            pState->diff_api.PixelTransferf (GL_GREEN_BIAS, to->bias.g);
    760767            FILLDIRTY(b->transfer);
    761768            FILLDIRTY(b->dirty);
     
    763770        if (from->bias.b != to->bias.b)
    764771        {
    765             diff_api.PixelTransferf (GL_BLUE_BIAS, to->bias.b);
     772            pState->diff_api.PixelTransferf (GL_BLUE_BIAS, to->bias.b);
    766773            FILLDIRTY(b->transfer);
    767774            FILLDIRTY(b->dirty);
     
    769776        if (from->bias.a != to->bias.a)
    770777        {
    771             diff_api.PixelTransferf (GL_ALPHA_BIAS, to->bias.a);
     778            pState->diff_api.PixelTransferf (GL_ALPHA_BIAS, to->bias.a);
    772779            FILLDIRTY(b->transfer);
    773780            FILLDIRTY(b->dirty);
     
    775782        if (from->depthScale != to->depthScale)
    776783        {
    777             diff_api.PixelTransferf (GL_DEPTH_SCALE, to->depthScale);
     784            pState->diff_api.PixelTransferf (GL_DEPTH_SCALE, to->depthScale);
    778785            FILLDIRTY(b->transfer);
    779786            FILLDIRTY(b->dirty);
     
    781788        if (from->depthBias != to->depthBias)
    782789        {
    783             diff_api.PixelTransferf (GL_DEPTH_BIAS, to->depthBias);
     790            pState->diff_api.PixelTransferf (GL_DEPTH_BIAS, to->depthBias);
    784791            FILLDIRTY(b->transfer);
    785792            FILLDIRTY(b->dirty);
     
    792799            from->yZoom != to->yZoom)
    793800        {
    794             diff_api.PixelZoom (to->xZoom,
    795                 to->yZoom);
     801            pState->diff_api.PixelZoom (to->xZoom, to->yZoom);
    796802            FILLDIRTY(b->zoom);
    797803            FILLDIRTY(b->dirty);
     
    802808    {
    803809        if (crMemcmp(to->mapStoS, from->mapStoS, CR_MAX_PIXEL_MAP_TABLE)) {
    804             diff_api.PixelMapfv(GL_PIXEL_MAP_S_TO_S,to->mapStoSsize,(GLfloat*)to->mapStoS);
     810            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_S_TO_S,to->mapStoSsize,(GLfloat*)to->mapStoS);
    805811            FILLDIRTY(b->maps);
    806812            FILLDIRTY(b->dirty);
    807813        }
    808814        if (crMemcmp(to->mapItoI, from->mapItoI, CR_MAX_PIXEL_MAP_TABLE)) {
    809             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_I,to->mapItoIsize,(GLfloat*)to->mapItoI);
     815            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_I,to->mapItoIsize,(GLfloat*)to->mapItoI);
    810816            FILLDIRTY(b->maps);
    811817            FILLDIRTY(b->dirty);
    812818        }
    813819        if (crMemcmp(to->mapItoR, from->mapItoR, CR_MAX_PIXEL_MAP_TABLE)) {
    814             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_R,to->mapItoRsize,(GLfloat*)to->mapItoR);
     820            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_R,to->mapItoRsize,(GLfloat*)to->mapItoR);
    815821            FILLDIRTY(b->maps);
    816822            FILLDIRTY(b->dirty);
    817823        }
    818824        if (crMemcmp(to->mapItoG, from->mapItoG, CR_MAX_PIXEL_MAP_TABLE)) {
    819             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_G,to->mapItoGsize,(GLfloat*)to->mapItoG);
     825            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_G,to->mapItoGsize,(GLfloat*)to->mapItoG);
    820826            FILLDIRTY(b->maps);
    821827            FILLDIRTY(b->dirty);
    822828        }
    823829        if (crMemcmp(to->mapItoB, from->mapItoB, CR_MAX_PIXEL_MAP_TABLE)) {
    824             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_B,to->mapItoBsize,(GLfloat*)to->mapItoB);
     830            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_B,to->mapItoBsize,(GLfloat*)to->mapItoB);
    825831            FILLDIRTY(b->maps);
    826832            FILLDIRTY(b->dirty);
    827833        }
    828834        if (crMemcmp(to->mapItoA, from->mapItoA, CR_MAX_PIXEL_MAP_TABLE)) {
    829             diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_A,to->mapItoAsize,(GLfloat*)to->mapItoA);
     835            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_I_TO_A,to->mapItoAsize,(GLfloat*)to->mapItoA);
    830836            FILLDIRTY(b->maps);
    831837            FILLDIRTY(b->dirty);
    832838        }
    833839        if (crMemcmp(to->mapRtoR, from->mapRtoR, CR_MAX_PIXEL_MAP_TABLE)) {
    834             diff_api.PixelMapfv(GL_PIXEL_MAP_R_TO_R,to->mapRtoRsize,(GLfloat*)to->mapRtoR);
     840            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_R_TO_R,to->mapRtoRsize,(GLfloat*)to->mapRtoR);
    835841            FILLDIRTY(b->maps);
    836842            FILLDIRTY(b->dirty);
    837843        }
    838844        if (crMemcmp(to->mapGtoG, from->mapGtoG, CR_MAX_PIXEL_MAP_TABLE)) {
    839             diff_api.PixelMapfv(GL_PIXEL_MAP_G_TO_G,to->mapGtoGsize,(GLfloat*)to->mapGtoG);
     845            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_G_TO_G,to->mapGtoGsize,(GLfloat*)to->mapGtoG);
    840846            FILLDIRTY(b->maps);
    841847            FILLDIRTY(b->dirty);
    842848        }
    843849        if (crMemcmp(to->mapBtoB, from->mapBtoB, CR_MAX_PIXEL_MAP_TABLE)) {
    844             diff_api.PixelMapfv(GL_PIXEL_MAP_B_TO_B,to->mapBtoBsize,(GLfloat*)to->mapBtoB);
     850            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_B_TO_B,to->mapBtoBsize,(GLfloat*)to->mapBtoB);
    845851            FILLDIRTY(b->maps);
    846852            FILLDIRTY(b->dirty);
    847853        }
    848854        if (crMemcmp(to->mapAtoA, from->mapAtoA, CR_MAX_PIXEL_MAP_TABLE)) {
    849             diff_api.PixelMapfv(GL_PIXEL_MAP_A_TO_A,to->mapAtoAsize,(GLfloat*)to->mapAtoA);
     855            pState->diff_api.PixelMapfv(GL_PIXEL_MAP_A_TO_A,to->mapAtoAsize,(GLfloat*)to->mapAtoA);
    850856            FILLDIRTY(b->maps);
    851857            FILLDIRTY(b->dirty);
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