VirtualBox

Changeset 21977 in vbox


Ignore:
Timestamp:
Aug 5, 2009 10:09:21 AM (15 years ago)
Author:
vboxsync
Message:

video hw accel: non-rect textures & PBO support

File:
1 edited

Legend:

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

    r21950 r21977  
    2323#ifndef ___VBoxFrameBuffer_h___
    2424#define ___VBoxFrameBuffer_h___
    25 
     25//#define VBOXQGL_PROF_BASE 1
    2626#include "COMDefs.h"
    2727#include <iprt/critsect.h>
     
    666666    VBoxVHWATexture() {}
    667667    VBoxVHWATexture(const QRect * pRect, const VBoxVHWAColorFormat *pFormat);
    668 //    virtual ~VBoxVHWATexture();
     668    virtual ~VBoxVHWATexture();
    669669    virtual void init(uchar *pvMem);
    670670    void setAddress(uchar *pvMem) {mAddress = pvMem;}
    671     virtual void update(const QRect * pRect);
     671    void update(const QRect * pRect) { doUpdate(mAddress, pRect);}
    672672    void bind() {glBindTexture(texTarget(), mTexture);}
    673673
     
    679679    const QRect & rect() {return mRect;}
    680680    uchar * address(){ return mAddress; }
     681    uint32_t rectSizeTex(const QRect * pRect) {return pRect->width() * pRect->height() * mBytesPerPixel;}
    681682    uchar * pointAddress(int x, int y)
    682683    {
     
    685686        return pointAddressTex(x, y);
    686687    }
    687     uchar * pointAddressTex(int x, int y) { return mAddress + y*mBytesPerLine + x*mBytesPerPixel; }
     688    uint32_t pointOffsetTex(int x, int y) { return y*mBytesPerLine + x*mBytesPerPixel; }
     689    uchar * pointAddressTex(int x, int y) { return mAddress + pointOffsetTex(x, y); }
    688690    int toXTex(int x) {return x/mColorFormat.widthCompression();}
    689691    int toYTex(int y) {return y/mColorFormat.heightCompression();}
    690692    ulong memSize(){ return mBytesPerLine * mRect.height()/mColorFormat.heightCompression(); }
    691693
    692     void uninit();
    693 
    694694protected:
     695    virtual void doUpdate(uchar * pAddress, const QRect * pRect);
    695696    virtual void initParams();
    696697    virtual void load();
     
    705706    uint32_t mBytesPerLine;
    706707    VBoxVHWAColorFormat mColorFormat;
     708private:
     709    void uninit();
    707710};
    708711
     
    715718        mTexRect = *pRect;
    716719    }
    717 protected:
    718720};
    719721
     
    729731protected:
    730732    virtual GLenum texTarget();
     733};
     734
     735class VBoxVHWATextureNP2RectPBO : public VBoxVHWATextureNP2Rect
     736{
     737public:
     738        VBoxVHWATextureNP2RectPBO() : VBoxVHWATextureNP2Rect() {}
     739        VBoxVHWATextureNP2RectPBO(const QRect * pRect, const VBoxVHWAColorFormat *pFormat) :
     740                VBoxVHWATextureNP2Rect(pRect, pFormat){}
     741    virtual ~VBoxVHWATextureNP2RectPBO();
     742
     743    virtual void init(uchar *pvMem);
     744protected:
     745    virtual void load();
     746    virtual void doUpdate(uchar * pAddress, const QRect * pRect);
     747private:
     748    void updateBuffer(uchar * pBuf, const QRect * pRect);
     749    GLuint mPBO;
    731750};
    732751
     
    9931012
    9941013    uchar * mAddress;
    995     VBoxVHWATexture mTex[3];
     1014    VBoxVHWATexture *mpTex[3];
    9961015
    9971016    VBoxVHWAColorFormat mColorFormat;
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