VirtualBox

Ignore:
Timestamp:
Apr 9, 2014 8:58:50 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
93199
Message:

DevVGA/crOpenGL: create worker thread when needed only; saved state; bugfixes (to be continued)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c

    r48491 r51005  
    678678 * As above, but don't call crStateSwitchContext().
    679679 */
    680 void crStateSetCurrent( CRContext *ctx )
     680static void crStateSetCurrentEx( CRContext *ctx, GLboolean fCleanupDefault )
    681681{
    682682    CRContext *current = GetCurrentContext();
    683683
    684     if (ctx == NULL)
     684    if (ctx == NULL && !fCleanupDefault)
    685685        ctx = defaultContext;
    686686
    687687    if (current == ctx)
    688688        return; /* no-op */
    689 
    690     CRASSERT(ctx);
    691689
    692690#ifdef CHROMIUM_THREADSAFE
     
    696694#endif
    697695
    698     /* ensure matrix state is also current */
    699     crStateMatrixMode(ctx->transform.matrixMode);
     696    if (ctx)
     697    {
     698        /* ensure matrix state is also current */
     699        crStateMatrixMode(ctx->transform.matrixMode);
     700    }
     701}
     702
     703void crStateSetCurrent( CRContext *ctx )
     704{
     705    crStateSetCurrentEx( ctx, GL_FALSE );
     706}
     707
     708void crStateCleanupCurrent()
     709{
     710    crStateSetCurrentEx( NULL, GL_TRUE );
    700711}
    701712
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