Changeset 34461 in vbox
- Timestamp:
- Nov 29, 2010 1:13:03 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r34276 r34461 322 322 static VBoxVHWATextureImage* vboxVHWAImageCreate(const QRect & aRect, const VBoxVHWAColorFormat & aFormat, class VBoxVHWAGlProgramMngr * pMgr, VBOXVHWAIMG_TYPE flags) 323 323 { 324 bool bCanLinearNonFBO = false; 325 if (!aFormat.fourcc()) 326 { 327 flags &= ~VBOXVHWAIMG_FBO; 328 bCanLinearNonFBO = true; 329 } 330 324 331 const VBoxVHWAInfo & info = vboxVHWAGetSupportInfo(NULL); 325 332 if((flags & VBOXVHWAIMG_PBO) && !info.getGlInfo().isPBOSupported()) … … 337 344 flags &= ~VBOXVHWAIMG_PBO; 338 345 339 if(flags & VBOXVHWAIMG_ PBOIMG)340 { 341 if(flags & VBOXVHWAIMG_ FBO)346 if(flags & VBOXVHWAIMG_FBO) 347 { 348 if(flags & VBOXVHWAIMG_PBOIMG) 342 349 { 343 350 VBOXQGLLOG(("FBO PBO Image\n")); 344 351 return new VBoxVHWATextureImageFBO<VBoxVHWATextureImagePBO>(aRect, aFormat, pMgr, flags); 345 352 } 353 VBOXQGLLOG(("FBO Generic Image\n")); 354 return new VBoxVHWATextureImageFBO<VBoxVHWATextureImage>(aRect, aFormat, pMgr, flags); 355 } 356 357 if (!bCanLinearNonFBO) 358 { 359 VBOXQGLLOG(("Disabling Linear stretching\n")); 360 flags &= ~VBOXVHWAIMG_LINEAR; 361 } 362 363 if(flags & VBOXVHWAIMG_PBOIMG) 364 { 346 365 VBOXQGLLOG(("PBO Image\n")); 347 366 return new VBoxVHWATextureImagePBO(aRect, aFormat, pMgr, flags); 348 367 } 349 if(flags & VBOXVHWAIMG_FBO) 350 { 351 VBOXQGLLOG(("FBO Generic Image\n")); 352 return new VBoxVHWATextureImageFBO<VBoxVHWATextureImage>(aRect, aFormat, pMgr, flags); 353 } 368 354 369 VBOXQGLLOG(("Generic Image\n")); 355 370 return new VBoxVHWATextureImage(aRect, aFormat, pMgr, flags); … … 1469 1484 } 1470 1485 1486 #ifdef DEBUG_misha 1487 void VBoxVHWATexture::dbgDump() 1488 { 1489 #if 0 1490 bind(); 1491 GLvoid *pvBuf = malloc(4 * mRect.width() * mRect.height()); 1492 VBOXQGL_CHECKERR( 1493 glGetTexImage(texTarget(), 1494 0, /*GLint level*/ 1495 mColorFormat.format(), 1496 mColorFormat.type(), 1497 pvBuf); 1498 ); 1499 VBOXQGLDBGPRINT(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d\">texture info</exec>\n", 1500 pvBuf, mRect.width(), mRect.height())); 1501 Assert(0); 1502 1503 free(pvBuf); 1504 #endif 1505 } 1506 #endif 1507 1508 1471 1509 void VBoxVHWATexture::initParams() 1472 1510 { … … 2301 2339 if(!bNoPBO) 2302 2340 { 2303 fFlags |= VBOXVHWAIMG_PBO | VBOXVHWAIMG_PBOIMG ;2341 fFlags |= VBOXVHWAIMG_PBO | VBOXVHWAIMG_PBOIMG | VBOXVHWAIMG_LINEAR; 2304 2342 if(mSettings->isStretchLinearEnabled()) 2305 2343 fFlags |= VBOXVHWAIMG_FBO; … … 3812 3850 0, 3813 3851 #endif 3814 0 );3852 0 /* VBOXVHWAIMG_TYPE fFlags */); 3815 3853 pDisplay->init(NULL, bUsesGuestVram ? size.VRAM() : NULL); 3816 3854 mDisplay.setVGA(pDisplay); … … 5468 5506 || *pDstRect != mDstRect 5469 5507 || *pSrcRect != mSrcRect 5470 || !!(pDst Rect) != !!(mpDstCKey)5508 || !!(pDstCKey) != !!(mpDstCKey) 5471 5509 || !!(pSrcCKey) != !!(mpSrcCKey) 5472 || mbNotIntersected != bNotIntersected) 5510 || mbNotIntersected != bNotIntersected 5511 || mpProgram != calcProgram(pDst, pDstCKey, pSrcCKey, bNotIntersected)) 5473 5512 { 5474 5513 return createSetDisplay(pDst, pDstRect, pSrcRect, … … 5476 5515 5477 5516 } 5478 else if((pDstCKey && mpDstCKey && *pDstCKey == *mpDstCKey)5479 || (pSrcCKey && mpSrcCKey && *pSrcCKey == *mpSrcCKey))5517 else if((pDstCKey && mpDstCKey && *pDstCKey != *mpDstCKey) 5518 || (pSrcCKey && mpSrcCKey && *pSrcCKey != *mpSrcCKey)) 5480 5519 { 5481 5520 Assert(mpProgram); … … 5483 5522 return VINF_SUCCESS; 5484 5523 } 5485 mVisibleDisplay = 0;5486 mpProgram = 0;5487 5524 return VINF_SUCCESS; 5488 5525 } … … 5681 5718 void VBoxVHWATextureImage::display() 5682 5719 { 5720 #ifdef DEBUG_misha 5721 if (mpDst) 5722 { 5723 dbgDump(); 5724 } 5725 5726 static bool bDisplayOn = true; 5727 #endif 5683 5728 Assert(mVisibleDisplay); 5684 if(mVisibleDisplay) 5729 if(mVisibleDisplay 5730 #ifdef DEBUG_misha 5731 && bDisplayOn 5732 #endif 5733 ) 5685 5734 { 5686 5735 if(mpProgram) … … 5700 5749 } 5701 5750 } 5751 5752 #ifdef DEBUG_misha 5753 void VBoxVHWATextureImage::dbgDump() 5754 { 5755 for (uint32_t i = 0; i < mcTex; ++i) 5756 { 5757 mpTex[i]->dbgDump(); 5758 } 5759 } 5760 #endif 5702 5761 5703 5762 int VBoxVHWATextureImage::setCKey (VBoxVHWAGlProgramVHWA * pProgram, const VBoxVHWAColorFormat * pFormat, const VBoxVHWAColorKey * pCKey, bool bDst) -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r34140 r34461 186 186 187 187 bool operator==(const VBoxVHWAColorKey & other) const { return mUpper == other.mUpper && mLower == other.mLower; } 188 bool operator!=(const VBoxVHWAColorKey & other) const { return !(*this == other); } 188 189 private: 189 190 uint32_t mUpper; … … 318 319 ulong memSize(){ return mBytesPerLine * mRect.height(); } 319 320 uint32_t bytesPerLine() {return mBytesPerLine; } 321 #ifdef DEBUG_misha 322 void dbgDump(); 323 #endif 320 324 321 325 protected: … … 525 529 const VBoxVHWAColorKey* srcCKey() { return mpSrcCKey; } 526 530 bool notIntersectedMode() { return mbNotIntersected; } 531 532 #ifdef DEBUG_misha 533 void dbgDump(); 534 #endif 535 527 536 protected: 528 537 static int setCKey(class VBoxVHWAGlProgramVHWA * pProgram, const VBoxVHWAColorFormat * pFormat, const VBoxVHWAColorKey * pCKey, bool bDst); … … 1714 1723 public: 1715 1724 VBoxVHWATextureImageFBO(const QRect &size, const VBoxVHWAColorFormat &format, class VBoxVHWAGlProgramMngr * aMgr, VBOXVHWAIMG_TYPE flags) : 1716 T(size, format, aMgr, flags & (~ VBOXVHWAIMG_FBO)),1717 mFBOTex(size, VBoxVHWAColorFormat(32, 0xff0000, 0xff00, 0xff), aMgr, (flags & (~VBOXVHWAIMG_FBO)) | VBOXVHWAIMG_LINEAR),1725 T(size, format, aMgr, flags & (~(VBOXVHWAIMG_FBO | VBOXVHWAIMG_LINEAR))), 1726 mFBOTex(size, VBoxVHWAColorFormat(32, 0xff0000, 0xff00, 0xff), aMgr, (flags & (~VBOXVHWAIMG_FBO))), 1718 1727 mpvFBOTexMem(NULL) 1719 1728 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlayCommon.h
r33540 r34461 20 20 21 21 #if defined(DEBUG_misha) 22 DECLINLINE(VOID) vboxDbgPrintF(LPCSTR szString, ...) 23 { 24 char szBuffer[4096] = {0}; 25 va_list pArgList; 26 va_start(pArgList, szString); 27 _vsnprintf(szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]), szString, pArgList); 28 va_end(pArgList); 29 30 OutputDebugStringA(szBuffer); 31 } 32 22 33 # include "iprt/stream.h" 23 34 # define VBOXQGLLOG(_m) RTPrintf _m 24 35 # define VBOXQGLLOGREL(_m) do { RTPrintf _m ; LogRel( _m ); } while(0) 36 # define VBOXQGLDBGPRINT(_m) vboxDbgPrintF _m 25 37 #else 26 38 # define VBOXQGLLOG(_m) do {}while(0) 27 39 # define VBOXQGLLOGREL(_m) LogRel( _m ) 40 # define VBOXQGLDBGPRINT(_m) do {}while(0) 28 41 #endif 29 42 #define VBOXQGLLOG_ENTER(_m) do {}while(0)
Note:
See TracChangeset
for help on using the changeset viewer.