VirtualBox

Changeset 16718 in vbox


Ignore:
Timestamp:
Feb 12, 2009 7:01:48 PM (16 years ago)
Author:
vboxsync
Message:

crOpenGL: another 8x speed up for compiz, xdamage but without regions info yet

Location:
trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/context.c

    r16640 r16718  
    139139    winInfo->drawable = (GLXDrawable) spuWin;
    140140    winInfo->pVisibleRegions = NULL;
     141    winInfo->cVisibleRegions = 0;
    141142#endif
    142143    winInfo->spuWindow = spuWin;
     
    277278#ifdef GLX
    278279    context->pGLXPixmapsHash = crAllocHashtable();
     280    context->damageInitFailed = GL_FALSE;
     281    context->damageDpy = NULL;
     282    context->damageEventsBase = 0;
    279283#endif
    280284
     
    10081012#ifdef GLX
    10091013    crFreeHashtable(context->pGLXPixmapsHash, crFree);
     1014    if (context->damageDpy)
     1015    {
     1016        XCloseDisplay(context->damageDpy);
     1017    }
    10101018#endif
    10111019
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/load.c

    r16640 r16718  
    7474static ClearFunc_t origClear;
    7575static ViewportFunc_t origViewport;
     76static SwapBuffersFunc_t origSwapBuffers;
     77static DrawBufferFunc_t origDrawBuffer;
    7678
    7779static void stubCheckWindowState(void)
     
    152154}
    153155
     156static void SPU_APIENTRY trapSwapBuffers(GLint window, GLint flags)
     157{
     158    stubCheckWindowState();
     159    origSwapBuffers(window, flags);
     160}
     161
     162static void SPU_APIENTRY trapDrawBuffer(GLenum buf)
     163{
     164    stubCheckWindowState();
     165    origDrawBuffer(buf);
     166}
    154167
    155168/**
     
    166179        origClear = stub.spuDispatch.Clear;
    167180        origViewport = stub.spuDispatch.Viewport;
     181        origSwapBuffers = stub.spuDispatch.SwapBuffers;
     182        origDrawBuffer = stub.spuDispatch.DrawBuffer;
    168183        stub.spuDispatch.Clear = trapClear;
    169184        stub.spuDispatch.Viewport = trapViewport;
     185        /*stub.spuDispatch.SwapBuffers = trapSwapBuffers;
     186        stub.spuDispatch.DrawBuffer = trapDrawBuffer;*/
    170187    }
    171188
     
    297314#elif defined(GLX)
    298315    defaultWin->pVisibleRegions = NULL;
     316    defaultWin->cVisibleRegions = 0;
    299317#endif
    300318    crHashtableAdd(stub.windowTable, 0, defaultWin);
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/stub.c

    r16480 r16718  
    451451    XFixesDestroyRegion(pWindow->dpy, xreg);
    452452
    453     if (!pWindow->pVisibleRegions
     453    /* @todo For some odd reason *first* run of compiz on freshly booted VM gives us 0 cRects all the time.
     454     * In (!pWindow->pVisibleRegions && cRects) "&& cRects" is a workaround for that case, especially as this
     455     * information is useless for full screen composing managers anyway.
     456     */
     457    if ((!pWindow->pVisibleRegions && cRects)
    454458        || pWindow->cVisibleRegions!=cRects
    455459        || crMemcmp(pWindow->pVisibleRegions, pXRects, cRects * sizeof(XRectangle)))
     
    465469        }
    466470
    467         /*crDebug("Got %i rects.", cRects);*/
     471        //crDebug("Got %i rects.", cRects);
    468472        for (i=0; i<cRects; ++i)
    469473        {
     
    472476            pGLRects[4*i+2] = pXRects[i].x+pXRects[i].width;
    473477            pGLRects[4*i+3] = pXRects[i].y+pXRects[i].height;
    474             /*crDebug("Rect[%i]=(%i,%i,%i,%i)", i, pGLRects[4*i+0], pGLRects[4*i+1], pGLRects[4*i+2], pGLRects[4*i+3]);*/                   
     478            //crDebug("Rect[%i]=(%i,%i,%i,%i)", i, pGLRects[4*i+0], pGLRects[4*i+1], pGLRects[4*i+2], pGLRects[4*i+3]);                   
    475479        }
    476480
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/stub.h

    r16640 r16718  
    4343#include <X11/extensions/XShm.h>
    4444#include <sys/shm.h>
     45#include <X11/extensions/Xdamage.h>
    4546#endif
    4647
     
    7475    Window root;
    7576    GC gc;
    76     Pixmap pixmap;
    77     void *data;
     77    Pixmap pixmap; /* Shared memory pixmap object, if it's supported*/
     78    Damage damage;
     79    Bool   bPixmapImageDirty;
    7880};
    7981#endif
     
    111113    GLXContext glxContext;
    112114    CRHashTable *pGLXPixmapsHash;
     115    Bool     damageInitFailed;
     116    Display *damageDpy; /* second display connection to read xdamage extension data */
     117    int      damageEventsBase;
    113118#endif
    114119};
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