- Timestamp:
- Jun 26, 2009 3:37:23 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxVideo.h
r20906 r20985 364 364 } VBOXVHWA_SURFACEDESC; 365 365 366 typedef struct _VBOXVHWA_BLT DESC366 typedef struct _VBOXVHWA_BLTFX 367 367 { 368 368 uint32_t flags; … … 370 370 uint32_t rotationOp; 371 371 uint32_t rotation; 372 uint32_t fillColor; 373 uint32_t Reserved; 372 374 VBOXVHWA_COLORKEY DstCK; 373 375 VBOXVHWA_COLORKEY SrcCK; 374 } VBOXVHWA_BLT DESC;375 376 typedef struct _VBOXVHWA_OVERLAY DESC376 } VBOXVHWA_BLTFX; 377 378 typedef struct _VBOXVHWA_OVERLAYFX 377 379 { 378 380 uint32_t flags; … … 382 384 VBOXVHWA_COLORKEY DstCK; 383 385 VBOXVHWA_COLORKEY SrcCK; 384 } VBOXVHWA_OVERLAY DESC;386 } VBOXVHWA_OVERLAYFX; 385 387 386 388 #define VBOXVHWA_CAPS_BLT 0x00000001 … … 388 390 #define VBOXVHWA_CAPS_BLTFOURCC 0x00000004 389 391 #define VBOXVHWA_CAPS_BLTSTRETCH 0x00000008 392 #define VBOXVHWA_CAPS_BLTQUEUE 0x00000010 390 393 391 394 #define VBOXVHWA_CAPS_OVERLAY 0x00000100 … … 393 396 #define VBOXVHWA_CAPS_OVERLAYSTRETCH 0x00000400 394 397 395 #define VBOXVHWA_CAPS_COLORKEY 0x00001000 396 //#define VBOXVHWA_CAPS_COLORKEYHWASSIST 0x00002000 /* always set COLORKEYHWASSIST in case host reports colorkey support */ 398 #define VBOXVHWA_CAPS_COLORKEY 0x00010000 399 #define VBOXVHWA_CAPS_COLORKEYHWASSIST 0x00020000 400 397 401 398 402 #define VBOXVHWA_CAPS2_COPYFOURCC 0x00000001 … … 400 404 #define VBOXVHWA_SCAPS_FLIP 0x00000001 401 405 #define VBOXVHWA_SCAPS_PRIMARYSURFACE 0x00000002 406 #define VBOXVHWA_SCAPS_OFFSCREENPLAIN 0x00000004 402 407 #define VBOXVHWA_SCAPS_OVERLAY 0x00000008 408 #define VBOXVHWA_SCAPS_VISIBLE 0x00000010 409 #define VBOXVHWA_SCAPS_VIDEOMEMORY 0x00000020 410 #define VBOXVHWA_SCAPS_LOCALVIDMEM 0x00000040 411 403 412 404 413 #define VBOXVHWA_PF_RGB 0x00000001 … … 423 432 #define VBOXVHWA_SD_WIDTH 0x00000400 424 433 434 #define VBOXVHWA_CKEYCAPS_DESTBLT 0x00000001 435 #define VBOXVHWA_CKEYCAPS_DESTBLTCLRSPACE 0x00000002 436 #define VBOXVHWA_CKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004 437 #define VBOXVHWA_CKEYCAPS_DESTBLTYUV 0x00000008 438 #define VBOXVHWA_CKEYCAPS_DESTOVERLAY 0x00000010 439 #define VBOXVHWA_CKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020 440 #define VBOXVHWA_CKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040 441 #define VBOXVHWA_CKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080 442 #define VBOXVHWA_CKEYCAPS_DESTOVERLAYYUV 0x00000100 443 #define VBOXVHWA_CKEYCAPS_NOCOSTOVERLAY 0x00000200 444 #define VBOXVHWA_CKEYCAPS_SRCBLT 0x00000400 445 #define VBOXVHWA_CKEYCAPS_SRCBLTCLRSPACE 0x00000800 446 #define VBOXVHWA_CKEYCAPS_SRCBLTCLRSPACEYUV 0x00001000 447 #define VBOXVHWA_CKEYCAPS_SRCBLTYUV 0x00002000 448 #define VBOXVHWA_CKEYCAPS_SRCOVERLAY 0x00004000 449 #define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACE 0x00008000 450 #define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00010000 451 #define VBOXVHWA_CKEYCAPS_SRCOVERLAYONEACTIVE 0x00020000 452 #define VBOXVHWA_CKEYCAPS_SRCOVERLAYYUV 0x00040000 453 454 455 #define VBOXVHWA_BLT_COLORFILL 0x00000400 456 #define VBOXVHWA_BLT_DDFX 0x00000800 457 #define VBOXVHWA_BLT_EXTENDED_FLAGS 0x40000000 458 #define VBOXVHWA_BLT_EXTENDED_LINEAR_CONTENT 0x00000004 459 #define VBOXVHWA_BLT_EXTENDED_PRESENTATION_STRETCHFACTOR 0x00000010 460 #define VBOXVHWA_BLT_KEYDESTOVERRIDE 0x00004000 461 #define VBOXVHWA_BLT_KEYSRCOVERRIDE 0x00010000 462 #define VBOXVHWA_BLT_LAST_PRESENTATION 0x20000000 463 #define VBOXVHWA_BLT_PRESENTATION 0x10000000 464 #define VBOXVHWA_BLT_ROP 0x00020000 465 466 467 425 468 426 469 #define VBOXVHWA_OFFSET64_VOID (~0L) … … 534 577 uint32_t flags; 535 578 uint32_t reserved; 536 VBOXVHWA_BLT DESCdesc;579 VBOXVHWA_BLTFX desc; 537 580 } in; 538 581 } u; … … 553 596 uint32_t flags; 554 597 uint32_t reserved; 555 VBOXVHWA_OVERLAY DESCdesc;598 VBOXVHWA_OVERLAYFX desc; 556 599 } in; 557 600 } u; -
trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c
r20692 r20985 1433 1433 pBody->SrcGuestSurfInfo = (uint64_t)pSrcDesc; 1434 1434 1435 pBody->u.in.flags = vboxVHWAFromDDBLTs(lpBlt->dwFlags); 1436 vboxVHWAFromDDBLTFX(&pBody->u.in.desc, &lpBlt->bltFX); 1437 1435 1438 ASMAtomicIncU32(&pSrcDesc->cPendingBltsSrc); 1436 1439 ASMAtomicIncU32(&pDestDesc->cPendingBltsDst); … … 1597 1600 return false; 1598 1601 1602 pHALInfo->ddCaps.dwCaps |= vboxVHWAToDDCAPS(pDev->vhwaInfo.caps); 1603 1599 1604 if(VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLT)) 1600 1605 { … … 1604 1609 rops, 1605 1610 sizeof(ropListNT)/sizeof(ropListNT[0])); 1606 1607 // The most basic DirectDraw functionality1608 pHALInfo->ddCaps.dwCaps |= DDCAPS_BLT1609 | DDCAPS_BLTQUEUE;1610 if(VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLTCOLORFILL))1611 {1612 pHALInfo->ddCaps.dwCaps |= DDCAPS_BLTCOLORFILL;1613 }1614 1611 } 1615 1612 … … 1617 1614 1618 1615 1619 pHALInfo->ddCaps.ddsCaps.dwCaps |= DDSCAPS_OFFSCREENPLAIN 1620 | DDSCAPS_PRIMARYSURFACE; 1621 if(pDev->vhwaInfo.surfaceCaps & VBOXVHWA_SCAPS_FLIP) 1622 { 1623 pHALInfo->ddCaps.ddsCaps.dwCaps |= DDSCAPS_FLIP; 1624 } 1616 pHALInfo->ddCaps.ddsCaps.dwCaps |= vboxVHWAToDDSCAPS(pDev->vhwaInfo.surfaceCaps); 1617 1625 1618 //disabled 1626 1619 // pHALInfo->ddCaps.dwCaps |= DDCAPS_3D | … … 1645 1638 // might get restricted by apps to run in fullscreen only 1646 1639 pHALInfo->ddCaps.dwCaps2 |= DDCAPS2_CANRENDERWINDOWED; 1640 1641 // Also permit surfaces wider than the display buffer. 1642 pHALInfo->ddCaps.dwCaps2 |= DDCAPS2_WIDESURFACES; 1647 1643 //#endif 1648 1644 … … 1669 1665 // 3. Mirroring in X and Y 1670 1666 // 4. ColorKeying from a source color and a source color space 1671 if( VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLT)1667 if((VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLT) || VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_OVERLAY)) 1672 1668 && VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLTSTRETCH)) 1673 1669 { 1674 pHALInfo->ddCaps.dwCaps |= DDCAPS_BLTSTRETCH;1675 1676 1670 // Special effects caps 1677 1671 //TODO: filter them out … … 1701 1695 } 1702 1696 1703 if( VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLT)1697 if((VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLT) || VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_OVERLAY)) 1704 1698 && VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_COLORKEY)) 1705 1699 { 1706 pHALInfo->ddCaps.dwCaps |= DDCAPS_COLORKEY; 1707 // | DDCAPS_CANBLTSYSMEM 1708 1709 // ColorKey caps 1710 //TODO: filter them out 1711 pHALInfo->ddCaps.dwCKeyCaps |= DDCKEYCAPS_SRCBLT | 1712 DDCKEYCAPS_SRCBLTCLRSPACE | 1713 DDCKEYCAPS_DESTBLT | 1714 DDCKEYCAPS_DESTBLTCLRSPACE; 1715 1716 pHALInfo->ddCaps.dwCKeyCaps |= DDCKEYCAPS_SRCBLTCLRSPACEYUV 1717 | DDCKEYCAPS_DESTBLTCLRSPACEYUV; 1718 1719 #if 0 1720 DDCKEYCAPS_DESTBLT Supports transparent blitting with a color key that identifies the replaceable bits of the destination surface for RGB colors. 1721 DDCKEYCAPS_DESTBLTCLRSPACE Supports transparent blitting with a color space that identifies the replaceable bits of the destination surface for RGB colors. 1722 DDCKEYCAPS_DESTBLTCLRSPACEYUV Supports transparent blitting with a color space that identifies the replaceable bits of the destination surface for YUV colors. 1723 DDCKEYCAPS_DESTBLTYUV Supports transparent blitting with a color key that identifies the replaceable bits of the destination surface for YUV colors. 1724 1725 DDCKEYCAPS_SRCBLT Supports transparent blitting using the color key for the source with this surface for RGB colors. 1726 DDCKEYCAPS_SRCBLTCLRSPACE Supports transparent blitting using a color space for the source with this surface for RGB colors. 1727 DDCKEYCAPS_SRCBLTCLRSPACEYUV Supports transparent blitting using a color space for the source with this surface for YUV colors. 1728 DDCKEYCAPS_SRCBLTYUV Supports transparent blitting using the color key for the source with this surface for YUV colors. 1729 #endif 1730 1731 } 1732 1733 if(VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_OVERLAY) 1734 && VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_COLORKEY)) 1735 { 1736 #if 0 1737 DDCKEYCAPS_DESTOVERLAY Supports overlaying with color keying of the replaceable bits of the destination surface being overlaid for RGB colors. 1738 DDCKEYCAPS_DESTOVERLAYCLRSPACE Supports a color space as the color key for the destination of RGB colors. 1739 DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV Supports a color space as the color key for the destination of YUV colors. 1740 DDCKEYCAPS_DESTOVERLAYONEACTIVE Supports only one active destination color key value for visible overlay surfaces. 1741 DDCKEYCAPS_DESTOVERLAYYUV Supports overlaying using color keying of the replaceable bits of the destination surface being overlaid for YUV colors. 1742 DDCKEYCAPS_NOCOSTOVERLAY Indicates that there are no bandwidth tradeoffs for using the color key with an overlay. 1743 1744 DDCKEYCAPS_SRCOVERLAY Supports overlaying using the color key for the source with this overlay surface for RGB colors. 1745 DDCKEYCAPS_SRCOVERLAYCLRSPACE Supports overlaying using a color space as the source color key for the overlay surface for RGB colors. 1746 DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV Supports overlaying using a color space as the source color key for the overlay surface for YUV colors. 1747 DDCKEYCAPS_SRCOVERLAYONEACTIVE Supports only one active source color key value for visible overlay surfaces. 1748 DDCKEYCAPS_SRCOVERLAYYUV Supports overlaying using the color key for the source with this overlay surface for YUV colors. 1749 #endif 1750 } 1700 pHALInfo->ddCaps.dwCKeyCaps = vboxVHWAToDDCKEYCAPS(pDev->vhwaInfo.colorKeyCaps); 1701 } 1702 1751 1703 // pHALInfo->ddCaps.dwSVBCaps = DDCAPS_BLT; 1752 1704 … … 1777 1729 // pHALInfo->ddCaps.ddsCaps.dwCaps |= DDSCAPS_MIPMAP; 1778 1730 1779 pHALInfo->ddCaps.ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM;1780 1781 1731 { 1782 1732 //#ifdef SUPPORT_VIDEOPORT … … 1797 1747 pHALInfo->ddCaps.dwMaxVisibleOverlays = pDev->vhwaInfo.numOverlays; 1798 1748 pHALInfo->ddCaps.dwCurrVisibleOverlays = 0; 1799 1800 pHALInfo->ddCaps.dwCaps |= DDCAPS_OVERLAY |1801 DDCAPS_OVERLAYFOURCC |1802 DDCAPS_OVERLAYSTRETCH |1803 DDCAPS_COLORKEYHWASSIST |1804 DDCAPS_OVERLAYCANTCLIP;1805 1806 pHALInfo->ddCaps.dwCKeyCaps |= DDCKEYCAPS_SRCOVERLAY |1807 DDCKEYCAPS_SRCOVERLAYONEACTIVE |1808 DDCKEYCAPS_SRCOVERLAYYUV |1809 DDCKEYCAPS_DESTOVERLAY |1810 DDCKEYCAPS_DESTOVERLAYONEACTIVE |1811 DDCKEYCAPS_DESTOVERLAYYUV;1812 1813 pHALInfo->ddCaps.ddsCaps.dwCaps |= DDSCAPS_OVERLAY;1814 1815 pHALInfo->ddCaps.dwFXCaps |= DDFXCAPS_OVERLAYSHRINKX |1816 DDFXCAPS_OVERLAYSHRINKXN |1817 DDFXCAPS_OVERLAYSHRINKY |1818 DDFXCAPS_OVERLAYSHRINKYN |1819 DDFXCAPS_OVERLAYSTRETCHX |1820 DDFXCAPS_OVERLAYSTRETCHXN |1821 DDFXCAPS_OVERLAYSTRETCHY |1822 DDFXCAPS_OVERLAYSTRETCHYN;1823 1749 1824 1750 // Indicates that Perm3 has no stretch ratio limitation … … 1834 1760 //#endif 1835 1761 //#endif 1836 1837 // Also permit surfaces wider than the display buffer.1838 pHALInfo->ddCaps.dwCaps2 |= DDCAPS2_WIDESURFACES;1839 1762 1840 1763 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h
r20906 r20985 315 315 uint32_t vboxVHWASupportedDDSCAPS(uint32_t caps); 316 316 uint32_t vboxVHWASupportedDDPFS(uint32_t caps); 317 318 uint32_t vboxVHWAUnsupportedDDCEYCAPS(uint32_t caps); 319 uint32_t vboxVHWASupportedDDCEYCAPS(uint32_t caps); 320 321 uint32_t vboxVHWAToDDBLTs(uint32_t caps); 322 uint32_t vboxVHWAFromDDBLTs(uint32_t caps); 323 324 void vboxVHWAFromDDBLTFX(VBOXVHWA_BLTFX *pVHWABlt, DDBLTFX *pDdBlt); 325 326 void vboxVHWAFromDDCOLORKEY(VBOXVHWA_COLORKEY *pVHWACKey, DDCOLORKEY *pDdCKey); 327 317 328 uint32_t vboxVHWAFromDDCAPS(uint32_t caps); 318 329 uint32_t vboxVHWAToDDCAPS(uint32_t caps); … … 321 332 uint32_t vboxVHWAFromDDPFS(uint32_t caps); 322 333 uint32_t vboxVHWAToDDPFS(uint32_t caps); 334 uint32_t vboxVHWAFromDDCKEYCAPS(uint32_t caps); 335 uint32_t vboxVHWAToDDCKEYCAPS(uint32_t caps); 323 336 int vboxVHWAFromDDPIXELFORMAT(VBOXVHWA_PIXELFORMAT *pVHWAFormat, DDPIXELFORMAT *pDdFormat); 324 337 int vboxVHWAFromDDSURFACEDESC(VBOXVHWA_SURFACEDESC *pVHWADesc, DDSURFACEDESC *pDdDesc); -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r20906 r20985 399 399 {} 400 400 401 uint32_t upper() {return mUpper; }402 uint32_t lower() {return mLower; }401 uint32_t upper() const {return mUpper; } 402 uint32_t lower() const {return mLower; } 403 403 private: 404 404 uint32_t mUpper; … … 406 406 }; 407 407 408 class VBoxVHWAColorComponent 409 { 410 public: 411 VBoxVHWAColorComponent() : 412 mMask(0), 413 mRange(0), 414 mOffset(32), 415 mcBits(0) 416 {} 417 418 VBoxVHWAColorComponent(uint32_t aMask); 419 420 uint32_t mask() const { return mMask; } 421 uint32_t range() const { return mRange; } 422 uint32_t offset() const { return mOffset; } 423 uint32_t cBits() const { return mcBits; } 424 uint32_t colorVal(uint32_t col) const { return (col & mMask) >> mOffset; } 425 float colorValNorm(uint32_t col) const { return ((float)colorVal(col))/mRange; } 426 private: 427 uint32_t mMask; 428 uint32_t mRange; 429 uint32_t mOffset; 430 uint32_t mcBits; 431 }; 432 408 433 class VBoxVHWAColorFormat 409 434 { 410 435 public: 411 436 412 VBoxVHWAColorFormat(GLint aInternalFormat, GLenum aFormat, GLenum aType, uint32_t aDataFormat) : 413 mInternalFormat(aInternalFormat), 414 mFormat(aFormat), 415 mType(aType), 416 mDataFormat(aDataFormat) 417 {} 437 // VBoxVHWAColorFormat(GLint aInternalFormat, GLenum aFormat, GLenum aType, uint32_t aDataFormat); 438 VBoxVHWAColorFormat(uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b); 418 439 419 440 GLint internalFormat() const {return mInternalFormat; } 420 441 GLenum format() const {return mFormat; } 421 442 GLenum type() const {return mType; } 443 bool isValid() const {return mBitsPerPixel != 0; } 422 444 uint32_t dataFormat() const {return mDataFormat;} 423 424 void pixel2Normalized(uint32_t pix, float &r, float &g, float &b); 425 uint32_t r(uint32_t pix); 426 uint32_t g(uint32_t pix); 427 uint32_t b(uint32_t pix); 428 429 private: 445 uint32_t bitsPerPixel() const { return mBitsPerPixel; } 446 void pixel2Normalized(uint32_t pix, float *r, float *g, float *b) const; 447 // uint32_t r(uint32_t pix); 448 // uint32_t g(uint32_t pix); 449 // uint32_t b(uint32_t pix); 450 451 private: 452 void VBoxVHWAColorFormat::init(uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b); 453 430 454 GLint mInternalFormat; 431 455 GLenum mFormat; … … 433 457 uint32_t mDataFormat; 434 458 435 uint32_t mRMask; 436 uint32_t mGMask; 437 uint32_t mBMask; 438 uint32_t mRRange; 439 uint32_t mGRange; 440 uint32_t mBRange; 441 459 uint32_t mBitsPerPixel; 460 461 VBoxVHWAColorComponent mR; 462 VBoxVHWAColorComponent mG; 463 VBoxVHWAColorComponent mB; 442 464 }; 443 465 … … 458 480 static void globalInit(); 459 481 460 int blt(const QRect * aDstRect, VBoxVHWASurfaceBase * aSrtSurface, const QRect * aSrcRect, uint32_t flags, struct _VBOXVHWA_BLTDESC * pBltInfo);482 int blt(const QRect * aDstRect, VBoxVHWASurfaceBase * aSrtSurface, const QRect * aSrcRect, const VBoxVHWAColorKey * pDstCKeyOverride, const VBoxVHWAColorKey * pSrcCKeyOverride); 461 483 462 484 virtual int lock(const QRect * pRect, uint32_t flags); … … 486 508 487 509 ulong bytesPerPixel() { return mBytesPerPixel; } 510 ulong bitsPerPixel() { return mColorFormat.bitsPerPixel(); } 488 511 ulong bytesPerLine() { return mBytesPerLine; } 489 512 … … 508 531 #ifdef VBOX_WITH_VIDEOHWACCEL 509 532 virtual class VBoxVHWAGlProgramMngr * getGlProgramMngr() = 0; 533 static int setCKey(class VBoxVHWAGlProgramVHWA * pProgram, const VBoxVHWAColorFormat * pFormat, const VBoxVHWAColorKey * pCKey); 510 534 #endif 511 535 private: … … 572 596 void init(uchar *pvMem); 573 597 574 int unlock()575 {576 int rc = VBoxVHWASurfaceBase::unlock();577 if(!mBuffer)578 performDisplay();579 return rc;580 }598 // int unlock() 599 // { 600 // int rc = VBoxVHWASurfaceBase::unlock(); 601 // if(!mBuffer) 602 // performDisplay(); 603 // return rc; 604 // } 581 605 #ifdef VBOX_WITH_VIDEOHWACCEL 582 606 class VBoxVHWAGlProgramMngr * getGlProgramMngr(); … … 599 623 uchar *vboxAddress() { return pDisplay ? pDisplay->address() : NULL; } 600 624 uchar *vboxVRAMAddressFromOffset(uint64_t offset); 601 ulong vboxBitsPerPixel() { return mBitsPerPixel; }625 ulong vboxBitsPerPixel() { return pDisplay->bitsPerPixel(); } 602 626 ulong vboxBytesPerLine() { return pDisplay ? pDisplay->bytesPerLine() : NULL; } 603 627 … … 616 640 // void resizeGL (int height, int width); 617 641 618 void paintGL() { (this->*mpfnOp)(mOpContext); }642 void paintGL() { (this->*mpfnOp)(mOpContext); } 619 643 620 644 void initializeGL(); … … 657 681 void *mOpContext; 658 682 659 ulong mBitsPerPixel;683 // ulong mBitsPerPixel; 660 684 ulong mPixelFormat; 661 685 bool mUsesGuestVRAM;
Note:
See TracChangeset
for help on using the changeset viewer.