VirtualBox

Changeset 51559 in vbox for trunk/src/VBox/GuestHost/OpenGL


Ignore:
Timestamp:
Jun 5, 2014 9:18:41 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94217
Message:

crOpenGL: wglShareLists support

Location:
trunk/src/VBox/GuestHost/OpenGL
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/glapi_parser/APIspec.txt

    r51200 r51559  
    85718571chromium    nopack
    85728572
     8573name        VBoxConChromiumParametervCR
     8574return      void
     8575param       con         GLint
     8576param       target      GLenum
     8577paramprop   target      GL_CURSOR_POSITION_CR GL_DEFAULT_BBOX_CR GL_SCREEN_BBOX_CR GL_OBJECT_BBOX_CR GL_PRINT_STRING_CR GL_MURAL_SIZE_CR GL_NUM_SERVERS_CR GL_NUM_TILES_CR GL_TILE_BOUNDS_CR GL_VERTEX_COUNTS_CR GL_RESET_VERTEX_COUNTERS_CR GL_SET_MAX_VIEWPORT_CR GL_HEAD_SPU_NAME_CR GL_PERF_GET_FRAME_DATA_CR GL_PERF_GET_TIMER_DATA_CR GL_PERF_DUMP_COUNTERS_CR GL_PERF_SET_TOKEN_CR GL_PERF_SET_DUMP_ON_SWAP_CR GL_PERF_SET_DUMP_ON_FINISH_CR GL_PERF_SET_DUMP_ON_FLUSH_CR GL_PERF_START_TIMER_CR GL_PERF_STOP_TIMER_CR GL_WINDOW_SIZE_CR GL_TILE_INFO_CR GL_GATHER_DRAWPIXELS_CR GL_GATHER_PACK_CR GL_GATHER_CONNECT_CR GL_GATHER_POST_SWAPBUFFERS_CR GL_SAVEFRAME_ENABLED_CR GL_SAVEFRAME_FRAMENUM_CR GL_SAVEFRAME_STRIDE_CR GL_SAVEFRAME_SINGLE_CR GL_SAVEFRAME_FILESPEC_CR GL_READBACK_BARRIER_SIZE_CR
     8578param       type        GLenum
     8579paramprop   type        GL_BYTE GL_UNSIGNED_BYTE GL_SHORT GL_UNSIGNED_SHORT GL_INT GL_UNSIGNED_INT GL_FLOAT GL_DOUBLE
     8580param       count       GLsizei
     8581param       values      const GLvoid *
     8582category    VBox
     8583props       nolist
     8584chromium    nopack
     8585
     8586
    85738587name        VBoxWindowCreate
    85748588return      GLint
  • trunk/src/VBox/GuestHost/OpenGL/include/chromium.h

    r51313 r51559  
    734734#define GL_CHECK_ZERO_VERT_ARRT       0x8B30
    735735
     736/* share lists */
     737#define GL_SHARE_LISTS_CR             0x8B31
     738
    736739/**********************************************************************/
    737740/*****                Chromium-specific API                       *****/
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h

    r51005 r51559  
    116116    CRHashTable *rbTable;       /* render buffers */
    117117
    118     GLint refCount;
     118    volatile int32_t refCount;
    119119    GLint id;                   /*unique shared state id, it's not always matching some existing context id!*/
    120120    GLint saveCount;
     
    308308
    309309DECLEXPORT(void) STATE_APIENTRY crStateShareContext(GLboolean value);
     310DECLEXPORT(void) STATE_APIENTRY crStateShareLists(CRContext *pContext1, CRContext *pContext2);
    310311DECLEXPORT(void) STATE_APIENTRY crStateSetSharedContext(CRContext *pCtx);
    311312DECLEXPORT(GLboolean) STATE_APIENTRY crStateContextIsShared(CRContext *pCtx);
  • 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 {
Note: See TracChangeset for help on using the changeset viewer.

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