VirtualBox

Ignore:
Timestamp:
Dec 17, 2009 8:17:25 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56136
Message:

2d: enabled FBO: linear stretching

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r25468 r25470  
    348348{
    349349    const VBoxVHWAInfo & info = vboxVHWAGetSupportInfo(pContext);
     350    GLint scaleFunc = (flags & VBOXVHWAIMG_LINEAR) ? GL_LINEAR : GL_NEAREST;
    350351    if((flags & VBOXVHWAIMG_PBO) && info.getGlInfo().isPBOSupported())
    351352    {
    352353        VBOXQGLLOG(("VBoxVHWATextureNP2RectPBO\n"));
    353         return new VBoxVHWATextureNP2RectPBO(aRect, aFormat);
     354        return new VBoxVHWATextureNP2RectPBO(aRect, aFormat, scaleFunc);
    354355    }
    355356    else if(info.getGlInfo().isTextureRectangleSupported())
    356357    {
    357358        VBOXQGLLOG(("VBoxVHWATextureNP2Rect\n"));
    358         return new VBoxVHWATextureNP2Rect(aRect, aFormat);
     359        return new VBoxVHWATextureNP2Rect(aRect, aFormat, scaleFunc);
    359360    }
    360361    else if(info.getGlInfo().isTextureNP2Supported())
    361362    {
    362363        VBOXQGLLOG(("VBoxVHWATextureNP2\n"));
    363         return new VBoxVHWATextureNP2(aRect, aFormat);
     364        return new VBoxVHWATextureNP2(aRect, aFormat, scaleFunc);
    364365    }
    365366    VBOXQGLLOG(("VBoxVHWATexture\n"));
    366     return new VBoxVHWATexture(aRect, aFormat);
     367    return new VBoxVHWATexture(aRect, aFormat, scaleFunc);
    367368}
    368369
     
    12171218    resetDefaultSrcOverlayCKey();
    12181219
    1219     mImage = vboxVHWAImageCreate(QRect(0,0,aSize.width(),aSize.height()), aColorFormat, getGlProgramMngr(), bVGA ? 0 : (VBOXVHWAIMG_PBO | VBOXVHWAIMG_PBOIMG /*| VBOXVHWAIMG_FBO*/));
     1220    mImage = vboxVHWAImageCreate(QRect(0,0,aSize.width(),aSize.height()), aColorFormat, getGlProgramMngr(), bVGA ? 0 : (VBOXVHWAIMG_PBO | VBOXVHWAIMG_PBOIMG | VBOXVHWAIMG_FBO));
    12201221
    12211222    setRectValues(aTargRect, aSrcRect);
     
    14381439}
    14391440
    1440 VBoxVHWATexture::VBoxVHWATexture(const QRect & aRect, const VBoxVHWAColorFormat &aFormat) :
     1441VBoxVHWATexture::VBoxVHWATexture(const QRect & aRect, const VBoxVHWAColorFormat &aFormat, GLint scaleFuncttion) :
    14411442            mAddress(NULL),
    14421443            mTexture(0),
    14431444            mBytesPerPixel(0),
    14441445            mBytesPerPixelTex(0),
    1445             mBytesPerLine(0)
     1446            mBytesPerLine(0),
     1447            mScaleFuncttion(scaleFuncttion)
    14461448{
    14471449    mColorFormat = aFormat;
     
    14591461    GLenum tt = texTarget();
    14601462
    1461     glTexParameteri(tt, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     1463    glTexParameteri(tt, GL_TEXTURE_MIN_FILTER, mScaleFuncttion);
    14621464    VBOXQGL_ASSERTNOERR();
    1463     glTexParameteri(tt, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
     1465    glTexParameteri(tt, GL_TEXTURE_MAG_FILTER, mScaleFuncttion);
    14641466    VBOXQGL_ASSERTNOERR();
    14651467    glTexParameteri(tt, GL_TEXTURE_WRAP_S, GL_CLAMP);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h

    r25468 r25470  
    241241            mBytesPerPixel(0),
    242242            mBytesPerPixelTex(0),
    243             mBytesPerLine(0)
     243            mBytesPerLine(0),
     244            mScaleFuncttion(GL_NEAREST)
    244245{}
    245     VBoxVHWATexture(const QRect & aRect, const VBoxVHWAColorFormat &aFormat);
     246    VBoxVHWATexture(const QRect & aRect, const VBoxVHWAColorFormat &aFormat, GLint scaleFuncttion);
    246247    virtual ~VBoxVHWATexture();
    247248    virtual void init(uchar *pvMem);
     
    285286    uint32_t mBytesPerLine;
    286287    VBoxVHWAColorFormat mColorFormat;
     288    GLint mScaleFuncttion;
    287289private:
    288290    void uninit();
     
    295297public:
    296298    VBoxVHWATextureNP2() : VBoxVHWATexture() {}
    297     VBoxVHWATextureNP2(const QRect & aRect, const VBoxVHWAColorFormat &aFormat) :
    298         VBoxVHWATexture(aRect, aFormat){
     299    VBoxVHWATextureNP2(const QRect & aRect, const VBoxVHWAColorFormat &aFormat, GLint scaleFuncttion) :
     300        VBoxVHWATexture(aRect, aFormat, scaleFuncttion){
    299301        mTexRect = QRect(0, 0, aRect.width()/aFormat.widthCompression(), aRect.height()/aFormat.heightCompression());
    300302    }
     
    305307public:
    306308    VBoxVHWATextureNP2Rect() : VBoxVHWATextureNP2() {}
    307     VBoxVHWATextureNP2Rect(const QRect & aRect, const VBoxVHWAColorFormat &aFormat) :
    308         VBoxVHWATextureNP2(aRect, aFormat){}
     309    VBoxVHWATextureNP2Rect(const QRect & aRect, const VBoxVHWAColorFormat &aFormat, GLint scaleFuncttion) :
     310        VBoxVHWATextureNP2(aRect, aFormat, scaleFuncttion){}
    309311
    310312    virtual void texCoord(int x, int y);
     
    321323        mPBO(0)
    322324    {}
    323     VBoxVHWATextureNP2RectPBO(const QRect & aRect, const VBoxVHWAColorFormat &aFormat) :
    324         VBoxVHWATextureNP2Rect(aRect, aFormat),
     325    VBoxVHWATextureNP2RectPBO(const QRect & aRect, const VBoxVHWAColorFormat &aFormat, GLint scaleFuncttion) :
     326        VBoxVHWATextureNP2Rect(aRect, aFormat, scaleFuncttion),
    325327        mPBO(0)
    326328    {}
     
    344346        mcbOffset(0)
    345347    {}
    346     VBoxVHWATextureNP2RectPBOMapped(const QRect & aRect, const VBoxVHWAColorFormat &aFormat) :
    347             VBoxVHWATextureNP2RectPBO(aRect, aFormat),
     348    VBoxVHWATextureNP2RectPBOMapped(const QRect & aRect, const VBoxVHWAColorFormat &aFormat, GLint scaleFuncttion) :
     349            VBoxVHWATextureNP2RectPBO(aRect, aFormat, scaleFuncttion),
    348350            mpMappedAllignedBuffer(NULL),
    349351            mcbOffset(0)
     
    378380#define VBOXVHWAIMG_PBOIMG 0x00000002U
    379381#define VBOXVHWAIMG_FBO    0x00000004U
     382#define VBOXVHWAIMG_LINEAR 0x00000008U
    380383typedef uint32_t VBOXVHWAIMG_TYPE;
    381384
     
    15791582    VBoxVHWATextureImageFBO(const QRect &size, const VBoxVHWAColorFormat &format, class VBoxVHWAGlProgramMngr * aMgr, VBOXVHWAIMG_TYPE flags) :
    15801583            T(size, format, aMgr, flags & (~VBOXVHWAIMG_FBO)),
    1581             mFBOTex(size, VBoxVHWAColorFormat(32, 0xff0000, 0xff00, 0xff), aMgr, flags & (~VBOXVHWAIMG_FBO)),
     1584            mFBOTex(size, VBoxVHWAColorFormat(32, 0xff0000, 0xff00, 0xff), aMgr, (flags & (~VBOXVHWAIMG_FBO)) | VBOXVHWAIMG_LINEAR),
    15821585            mpvFBOTexMem(NULL)
    15831586    {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette