VirtualBox

Changeset 25264 in vbox


Ignore:
Timestamp:
Dec 9, 2009 10:26:39 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55790
Message:

2d: code cleaning

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

Legend:

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

    r25257 r25264  
    908908        mShaderCConvApplyAYUV(":/cconvApplyAYUV.c", GL_FRAGMENT_SHADER),
    909909        mShaderCConvAYUV(":/cconvAYUV.c", GL_FRAGMENT_SHADER),
    910 //        mShaderCConvAYUVVoid(":/cconvAYUV_void.c", GL_FRAGMENT_SHADER),
    911910        mShaderCConvBGR(":/cconvBGR.c", GL_FRAGMENT_SHADER),
    912 //        mShaderCConvBGRVoid(":/cconvBGR_void.c", GL_FRAGMENT_SHADER),
    913911        mShaderCConvUYVY(":/cconvUYVY.c", GL_FRAGMENT_SHADER),
    914 //        mShaderCConvUYVYVoid(":/cconvUYVY_void.c", GL_FRAGMENT_SHADER),
    915912        mShaderCConvYUY2(":/cconvYUY2.c", GL_FRAGMENT_SHADER),
    916 //        mShaderCConvYUY2Void(":/cconvYUY2_void.c", GL_FRAGMENT_SHADER),
    917913        mShaderCConvYV12(":/cconvYV12.c", GL_FRAGMENT_SHADER),
    918 //        mShaderCConvYV12Void(":/cconvYV12_void.c", GL_FRAGMENT_SHADER),
    919914        mShaderSplitBGRA(":/splitBGRA.c", GL_FRAGMENT_SHADER),
    920915        mShaderCKeyDst(":/ckeyDst.c", GL_FRAGMENT_SHADER),
    921916        mShaderCKeyDst2(":/ckeyDst2.c", GL_FRAGMENT_SHADER),
    922 //        mShaderCKeyDstVoid(":/ckeyDst_void.c", GL_FRAGMENT_SHADER),
    923     //  mShaderCKeySrc;
    924     //  mShaderCKeySrcVoid;
    925917        mShaderMainOverlay(":/mainOverlay.c", GL_FRAGMENT_SHADER),
    926918        mShaderMainOverlayNoCKey(":/mainOverlayNoCKey.c", GL_FRAGMENT_SHADER),
     
    942934    VBoxVHWAGlProgramVHWA * createProgram(uint32_t type, uint32_t fourcc);
    943935
    944 //    int startProgram(VBoxVHWAGlProgramVHWA * pProgram) {mCurrentProgram = pProgram; return pProgram->start();}
    945 
    946936    typedef std::list <VBoxVHWAGlProgramVHWA*> ProgramList;
    947937
    948 //    VBoxVHWAGlProgramVHWA * mCurrentProgram;
    949938    ProgramList mPrograms;
    950939
     
    952941
    953942    VBoxVHWAGlShaderComponent mShaderCConvAYUV;
    954 //    VBoxVHWAGlShaderComponent mShaderCConvAYUVVoid;
    955943    VBoxVHWAGlShaderComponent mShaderCConvBGR;
    956 //    VBoxVHWAGlShaderComponent mShaderCConvBGRVoid;
    957944    VBoxVHWAGlShaderComponent mShaderCConvUYVY;
    958 //    VBoxVHWAGlShaderComponent mShaderCConvUYVYVoid;
    959945    VBoxVHWAGlShaderComponent mShaderCConvYUY2;
    960 //    VBoxVHWAGlShaderComponent mShaderCConvYUY2Void;
    961946    VBoxVHWAGlShaderComponent mShaderCConvYV12;
    962 //    VBoxVHWAGlShaderComponent mShaderCConvYV12Void;
    963947    VBoxVHWAGlShaderComponent mShaderSplitBGRA;
    964948
     
    967951    /* expected the dst surface texture to be bound to the 2-nd tex unit */
    968952    VBoxVHWAGlShaderComponent mShaderCKeyDst2;
    969 //    VBoxVHWAGlShaderComponent mShaderCKeyDstVoid;
    970 //    VBoxVHWAGlShaderComponent mShaderCKeySrc;
    971 //    VBoxVHWAGlShaderComponent mShaderCKeySrcVoid;
    972 
    973953    VBoxVHWAGlShaderComponent mShaderMainOverlay;
    974954    VBoxVHWAGlShaderComponent mShaderMainOverlayNoCKey;
     
    1001981        }
    1002982    }
    1003 // ensure we don't have empty functions /* paranoya for for ATI on linux */
    1004 //    else
    1005 //    {
    1006 //        apShaders[cShaders++] = &mShaderCKeyDstVoid;
    1007 //    }
    1008983
    1009984    if(type & VBOXVHWA_PROGRAM_SRCCOLORKEY)
     
    10291004        else if(fourcc == FOURCC_YV12)
    10301005        {
    1031 //            apShaders[cShaders++] = &mShaderSplitBGRA;
    10321006            apShaders[cShaders++] = &mShaderCConvYV12;
    10331007            bFound = true;
     
    11151089VBoxVHWAGlProgramVHWA * VBoxVHWAGlProgramMngr::searchProgram(uint32_t type, uint32_t fourcc, bool bCreate)
    11161090{
    1117 //    if(mCurrentProgram && mCurrentProgram->matches(type))
    1118 //        return mCurrentProgram;
    1119 
    11201091    for (ProgramList::const_iterator it = mPrograms.begin();
    11211092         it != mPrograms.end(); ++ it)
     
    11421113{
    11431114    float r,g,b;
    1144 //    pProgram->start();
    1145 //    pFormat->pixel2Normalized(pCKey->upper(), &r, &g, &b);
    1146 //    int rcU = pProgram->setCKeyUpperRange(r, g, b);
    1147 //    Assert(RT_SUCCESS(rcU));
    11481115    pFormat->pixel2Normalized(pCKey->lower(), &r, &g, &b);
    11491116    int rcL = bDst ? pProgram->setDstCKeyLowerRange(r, g, b) : pProgram->setSrcCKeyLowerRange(r, g, b);
    11501117    Assert(RT_SUCCESS(rcL));
    1151 //    pProgram->stop();
    11521118
    11531119    return RT_SUCCESS(rcL) /*&& RT_SUCCESS(rcU)*/ ? VINF_SUCCESS: VERR_GENERAL_FAILURE;
     
    11871153#endif
    11881154
    1189 //    makeCurrent();
    1190 //    updateTexture(&mRect);
    11911155    mUpdateMem2TexRect.set(mRect);
    11921156    Assert(!mUpdateMem2TexRect.isClear());
    11931157    Assert(mRect.contains(mUpdateMem2TexRect.rect()));
    1194 //    mUpdateTex2FBRect.clear();
    1195 //    Assert(mUpdateTex2FBRect.isClear());
    11961158}
    11971159
     
    12001162    VBOXQGLLOG(("globalInit\n"));
    12011163
    1202 //    glEnable(GL_TEXTURE_2D);
    12031164    glEnable(GL_TEXTURE_RECTANGLE);
    12041165    glDisable(GL_DEPTH_TEST);
     
    12101171            glPixelStorei(GL_PACK_ALIGNMENT, 1);
    12111172            );
    1212 //
    1213 //    VBOXQGL_CHECKERR(
    1214 //            vboxglActiveTexture(GL_TEXTURE1);
    1215 //        );
    1216 //    VBOXQGL_CHECKERR(
    1217 //            glEnable(GL_TEXTURE_2D);
    1218 //            );
    1219 //    VBOXQGL_CHECKERR(
    1220 //            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    1221 //            );
    1222 //    VBOXQGL_CHECKERR(
    1223 //            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    1224 //            );
    1225 //    VBOXQGL_CHECKERR(
    1226 //            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
    1227 //            );
    1228 //    VBOXQGL_CHECKERR(
    1229 //            glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
    1230 //            );
    1231 //
    1232 //    VBOXQGL_CHECKERR(
    1233 //            vboxglActiveTexture(GL_TEXTURE0);
    1234 //        );
    1235 //    VBOXQGL_CHECKERR(
    1236 //            glEnable(GL_TEXTURE_2D);
    1237 //            );
    1238 //    VBOXQGL_CHECKERR(
    1239 //            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    1240 //            );
    1241 //    VBOXQGL_CHECKERR(
    1242 //            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    1243 //            );
    1244 //    VBOXQGL_CHECKERR(
    1245 //            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
    1246 //            );
    1247 //    VBOXQGL_CHECKERR(
    1248 //            glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
    1249 //            );
    12501173}
    12511174
     
    13151238    setRectValues(aTargRect, aSrcRect);
    13161239    setVisibleRectValues(aVisTargRect);
    1317 //    mTargSize = QRect(0, 0, aTargSize->width(), aTargSize->height());
    1318 
    1319 //    mBytesPerPixel = calcBytesPerPixel(mColorFormat.format(), mColorFormat.type());
    1320 //    mBytesPerLine = mRect.width() * mBytesPerPixel;
    13211240}
    13221241
     
    13971316void VBoxVHWASurfaceBase::uninit()
    13981317{
    1399 //    mState->makeCurrent(this);
    1400 
    14011318    deleteDisplay();
    14021319
     
    17291646    }
    17301647
    1731 #if 0
    1732     mUpdateTex2FBRect.add(mUpdateMem2TexRect);
    1733     Assert(!mUpdateTex2FBRect.isClear());
    1734     Assert(mRect.contains(mUpdateTex2FBRect.rect()));
    1735 #endif
    17361648    mUpdateMem2TexRect.clear();
    17371649    Assert(mUpdateMem2TexRect.isClear());
    1738 //#ifdef DEBUG
    1739 //    VBOXPRINTDIF(dbgTime, ("texMem:"));
    1740 //#endif
     1650
    17411651    return true;
    17421652}
     
    17651675    if(buf)
    17661676    {
    1767 //    updateBuffer((uchar*)buf, pRect);
    17681677        memcpy(buf, mAddress, memSize());
    17691678
     
    19471856    uint32_t t0height = mpTex[0]->rect().height();
    19481857
    1949 //    VBOXQGL_CHECKERR(
    19501858            glBegin(GL_QUADS);
    19511859            for(int i = 0; i < cSrcTex; i++)
    19521860            {
    1953 //                vboxglMultiTexCoord2d(GL_TEXTURE0 + i, ((double)tx1)/mpTex[i]->texRect().width()/(width()/mpTex[i]->rect().width()),
    1954 //                        ((double)ty1)/mpTex[i]->texRect().height()/(height()/mpTex[i]->rect().height()));
    19551861                mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx1/(t0width/mpTex[i]->texRect().width()), ty1/(t0height/mpTex[i]->rect().height()));
    19561862            }
     
    19581864            for(int i = 0; i < cSrcTex; i++)
    19591865            {
    1960 //                vboxglMultiTexCoord2d(GL_TEXTURE0 + i, ((double)tx1)/mpTex[i]->texRect().width()/(width()/mpTex[i]->rect().width()),
    1961 //                        ((double)ty2)/mpTex[i]->texRect().height()/(height()/mpTex[i]->rect().height()));
    19621866                mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx1/(t0width/mpTex[i]->texRect().width()), ty2/(t0height/mpTex[i]->rect().height()));
    19631867            }
     
    19651869            for(int i = 0; i < cSrcTex; i++)
    19661870            {
    1967 //                vboxglMultiTexCoord2d(GL_TEXTURE0 + i, ((double)tx2)/mpTex[i]->texRect().width()/(width()/mpTex[i]->rect().width()),
    1968 //                        ((double)ty2)/mpTex[i]->texRect().height()/(height()/mpTex[i]->rect().height()));
    19691871                mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx2/(t0width/mpTex[i]->texRect().width()), ty2/(t0height/mpTex[i]->rect().height()));
    19701872
     
    19731875            for(int i = 0; i < cSrcTex; i++)
    19741876            {
    1975 //                vboxglMultiTexCoord2d(GL_TEXTURE0 + i, ((double)tx2)/mpTex[i]->texRect().width()/(width()/mpTex[i]->rect().width()),
    1976 //                        ((double)ty1)/mpTex[i]->texRect().height()/(height()/mpTex[i]->rect().height()));
    19771877                mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx2/(t0width/mpTex[i]->texRect().width()), ty1/(t0height/mpTex[i]->rect().height()));
    19781878            }
    19791879            glVertex2i(bx2, by1);
    19801880            glEnd();
    1981 //            );
    19821881}
    19831882
     
    19921891    uint32_t t0height = mpTex[0]->rect().height();
    19931892
    1994 //    VBOXQGL_CHECKERR(
    19951893            glBegin(GL_QUADS);
    19961894
     
    20241922
    20251923            glEnd();
    2026 //            );
    20271924
    20281925}
     
    20461943    VBOXQGLLOG_QRECT("rect: ", pRect ? pRect : &mRect, "\n");
    20471944    VBOXQGLLOG_METHODTIME("time ");
    2048 //    if(!(flags & VBOXVHWA_LOCK_DISCARDCONTENTS))
    2049 //    {
    2050 //        synchMem(pRect);
    2051 //    }
    20521945
    20531946    mUpdateMem2TexRect.add(pRect ? *pRect : mRect);
     
    21342027}
    21352028
    2136 void VBoxVHWASurfaceBase::deleteDisplay(
    2137 //        bool bInverted
    2138         )
     2029void VBoxVHWASurfaceBase::deleteDisplay()
    21392030{
    21402031    if(mVisibleDisplayInitialized)
     
    21752066    if(bProgram)
    21762067    {
    2177 //        pProgram->start();
    2178 
    2179 //            if(pSrcCKey != NULL)
    2180 //            {
    2181 //                pProgram->start();
    2182 //                setCKey(pProgram, &pSrcSurface->colorFormat(), pSrcCKey);
    2183 
    2184 //                vboxglActiveTexture(GL_TEXTURE0);
    2185 //            }
    2186 
    21872068        if(bBindDst)
    21882069        {
     
    22192100    else
    22202101    {
    2221 //        vboxglActiveTexture(GL_TEXTURE0);
    22222102        mpTex[0]->bind();
    2223 //        VBOXQGLLOG(("binding (primary??) texture: %d\n", mpTex[0]->texture()));
    22242103    }
    22252104
     
    22422121        }
    22432122    }
    2244 
    2245 //    if(pProgram)
    2246 //    {
    2247 //        pProgram->stop();
    2248 //    }
    22492123}
    22502124
     
    23942268}
    23952269
    2396 //void VBoxVHWASurfaceBase::setVisibleTargetRect(const QRect & aRect)
    2397 //{
    2398 //    Assert(mVisibleRect.contains(aRect));
    2399 //    mVisibleRect = mSrcRect.intersected(aRect);
    2400 //}
    2401 
    24022270bool VBoxVHWASurfaceBase::performDisplay(VBoxVHWASurfaceBase *pPrimary, bool bForce)
    24032271{
     
    24532321        if(pProgram)
    24542322            pProgram->stop();
    2455 
    2456 
    2457 //        doDisplay(pPrimary, NULL, false);
    24582323    }
    24592324    else
     
    26582523        pFirst = pPipe->detachCmdList(pFirst, pLast);
    26592524    } while(pFirst);
    2660 
    2661 //    mDisplay.performDisplay();
    26622525}
    26632526
     
    29042767                        (pCmd->SurfInfo.PixelFormat.fourCC & 0xff000000) >> 24
    29052768                        ));
    2906 //#ifdef DEBUG_misha
    2907 //                Assert(0);
    2908 //#endif
    29092769                pCmd->u.out.ErrInfo = -1;
    29102770                return VINF_SUCCESS;
     
    29332793        if(mSurfHandleTable.get(handle))
    29342794        {
    2935 //            do
    2936 //            {
    2937 //                if(!mcVGASurfCreated)
    2938 //                {
    2939 //                    /* check if it is a primary surface that needs handle adjusting*/
    2940 //                    if((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)
    2941 //                            && handle2Surface(handle) == mDisplay.getVGA())
    2942 //                    {
    2943 //                        /* remove, the primary surface will be assigned to a new handle assumed by the guest */
    2944 //                        mSurfHandleTable.remove(handle);
    2945 //                        break;
    2946 //                    }
    2947 //                }
    2948                 Assert(0);
    2949                 return VERR_GENERAL_FAILURE;
    2950 //            }while(0);
     2795            Assert(0);
     2796            return VERR_GENERAL_FAILURE;
    29512797        }
    29522798    }
    29532799
    29542800    VBoxVHWASurfaceBase *surf = NULL;
    2955 //    VBoxVHWAColorFormat *pFormat = NULL, Format;
    29562801    bool bNoPBO = false;
    29572802    bool bPrimary = false;
     
    30392884            QRect primaryRect = mDisplay.getPrimary()->rect();
    30402885            surf = new VBoxVHWASurfaceBase(this, surfSize,
    3041 //                        ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &surfSize),
    30422886                        primaryRect,
    30432887                        QRect(0, 0, surfSize.width(), surfSize.height()),
     
    30572901            VBoxVHWAColorFormat format(pCmd->SurfInfo.PixelFormat.fourCC);
    30582902            surf = new VBoxVHWASurfaceBase(this, surfSize,
    3059             //                        ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &QSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height)),
    30602903                                    primaryRect,
    30612904                                    QRect(0, 0, surfSize.width(), surfSize.height()),
     
    31032946            Assert(pVga->handle() != VBOXVHWA_SURFHANDLE_INVALID);
    31042947            Assert(pVga != surf); NOREF(pVga);
    3105 //            Assert(mbVGASurfCreated);
    31062948            mDisplay.getVGA()->getComplexList()->add(surf);
    31072949#ifdef DEBUGVHWASTRICT
     
    31673009        {
    31683010            mDisplay.removeOverlay(pList);
    3169 //                Assert(mConstructingList != pList);
    31703011            if(pList == mConstructingList)
    31713012            {
     
    35333374    mRepaintNeeded = true;
    35343375
    3535 //    VBOXVHWA_CKEY_COLORSPACE
    35363376    if(pCmd->u.in.flags & VBOXVHWA_CKEY_DESTBLT)
    35373377    {
     
    39463786    VBOXQGL_LOAD_OVERLAYSTART(pSSM);
    39473787
    3948 //    char buf[VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_OVERLAY_UPDATE)];
    39493788    char *buf = new char[VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE)];
    39503789    memset(buf, 0, VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE));
     
    39623801    pUpdateOverlay->u.in.hSrcSurf = hSrc;
    39633802    pUpdateOverlay->u.in.hDstSurf = hDst;
    3964 //    Assert(hDst == mDisplay.getVGA()->handle());
    3965 //    VBoxVHWASurfaceBase *pDstSurf = handle2Surface(hDst);
    3966 //    VBoxVHWASurfaceBase *pSrcSurf = handle2Surface(hSrc);
    3967 //    Assert(pSrcSurf);
    3968 //    Assert(pDstSurf);
    3969 //    if(pSrcSurf && pDstSurf)
    39703803    {
    39713804        pUpdateOverlay->u.in.offDstSurface = VBOXVHWA_OFFSET64_VOID;
    3972 //        vboxVRAMOffset(pDstSurf);
    39733805        pUpdateOverlay->u.in.offSrcSurface = VBOXVHWA_OFFSET64_VOID;
    3974 //        vboxVRAMOffset(pSrcSurf);
    39753806
    39763807        if(pUpdateOverlay->u.in.flags & VBOXVHWA_OVER_KEYDESTOVERRIDE)
     
    39973828
    39983829        pCmdList->push_back(pCmd);
    3999 //        vboxExecOnResize(&VBoxGLWidget::vboxDoVHWACmdAndFree, pCmd); AssertRC(rc);
    4000 //        if(RT_SUCCESS(rc))
    4001 //        {
    4002 //            rc = pCmd->rc;
    4003 //            AssertRC(rc);
    4004 //        }
    4005     }
    4006 //    else
    4007 //    {
    4008 //        rc = VERR_GENERAL_FAILURE;
    4009 //    }
     3830    }
    40103831
    40113832    VBOXQGL_LOAD_OVERLAYSTOP(pSSM);
     
    42634084void VBoxGLWidget::vboxDoTestSurfaces(void* context)
    42644085{
    4265 //    uint32_t width = 103;
    4266 //    uint32_t height = 47;
    4267 //    uint32_t rgbBitCount = 32;
    4268 //    uint32_t r = 0xff, g = 0xff00, b = 0xff0000;
    4269 //    QRect dstRect(10, 50, width, height);
    4270 //    QRect srcRect(0, 0, width, height);
    4271 ////    Assert(0);
    4272 //    if(!pSurf1)
    4273 //    {
    4274 //
    4275 ////        pSurf1 = new VBoxVHWASurfaceBase(this, width, height,
    4276 ////                        VBoxVHWAColorFormat(rgbBitCount,
    4277 ////                                r,
    4278 ////                                g,
    4279 ////                                b),
    4280 ////                        NULL, NULL, NULL, NULL);
    4281 //        pSurf1 = new VBoxVHWASurfaceBase(this, &QSize(width, height),
    4282 ////                        ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &QSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height)),
    4283 //                        &mDisplay.getPrimary()->rect().size(),
    4284 //                        VBoxVHWAColorFormat(rgbBitCount,
    4285 //                                r,
    4286 //                                g,
    4287 //                                b),
    4288 ////                        pSrcBltCKey, pDstBltCKey, pSrcOverlayCKey, pDstOverlayCKey);
    4289 //                        NULL, NULL, NULL, NULL);
    4290 //
    4291 //        pSurf1->init(mDisplay.getVGA(), NULL);
    4292 //
    4293 //        VBoxVHWASurfList *pConstructingList = new VBoxVHWASurfList();
    4294 //        mDisplay.addOverlay(pConstructingList);
    4295 //        pConstructingList->add(pSurf1);
    4296 //        pConstructingList->setCurrentVisible(pSurf1);
    4297 ////        pSurf1->performDisplay();
    4298 //    }
    4299 //
    4300 ////    pDisplay->blt(&dstRect, pSurf1, &srcRect, NULL, NULL);
    4301 ////    pDisplay->performDisplay();
    43024086    if(g_iCur >= RT_ELEMENTS(g_apSurf))
    43034087        g_iCur = 0;
     
    44184202}
    44194203
    4420 //void VBoxGLWidget::vboxDoPaint(void *pe)
    4421 //{
    4422 //    Q_UNUSED(pe);
    4423 //
    4424 //#ifdef VBOXQGL_DBG_SURF
    4425 //    vboxDoTestSurfaces(NULL);
    4426 //#endif
    4427 ////#ifdef VBOXQGL_PROF_BASE
    4428 ////    vboxDoUpdateRect(&((QPaintEvent*)pe)->rect());
    4429 ////#endif
    4430 ////    mDisplay.performDisplay();
    4431 //}
    4432 
    44334204void VBoxGLWidget::vboxDoUpdateRect(const QRect * pRect)
    44344205{
     
    44384209void VBoxGLWidget::vboxDoResize(void *resize)
    44394210{
    4440 //    Assert(!format().accum());
    4441 //    Assert(format().alpha());
    4442 //    Assert(format().alphaBufferSize() == 8);
    44434211    VBOXQGLLOG(("format().blueBufferSize()(%d)\n", format().blueBufferSize()));
    44444212    VBOXQGLLOG(("format().greenBufferSize()(%d)\n", format().greenBufferSize()));
     
    44504218#endif
    44514219
    4452 //    Assert(!format().depth());
    44534220    Assert(format().directRendering());
    44544221    Assert(format().doubleBuffer());
    44554222    Assert(format().hasOpenGL());
    44564223    VBOXQGLLOG(("hasOpenGLOverlays(%d), hasOverlay(%d)\n", format().hasOpenGLOverlays(), format().hasOverlay()));
    4457 //    Assert(format().hasOpenGLOverlays());
    4458 //    Assert(format().hasOverlay());
    44594224    Assert(format().plane() == 0);
    44604225    Assert(format().rgba());
    44614226    Assert(!format().sampleBuffers());
    4462 //    Assert(!format().stencil());
    44634227    Assert(!format().stereo());
    44644228    VBOXQGLLOG(("swapInterval(%d)\n", format().swapInterval()));
    4465 //    Assert(format().swapInterval() == 0);
    44664229
    44674230
     
    44964259        {
    44974260            case 32:
    4498 //                format = VBoxVHWAColorFormat(bitsPerPixel, 0xff, 0xff00, 0xff0000);
    44994261                break;
    45004262            case 24:
     
    45024264                Assert(0);
    45034265#endif
    4504 //                format = VBoxVHWAColorFormat(bitsPerPixel, 0xff, 0xff00, 0xff0000);
    4505 //                remind = true;
    45064266                break;
    4507 //            case 16:
    4508 //                Assert(0);
    4509 ////                r = 0xf800;
    4510 ////                g = 0x7e0;
    4511 ////                b = 0x1f;
    4512 //                break;
    45134267            case 8:
    45144268#ifdef DEBUG_misha
     
    45694323        bytesPerLine = re->width()*bitsPerPixel/8;
    45704324        mPixelFormat = FramebufferPixelFormat_FOURCC_RGB;
    4571 //        internalformat = 3;//GL_RGB;
    4572 //        format = GL_BGRA_EXT;//GL_RGBA;
    4573 //        type = GL_UNSIGNED_BYTE;
    45744325        mUsesGuestVRAM = false;
    45754326    }
     
    45894340            if(pConstructingList)
    45904341                delete pConstructingList;
    4591     //
    4592     //            mDisplay.addOverlay(pConstructingList);
    4593     //            //            pConstructingList->add(pSurf1);
    4594     //            //            pConstructingList->setCurrentVisible(pSurf1);
    4595     //            ////            pConstructingList->setCurrentVisible(NULL);
    45964342        }
    45974343    }
     
    46274373        uint32_t width = 100;
    46284374        uint32_t height = 60;
    4629 //        uint32_t rgbBitCount = 32;
    4630 //        uint32_t r = 0xff, g = 0xff00, b = 0xff0000;
    4631 //        QRect dstRect(150, 200, width, height);
    4632 //        QRect srcRect(0, 0, 720, 480);
    4633     //    Assert(0);
    46344375
    46354376        for(int i = 0; i < RT_ELEMENTS(g_apSurf); i++)
     
    46584399            }
    46594400            pSurf1->updatedMem(&QRect(0,0,width, height));
    4660 //            VBOXQGL_CHECKERR(
    4661 //                    vboxglActiveTexture(GL_TEXTURE0);
    4662 //                );
    46634401
    46644402            VBoxVHWASurfList *pConstructingList = new VBoxVHWASurfList();
    46654403            mDisplay.addOverlay(pConstructingList);
    46664404            pConstructingList->add(pSurf1);
    4667 //            pConstructingList->setCurrentVisible(pSurf1);
    4668 //            pConstructingList->setCurrentVisible(NULL);
    46694405            g_apSurf[i] = pSurf1;
    46704406
    4671 //            VBoxVHWAGlProgramVHWA * pProgram = vboxVHWAGetGlProgramMngr()->getProgram(true, false, &pSurf1->colorFormat(), &pDisplay->colorFormat());
    4672 //            pProgram->start();
    4673 //            pProgram->setSrcTexImgWidth(pSurf1->texRect().width());
    4674 //            pProgram->stop();
    4675         }
    4676 //        else
    4677 //        {
    4678 //            VBoxVHWASurfList *pConstructingList = pSurf1->getComplexList();
    4679 //            mDisplay.addOverlay(pConstructingList);
    4680 //            pConstructingList->add(pSurf1);
    4681 //            pConstructingList->setCurrentVisible(pSurf1);
    4682 ////            pConstructingList->setCurrentVisible(NULL);
    4683 //        }
     4407        }
    46844408
    46854409        VBOXVHWACMD_SURF_OVERLAY_UPDATE updateCmd;
     
    47224446        mOnResizeCmdList.clear();
    47234447    }
    4724 
    4725 
    4726 //    mDisplay.performDisplay();
    47274448
    47284449    if (remind)
     
    50334754        default:
    50344755            break;
    5035     }//    Assert(0);
     4756    }
    50364757    /* indicate that we process and complete the command asynchronously */
    50374758    pCmd->Flags |= VBOXVHWACMD_FLAG_HG_ASYNCH;
     
    50834804}
    50844805
    5085 //VBOXFBOVERLAY_RESUT VBoxQGLOverlay::onPaintEvent (const QPaintEvent *pe, QRect *pRect)
    5086 //{
    5087 //    Q_UNUSED(pe);
    5088 //    Q_UNUSED(pRect);
    5089 //
    5090 ////    if(mOverlayWidgetVisible && !mProcessingCommands)
    5091 ////    {
    5092 ////        Assert(!mGlCurrent);
    5093 ////        vboxDoCheckUpdateViewport();
    5094 ////        vboxOpExit();
    5095 ////    }
    5096 //    return VBOXFBOVERLAY_UNTOUCHED;
    5097 //}
    5098 
    50994806void VBoxQGLOverlay::onResizeEvent (const VBoxResizeEvent *re)
    51004807{
     
    51604867    display.CompleteVHWACommand((BYTE*)cmd);
    51614868}
    5162 
    5163 //void VBoxQGLOverlay::vboxDoUpdateRect(const QRect * pRect)
    5164 //{
    5165 //    if(mGlOn)
    5166 //    {
    5167 //        makeCurrent();
    5168 //        mpOverlayWidget->vboxDoUpdateRect(pRect);
    5169 //        vboxOpExit();
    5170 //    }
    5171 //
    5172 //    mView->viewport()->repaint (pRect->x() - mView->contentsX(),
    5173 //            pRect->y() - mView->contentsY(),
    5174 //            pRect->width(), pRect->height());
    5175 //
    5176 //    /* translate to widget coords
    5177 //     * @todo: may eliminate this */
    5178 ////    QPaintEvent pe(pRect->translated(-mView->contentsX(), -mView->contentsY()));
    5179 ////    VBoxQImageFrameBuffer::paintEvent (&pe);
    5180 //}
    51814869
    51824870bool VBoxQGLOverlay::vboxSynchGl()
     
    52854973}
    52864974
    5287 //void VBoxQGLOverlayFrameBuffer::vboxUpdateOverlayPosition(const QPoint & pos)
    5288 //{
    5289 ////    makeCurrent();
    5290 //
    5291 //    mpOverlayWidget->move(pos);
    5292 //
    5293 ////    /* */
    5294 ////    QRect rect = mpOverlayWidget->vboxViewport();
    5295 ////    rect.moveTo(pos);
    5296 ////    mpOverlayWidget->vboxDoUpdateViewport(rect);
    5297 //}
    5298 
    52994975void VBoxQGLOverlay::vboxCheckUpdateOverlay(const QRect & rect)
    53004976{
     
    53214997        mGlCurrent = false;
    53224998    }
    5323 
    5324 //    mpOverlayWidget->vboxDoUpdateViewport(rect);
    5325 //
    5326 //    vboxShowOverlay(show);
    53274999}
    53285000
     
    55095181int VBoxQGLOverlay::vhwaLoadExec(struct SSMHANDLE * pSSM, uint32_t u32Version)
    55105182{
    5511 //    bool bTmp;
    5512 //    int rc = SSMR3GetBool(pSSM, &bTmp /*&mGlOn*/);         AssertRC(rc);
    5513 //    rc = SSMR3GetBool(pSSM, &bTmp /*&mOverlayVisible*/);         AssertRC(rc);
    5514 //    if(RT_SUCCESS(rc))
    55155183    return VBoxGLWidget::vhwaLoadExec(&mOnResizeCmdList, pSSM, u32Version);
    5516 //    return rc;
    55175184}
    55185185
    55195186void VBoxQGLOverlay::vhwaSaveExec(struct SSMHANDLE * pSSM)
    55205187{
    5521 //    int rc = SSMR3PutBool(pSSM, mGlOn);         AssertRC(rc);
    5522 //    rc = SSMR3PutBool(pSSM, mOverlayVisible);         AssertRC(rc);
    5523 //
    55245188    if(mpOverlayWidget)
    55255189        mpOverlayWidget->vhwaSaveExec(pSSM);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h

    r25257 r25264  
    833833            mPrimary.setCurrentVisible(pVga);
    834834        }
    835 //        mSurfPrimary = pVga;
    836835        mOverlays.clear();
    837836        return old;
     
    11781177    void vboxDoResize(void *re);
    11791178
    1180 //    void vboxPaintEvent (QPaintEvent *pe) {vboxPerformGLOp(&VBoxGLWidget::vboxDoPaint, pe); }
    11811179    void vboxResizeEvent (class VBoxResizeEvent *re) {vboxPerformGLOp(&VBoxGLWidget::vboxDoResize, re); }
    11821180
     
    12021200    bool performDisplayAndSwap(bool bForce)
    12031201    {
    1204 //      VBOXQGLLOG_METHODTIME("t:");
    1205 
    12061202        bForce = mDisplay.performDisplay(bForce | mRepaintNeeded);
    12071203        if(bForce)
     
    12361232        }
    12371233        VBOXQGLLOG(("paintGL\n"));
    1238 //        else
    1239 //        {
    1240             mDisplay.performDisplay(true);
    1241 //        }
     1234
     1235        mDisplay.performDisplay(true);
    12421236    }
    12431237
     
    12471241    static void setupMatricies(const QSize &display);
    12481242    static void adjustViewport(const QSize &display, const QRect &viewport);
    1249 //    void vboxDoPaint(void *rec);
    12501243
    12511244
     
    12931286    }
    12941287
    1295 //    /* posts op to UI thread */
    1296 //    int vboxExecOpSynch(PFNVBOXQGLOP pfn, void* pContext);
    1297 //    void vboxExecOnResize(PFNVBOXQGLOP pfn, void* pContext);
    1298 
    12991288    void vboxDoProcessVHWACommands(void *pContext);
    13001289
     
    13181307    bool mRepaintNeeded;
    13191308
    1320 //    bool   mbVGASurfCreated;
    13211309    QRect mViewport;
    13221310
     
    13381326};
    13391327
    1340 
    1341 //typedef enum
    1342 //{
    1343 //    VBOXFBOVERLAY_DONE = 1,
    1344 //    VBOXFBOVERLAY_MODIFIED,
    1345 //    VBOXFBOVERLAY_UNTOUCHED
    1346 //} VBOXFBOVERLAY_RESUT;
    13471328
    13481329class VBoxQGLOverlay
     
    14461427    }
    14471428
    1448 //    void vboxOpExit()
    1449 //    {
    1450 //        performDisplayOverlay();
    1451 //        mGlCurrent = false;
    1452 //    }
    1453 
    1454 
    14551429    void vboxSetGlOn(bool on);
    14561430    bool vboxGetGlOn() { return mGlOn; }
     
    14611435    void vboxDoVHWACmd(void *cmd);
    14621436    void addMainDirtyRect(const QRect & aRect);
    1463 //    void vboxUpdateOverlayPosition(const QPoint & pos);
    14641437    void vboxCheckUpdateOverlay(const QRect & rect);
    14651438    VBoxVHWACommandElement * processCmdList(VBoxVHWACommandElement * pCmd);
     
    15401513    }
    15411514
    1542 //    void paintEvent (QPaintEvent *pe)
    1543 //    {
    1544 //        QRect rect;
    1545 //        VBOXFBOVERLAY_RESUT res = mOverlay.onPaintEvent(pe, &rect);
    1546 //        switch(res)
    1547 //        {
    1548 //            case VBOXFBOVERLAY_MODIFIED:
    1549 //            {
    1550 //                QPaintEvent modified(rect);
    1551 //                T::paintEvent(&modified);
    1552 //            } break;
    1553 //            case VBOXFBOVERLAY_UNTOUCHED:
    1554 //                T::paintEvent(pe);
    1555 //                break;
    1556 //            default:
    1557 //                break;
    1558 //        }
    1559 //    }
    1560 
    15611515    void resizeEvent (VBoxResizeEvent *re)
    15621516    {
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