Changeset 46885 in vbox for trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp
- Timestamp:
- Jul 1, 2013 2:02:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp
r46353 r46885 232 232 } 233 233 234 DECLINLINE(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 234 243 DECLINLINE(GLint*) crBltVtRectTF(const RTRECT *pRect, uint32_t normalX, uint32_t normalY, GLint* pBuff, uint32_t height) 235 244 { … … 374 383 uint32_t srcHeight = (fFlags & CRBLT_F_INVERT_SRC_YCOORDS) ? pSrc->height : 0; 375 384 uint32_t dstHeight = (fFlags & CRBLT_F_INVERT_DST_YCOORDS) ? pDstSize->cy : 0; 376 Assert(srcHeight == dstHeight);377 385 378 386 switch (pSrc->target) … … 405 413 if (cRects == 1) 406 414 { 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 */ 409 416 GLfloat *pVerticies; 410 417 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); 424 423 425 424 pBlitter->pDispatch->EnableClientState(GL_VERTEX_ARRAY); … … 440 439 else 441 440 { 442 bool bUseSameVerticies = paSrcRect == paDstRect && normalX == 1 && normalY == 1 && srcHeight == dstHeight;443 441 GLfloat *pVerticies; 444 442 GLfloat *pTexCoords; … … 447 445 GLuint cIndicies = crBltVtGetNumIndiciesIT(cRects); 448 446 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); 461 451 462 452 pBlitter->pDispatch->EnableClientState(GL_VERTEX_ARRAY);
Note:
See TracChangeset
for help on using the changeset viewer.