VirtualBox

Ignore:
Timestamp:
Aug 6, 2009 11:50:01 AM (15 years ago)
Author:
vboxsync
Message:

video hw accel: perf improvements: 1.YV12 stored as BGRA, 2.PBO used for overlays; bug-fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h

    r21977 r22028  
    634634    uint32_t fourcc() const {return mDataFormat;}
    635635    uint32_t bitsPerPixel() const { return mBitsPerPixel; }
    636     uint32_t bitsPerPixelDd() const { return mBitsPerPixelDd; }
     636    uint32_t bitsPerPixelTex() const { return mBitsPerPixelTex; }
     637//    uint32_t bitsPerPixelDd() const { return mBitsPerPixelDd; }
    637638    void pixel2Normalized(uint32_t pix, float *r, float *g, float *b) const;
    638639    uint32_t widthCompression() const {return mWidthCompression;}
     
    652653
    653654    uint32_t mBitsPerPixel;
    654     uint32_t mBitsPerPixelDd;
     655    uint32_t mBitsPerPixelTex;
     656//    uint32_t mBitsPerPixelDd;
    655657    uint32_t mWidthCompression;
    656658    uint32_t mHeightCompression;
     
    679681    const QRect & rect() {return mRect;}
    680682    uchar * address(){ return mAddress; }
    681     uint32_t rectSizeTex(const QRect * pRect) {return pRect->width() * pRect->height() * mBytesPerPixel;}
     683    uint32_t rectSizeTex(const QRect * pRect) {return pRect->width() * pRect->height() * mBytesPerPixelTex;}
    682684    uchar * pointAddress(int x, int y)
    683685    {
     
    686688        return pointAddressTex(x, y);
    687689    }
    688     uint32_t pointOffsetTex(int x, int y) { return y*mBytesPerLine + x*mBytesPerPixel; }
     690    uint32_t pointOffsetTex(int x, int y) { return y*mBytesPerLine + x*mBytesPerPixelTex; }
    689691    uchar * pointAddressTex(int x, int y) { return mAddress + pointOffsetTex(x, y); }
    690692    int toXTex(int x) {return x/mColorFormat.widthCompression();}
    691693    int toYTex(int y) {return y/mColorFormat.heightCompression();}
    692     ulong memSize(){ return mBytesPerLine * mRect.height()/mColorFormat.heightCompression(); }
     694    ulong memSize(){ return mBytesPerLine * mRect.height(); }
     695    uint32_t bytesPerLine() {return mBytesPerLine; }
    693696
    694697protected:
     
    704707    GLuint mTexture;
    705708    uint32_t mBytesPerPixel;
     709    uint32_t mBytesPerPixelTex;
    706710    uint32_t mBytesPerLine;
    707711    VBoxVHWAColorFormat mColorFormat;
     
    716720    VBoxVHWATextureNP2(const QRect * pRect, const VBoxVHWAColorFormat *pFormat) :
    717721        VBoxVHWATexture(pRect, pFormat){
    718         mTexRect = *pRect;
     722        mTexRect = QRect(0, 0, pRect->width()/pFormat->widthCompression(), pRect->height()/pFormat->heightCompression());
    719723    }
    720724};
     
    782786            VBoxVHWAColorFormat & aColorFormat,
    783787            VBoxVHWAColorKey * pSrcBltCKey, VBoxVHWAColorKey * pDstBltCKey,
    784             VBoxVHWAColorKey * pSrcOverlayCKey, VBoxVHWAColorKey * pDstOverlayCKey);
     788            VBoxVHWAColorKey * pSrcOverlayCKey, VBoxVHWAColorKey * pDstOverlayCKey,
     789            bool bVGA);
    785790
    786791    virtual ~VBoxVHWASurfaceBase();
     
    824829    uint32_t fourcc() {return mColorFormat.fourcc(); }
    825830
    826     ulong  bytesPerPixel() { return mBytesPerPixel; }
     831//    ulong  bytesPerPixel() { return mpTex[0]->bytesPerPixel(); }
    827832    ulong  bitsPerPixel() { return mColorFormat.bitsPerPixel(); }
    828     ulong  bitsPerPixelDd() { return mColorFormat.bitsPerPixelDd(); }
    829     ulong  bytesPerLine() { return mBytesPerLine; }
     833//    ulong  bitsPerPixelDd() { return mColorFormat.bitsPerPixelDd(); }
     834    ulong  bytesPerLine() { return mpTex[0]->bytesPerLine(); }
    830835
    831836    const VBoxVHWAColorKey * dstBltCKey() const { return mpDstBltCKey; }
     
    934939
    935940    const QRect& rect() {return mRect;}
    936     const QRect& texRect() {return mTexRect;}
     941//    const QRect& texRect() {return mTexRect;}
    937942
    938943//    /* surface currently being displayed in a flip chain */
     
    990995//    void doTex2FB(const QRect * aRect);
    991996    void doTex2FB(const QRect * pDstRect, const QRect * pSrcRect);
    992     void doMultiTex2FB(const QRect * pDstRect, const QRect * pDstTexSize, const QRect * pSrcRect, int cSrcTex);
     997    void doMultiTex2FB(const QRect * pDstRect, VBoxVHWATexture * pDstTex, const QRect * pSrcRect, int cSrcTex);
    993998    void doMultiTex2FB(const QRect * pDstRect, const QRect * pSrcRect, int cSrcTex);
    994999//    void doMultiTex2FB(GLenum tex, const QRect * pDstRect, const QRect * pSrcRect);
     
    9971002
    9981003    QRect mRect; /* == Inv FB size */
    999     QRect mTexRect; /* texture size */
     1004//    QRect mTexRect; /* texture size */
    10001005
    10011006    QRect mSrcRect;
     
    10321037
    10331038
    1034     GLenum mFormat;
    1035     GLint  mInternalFormat;
    1036     GLenum mType;
     1039//    GLenum mFormat;
     1040//    GLint  mInternalFormat;
     1041//    GLenum mType;
    10371042//    ulong  mDisplayWidth;
    10381043//    ulong  mDisplayHeight;
    1039     ulong  mBytesPerPixel;
    1040     ulong  mBytesPerLine;
     1044//    ulong  mBytesPerPixel;
     1045//    ulong  mBytesPerLine;
    10411046
    10421047    int mLockCount;
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