VirtualBox

忽略:
時間撮記:
2014-6-5 下午09:18:41 (10 年 以前)
作者:
vboxsync
訊息:

crOpenGL: wglShareLists support

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c

    r51005 r51559  
    99#include "cr_error.h"
    1010#include "cr_spu.h"
     11
     12#include <iprt/asm.h>
    1113
    1214#ifdef CHROMIUM_THREADSAFE
     
    110112crStateFreeShared(CRContext *pContext, CRSharedState *s)
    111113{
    112     s->refCount--;
    113     Assert(s->refCount >= 0);
    114     if (s->refCount <= 0) {
     114    int32_t refCount = ASMAtomicDecS32(&s->refCount);
     115
     116    Assert(refCount >= 0);
     117    if (refCount <= 0) {
    115118        if (s==gSharedState)
    116119        {
     
    144147        return NULL;
    145148    }
    146     gSharedState->refCount++;
     149    ASMAtomicIncS32(&gSharedState->refCount);
    147150    return gSharedState;
    148151}
     
    176179            crStateFreeShared(pCtx, pCtx->shared);
    177180            pCtx->shared = gSharedState;
    178             gSharedState->refCount++;
     181            ASMAtomicIncS32(&gSharedState->refCount);
    179182        }
    180183    }
     
    199202        }
    200203    }
     204}
     205
     206DECLEXPORT(void) STATE_APIENTRY
     207crStateShareLists(CRContext *pContext1, CRContext *pContext2)
     208{
     209    CRASSERT(pContext1->shared);
     210    CRASSERT(pContext2->shared);
     211
     212    if (pContext2->shared == pContext1->shared)
     213    {
     214        return;
     215    }
     216
     217    crStateFreeShared(pContext1, pContext1->shared);
     218    pContext1->shared = pContext2->shared;
     219    ASMAtomicIncS32(&pContext2->shared->refCount);
    201220}
    202221
     
    271290        CRASSERT(shareCtx->shared);
    272291        ctx->shared = shareCtx->shared;
    273         ctx->shared->refCount ++;
     292        ASMAtomicIncS32(&ctx->shared->refCount);
    274293    }
    275294    else {
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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