VirtualBox

Ignore:
Timestamp:
Oct 13, 2010 10:29:43 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66622
Message:

crOpenGL/wddm: huge aero speedup with GL_EXT_framebuffer_blit, working but more cases to check/fix

File:
1 edited

Legend:

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

    r32247 r33093  
    299299        if (siHavePBO==0 && siHaveFBO==0)
    300300        {
     301#if 1
    301302            GLint dRow, sRow;
    302303            for (dRow=yoffset, sRow=y-height-1; dRow<yoffset-height; dRow++, sRow--)
     
    304305                gl->CopyTexSubImage2D(target, level, xoffset, dRow, x, sRow, width, 1);
    305306            }
     307#else
     308            {
     309                GLint w, h, i;
     310                char *img1, *img2, *sPtr, *dPtr;
     311                CRContext *ctx = crStateGetCurrent();
     312
     313                w = ctx->texture.unit[ctx->texture.curTextureUnit].currentTexture2D->level[0][level].width;
     314                h = ctx->texture.unit[ctx->texture.curTextureUnit].currentTexture2D->level[0][level].height;
     315
     316                img1 = crAlloc(4*w*h);
     317                img2 = crAlloc(4*width*(-height));
     318                CRASSERT(img1 && img2);
     319
     320                gl->CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, -height);
     321                gl->GetTexImage(target, level, GL_RGBA, GL_UNSIGNED_BYTE, img1);
     322
     323                sPtr=img1+4*xoffset+4*w*yoffset;
     324                dPtr=img2+4*width*(-height-1);
     325
     326                for (i=0; i<-height; ++i)
     327                {
     328                    crMemcpy(dPtr, sPtr, 4*width);
     329                    sPtr += 4*w;
     330                    dPtr -= 4*width;
     331                }
     332
     333                gl->TexSubImage2D(target, level, xoffset, yoffset, width, -height, GL_RGBA, GL_UNSIGNED_BYTE, img2);
     334
     335                crFree(img1);
     336                crFree(img2);
     337            }
     338#endif
    306339        }
    307340        else if (siHaveFBO==1) /*@todo more states to set and restore here*/
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