VirtualBox

Changeset 35998 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 16, 2011 2:24:09 PM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: fix guest compiz clipping with forced fbo

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h

    r35969 r35998  
    2626#endif
    2727
    28 #define SHCROGL_SSM_VERSION 24
     28#define SHCROGL_SSM_VERSION 25
    2929
    3030#define CR_MAX_WINDOWS 100
     
    6464    GLboolean bUseFBO;       /*redirect to FBO instead of real host window*/
    6565
    66     GLint  cVisibleRects;    /*count of visible rects*/
    67     GLint *pVisibleRects;    /*visible rects left, top, right, bottom*/
     66    GLint       cVisibleRects;    /*count of visible rects*/
     67    GLint      *pVisibleRects;    /*visible rects left, top, right, bottom*/
     68    GLboolean   bReceivedRects;   /*indicates if guest did any updates for visible regions*/
    6869
    6970    GLuint idFBO, idColorTex, idDepthStencilRB;
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c

    r35995 r35998  
    340340            crServerTransformRect(&rectwr, &rect, -mural->gX, -mural->gY);
    341341
    342 #if 0 /*@todo recheck with compiz on guests, as we could sometimes have main compiz windows without visible rects*/
    343342            if (!mural->pVisibleRects)
    344343            {
    345                 tmppixels = crAlloc(4*(rect.x2-rect.x1)*(rect.y2-rect.y1));
    346                 if (!tmppixels)
     344                /*we don't get any rects info for guest compiz windows, so we treat windows as visible unless explicitly received 0 visible rects*/
     345                if (!mural->bReceivedRects)
    347346                {
    348                     crWarning("Out of memory in crServerPresentFBO");
    349                     crFree(pixels);
    350                     return;
    351                 }
    352 
    353                 crServerCopySubImage(tmppixels, pixels, &rectwr, mural->fboWidth, mural->fboHeight);
    354                 /*Note: pfnPresentFBO would free tmppixels*/
    355                 cr_server.pfnPresentFBO(tmppixels, i, rect.x1-cr_server.screen[i].x, rect.y1-cr_server.screen[i].y, rect.x2-rect.x1, rect.y2-rect.y1);
    356             }
    357 #endif
    358             for (j=0; j<mural->cVisibleRects; ++j)
    359             {
    360                 if (crServerIntersectRect(&rectwr, (CRrecti*) &mural->pVisibleRects[4*j], &sectr))
    361                 {
    362                     tmppixels = crAlloc(4*(sectr.x2-sectr.x1)*(sectr.y2-sectr.y1));
     347                    tmppixels = crAlloc(4*(rect.x2-rect.x1)*(rect.y2-rect.y1));
    363348                    if (!tmppixels)
    364349                    {
     
    368353                    }
    369354
    370                     crServerCopySubImage(tmppixels, pixels, &sectr, mural->fboWidth, mural->fboHeight);
     355                    crServerCopySubImage(tmppixels, pixels, &rectwr, mural->fboWidth, mural->fboHeight);
    371356                    /*Note: pfnPresentFBO would free tmppixels*/
    372                     cr_server.pfnPresentFBO(tmppixels, i,
    373                                             sectr.x1+mural->gX-cr_server.screen[i].x,
    374                                             sectr.y1+mural->gY-cr_server.screen[i].y,
    375                                             sectr.x2-sectr.x1, sectr.y2-sectr.y1);
     357                    cr_server.pfnPresentFBO(tmppixels, i, rect.x1-cr_server.screen[i].x, rect.y1-cr_server.screen[i].y, rect.x2-rect.x1, rect.y2-rect.y1);
     358                }
     359            }
     360            else
     361            {
     362                for (j=0; j<mural->cVisibleRects; ++j)
     363                {
     364                    if (crServerIntersectRect(&rectwr, (CRrecti*) &mural->pVisibleRects[4*j], &sectr))
     365                    {
     366                        tmppixels = crAlloc(4*(sectr.x2-sectr.x1)*(sectr.y2-sectr.y1));
     367                        if (!tmppixels)
     368                        {
     369                            crWarning("Out of memory in crServerPresentFBO");
     370                            crFree(pixels);
     371                            return;
     372                        }
     373
     374                        crServerCopySubImage(tmppixels, pixels, &sectr, mural->fboWidth, mural->fboHeight);
     375                        /*Note: pfnPresentFBO would free tmppixels*/
     376                        cr_server.pfnPresentFBO(tmppixels, i,
     377                                                sectr.x1+mural->gX-cr_server.screen[i].x,
     378                                                sectr.y1+mural->gY-cr_server.screen[i].y,
     379                                                sectr.x2-sectr.x1, sectr.y2-sectr.y1);
     380                    }
    376381                }
    377382            }
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c

    r33988 r35998  
    8686        mural->cVisibleRects = 0;
    8787        mural->pVisibleRects = NULL;
     88        mural->bReceivedRects = GL_FALSE;
    8889
    8990        /* generate ID for this new window/mural (special-case for file conns) */
     
    282283
    283284    mural->cVisibleRects = cRects;
     285    mural->bReceivedRects = GL_TRUE;
    284286    if (cRects)
    285287    {
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