VirtualBox

Ignore:
Timestamp:
Feb 18, 2013 5:02:47 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL: OSX backend rework; oddscreen rendering generalization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c

    r44389 r44740  
    2222    GLint dims[2];
    2323    GLint windowID = -1;
     24    GLint spuWindow;
     25    VBOXVR_TEXTURE Tex = {0};
     26
     27    int rc = CrVrScrCompositorInit(&mural->Compositor);
     28    if (!RT_SUCCESS(rc))
     29    {
     30        crWarning("CrVrScrCompositorInit failed, rc %d", rc);
     31        return -1;
     32    }
     33
    2434    /*
    2535     * Have first SPU make a new window.
    2636     */
    27     GLint spuWindow = cr_server.head_spu->dispatch_table.WindowCreate( dpyName, visBits );
     37    spuWindow = cr_server.head_spu->dispatch_table.WindowCreate( dpyName, visBits );
    2838    if (spuWindow < 0) {
    29         crServerReturnValue( &spuWindow, sizeof(spuWindow) );
     39        CrVrScrCompositorTerm(&mural->Compositor);
    3040        return spuWindow;
    3141    }
     
    3343    /* get initial window size */
    3444    cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, spuWindow, GL_INT, 2, dims);
     45
     46    Tex.width = dims[0];
     47    Tex.height = dims[1];
     48    Tex.target = GL_TEXTURE_2D;
     49    Tex.hwid = 0;
     50    CrVrScrCompositorEntryInit(&mural->CEntry, &Tex);
    3551
    3652    defaultMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, 0);
     
    118134    {
    119135        crWarning("crServerMuralInit failed!");
     136        crServerReturnValue( &windowID, sizeof(windowID) );
    120137        crFree(mural);
    121138        return windowID;
     
    290307    }
    291308
     309    CrVrScrCompositorTerm(&mural->Compositor);
     310
    292311    crHashtableDelete(cr_server.muralTable, window, crFree);
    293312}
     
    295314void crServerMuralSize(CRMuralInfo *mural, GLint width, GLint height)
    296315{
    297     mural->width = width;
    298     mural->height = height;
     316    if (mural->width != width || mural->height != height)
     317    {
     318        VBOXVR_TEXTURE Tex;
     319        Tex.width = width;
     320        Tex.height = height;
     321        Tex.target = GL_TEXTURE_2D;
     322        Tex.hwid = 0;
     323        CrVrScrCompositorEntryRemove(&mural->Compositor, &mural->CEntry);
     324        CrVrScrCompositorEntryInit(&mural->CEntry, &Tex);
     325        mural->width = width;
     326        mural->height = height;
     327    }
    299328
    300329    if (cr_server.curClient && cr_server.curClient->currentMural == mural)
     
    342371{
    343372    CRMuralInfo *mural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, window);
     373    RTPOINT Pos;
    344374    /*  crDebug("CRServer: Window %d pos %d, %d", window, x, y);*/
    345375    if (!mural) {
     
    352382    mural->gY = y;
    353383
     384    Pos.x = x;
     385    Pos.y = y;
     386
     387    CrVrScrCompositorEntryPosSet(&mural->Compositor, &mural->CEntry, &Pos);
     388
    354389    crServerCheckMuralGeometry(mural);
    355390}
     
    392427                                                   cRects, (RTRECT *)pRects);
    393428    }
     429
     430    CrVrScrCompositorEntryRegionsSet(&mural->Compositor, &mural->CEntry, NULL, cRects, (const RTRECT *)pRects);
    394431}
    395432
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