VirtualBox

Ignore:
Timestamp:
Jul 1, 2013 2:02:37 PM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: TexPresent fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp

    r46353 r46885  
    232232}
    233233
     234DECLINLINE(GLfloat*) crBltVtRectsTFNormalized(const RTRECT *paRects, uint32_t cRects, uint32_t normalX, uint32_t normalY, GLfloat* pBuff, uint32_t height)
     235{
     236    for (uint32_t i = 0; i < cRects; ++i)
     237    {
     238        pBuff = crBltVtRectTFNormalized(&paRects[i], normalX, normalY, pBuff, height);
     239    }
     240    return pBuff;
     241}
     242
    234243DECLINLINE(GLint*) crBltVtRectTF(const RTRECT *pRect, uint32_t normalX, uint32_t normalY, GLint* pBuff, uint32_t height)
    235244{
     
    374383    uint32_t srcHeight = (fFlags & CRBLT_F_INVERT_SRC_YCOORDS) ? pSrc->height : 0;
    375384    uint32_t dstHeight = (fFlags & CRBLT_F_INVERT_DST_YCOORDS) ? pDstSize->cy : 0;
    376     Assert(srcHeight == dstHeight);
    377385
    378386    switch (pSrc->target)
     
    405413    if (cRects == 1)
    406414    {
    407         /* just optimizatino to draw a single rect with GL_TRIANGLE_FAN */
    408         bool bUseSameVerticies = paSrcRect == paDstRect && normalX == 1 && normalY == 1 && srcHeight == dstHeight;
     415        /* just optimization to draw a single rect with GL_TRIANGLE_FAN */
    409416        GLfloat *pVerticies;
    410417        GLfloat *pTexCoords;
    411         GLuint cElements = crBltVtGetNumVerticiesTF(1);
    412         if (bUseSameVerticies)
    413         {
    414             pVerticies = (GLfloat*)crBltBufGet(&pBlitter->Verticies, cElements * 2 * sizeof (*pVerticies));
    415             crBltVtRectTFNormalized(paDstRect, normalX, normalY, pVerticies, dstHeight);
    416             pTexCoords = pVerticies;
    417         }
    418         else
    419         {
    420             pVerticies = (GLfloat*)crBltBufGet(&pBlitter->Verticies, cElements * 2 * 2 * sizeof (*pVerticies));
    421             pTexCoords = crBltVtRectTFNormalized(paDstRect, 1, 1, pVerticies, dstHeight);
    422             crBltVtRectTFNormalized(paSrcRect, normalX, normalY, pTexCoords, srcHeight);
    423         }
     418        GLuint cElements = crBltVtGetNumVerticiesTF(cRects);
     419
     420        pVerticies = (GLfloat*)crBltBufGet(&pBlitter->Verticies, cElements * 2 * 2 * sizeof (*pVerticies));
     421        pTexCoords = crBltVtRectsTFNormalized(paDstRect, cRects, 1, 1, pVerticies, dstHeight);
     422        crBltVtRectsTFNormalized(paSrcRect, cRects, normalX, normalY, pTexCoords, srcHeight);
    424423
    425424        pBlitter->pDispatch->EnableClientState(GL_VERTEX_ARRAY);
     
    440439    else
    441440    {
    442         bool bUseSameVerticies = paSrcRect == paDstRect && normalX == 1 && normalY == 1 && srcHeight == dstHeight;
    443441        GLfloat *pVerticies;
    444442        GLfloat *pTexCoords;
     
    447445        GLuint cIndicies = crBltVtGetNumIndiciesIT(cRects);
    448446        GLubyte iIdxBase = 0;
    449         if (bUseSameVerticies)
    450         {
    451             pVerticies = (GLfloat*)crBltBufGet(&pBlitter->Verticies, cElements * 2 * sizeof (*pVerticies) + cIndicies * sizeof (*pIndicies));
    452             crBltVtRectsITNormalized(paDstRect, cRects, normalX, normalY, pVerticies, &pIndicies, &iIdxBase, dstHeight);
    453             pTexCoords = pVerticies;
    454         }
    455         else
    456         {
    457             pVerticies = (GLfloat*)crBltBufGet(&pBlitter->Verticies, cElements * 2 * 2 * sizeof (*pVerticies) + cIndicies * sizeof (*pIndicies));
    458             pTexCoords = crBltVtRectsITNormalized(paDstRect, cRects, 1, 1, pVerticies, &pIndicies, &iIdxBase, dstHeight);
    459             crBltVtRectsITNormalized(paSrcRect, cRects, normalX, normalY, pTexCoords, NULL, NULL, srcHeight);
    460         }
     447
     448        pVerticies = (GLfloat*)crBltBufGet(&pBlitter->Verticies, cElements * 2 * 2 * sizeof (*pVerticies) + cIndicies * sizeof (*pIndicies));
     449        pTexCoords = crBltVtRectsITNormalized(paDstRect, cRects, 1, 1, pVerticies, &pIndicies, &iIdxBase, dstHeight);
     450        crBltVtRectsITNormalized(paSrcRect, cRects, normalX, normalY, pTexCoords, NULL, NULL, srcHeight);
    461451
    462452        pBlitter->pDispatch->EnableClientState(GL_VERTEX_ARRAY);
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