Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp	(revision 25263)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp	(revision 25264)
@@ -908,19 +908,11 @@
         mShaderCConvApplyAYUV(":/cconvApplyAYUV.c", GL_FRAGMENT_SHADER),
         mShaderCConvAYUV(":/cconvAYUV.c", GL_FRAGMENT_SHADER),
-//        mShaderCConvAYUVVoid(":/cconvAYUV_void.c", GL_FRAGMENT_SHADER),
         mShaderCConvBGR(":/cconvBGR.c", GL_FRAGMENT_SHADER),
-//        mShaderCConvBGRVoid(":/cconvBGR_void.c", GL_FRAGMENT_SHADER),
         mShaderCConvUYVY(":/cconvUYVY.c", GL_FRAGMENT_SHADER),
-//        mShaderCConvUYVYVoid(":/cconvUYVY_void.c", GL_FRAGMENT_SHADER),
         mShaderCConvYUY2(":/cconvYUY2.c", GL_FRAGMENT_SHADER),
-//        mShaderCConvYUY2Void(":/cconvYUY2_void.c", GL_FRAGMENT_SHADER),
         mShaderCConvYV12(":/cconvYV12.c", GL_FRAGMENT_SHADER),
-//        mShaderCConvYV12Void(":/cconvYV12_void.c", GL_FRAGMENT_SHADER),
         mShaderSplitBGRA(":/splitBGRA.c", GL_FRAGMENT_SHADER),
         mShaderCKeyDst(":/ckeyDst.c", GL_FRAGMENT_SHADER),
         mShaderCKeyDst2(":/ckeyDst2.c", GL_FRAGMENT_SHADER),
-//        mShaderCKeyDstVoid(":/ckeyDst_void.c", GL_FRAGMENT_SHADER),
-    //  mShaderCKeySrc;
-    //  mShaderCKeySrcVoid;
         mShaderMainOverlay(":/mainOverlay.c", GL_FRAGMENT_SHADER),
         mShaderMainOverlayNoCKey(":/mainOverlayNoCKey.c", GL_FRAGMENT_SHADER),
@@ -942,9 +934,6 @@
     VBoxVHWAGlProgramVHWA * createProgram(uint32_t type, uint32_t fourcc);
 
-//    int startProgram(VBoxVHWAGlProgramVHWA * pProgram) {mCurrentProgram = pProgram; return pProgram->start();}
-
     typedef std::list <VBoxVHWAGlProgramVHWA*> ProgramList;
 
-//    VBoxVHWAGlProgramVHWA * mCurrentProgram;
     ProgramList mPrograms;
 
@@ -952,13 +941,8 @@
 
     VBoxVHWAGlShaderComponent mShaderCConvAYUV;
-//    VBoxVHWAGlShaderComponent mShaderCConvAYUVVoid;
     VBoxVHWAGlShaderComponent mShaderCConvBGR;
-//    VBoxVHWAGlShaderComponent mShaderCConvBGRVoid;
     VBoxVHWAGlShaderComponent mShaderCConvUYVY;
-//    VBoxVHWAGlShaderComponent mShaderCConvUYVYVoid;
     VBoxVHWAGlShaderComponent mShaderCConvYUY2;
-//    VBoxVHWAGlShaderComponent mShaderCConvYUY2Void;
     VBoxVHWAGlShaderComponent mShaderCConvYV12;
-//    VBoxVHWAGlShaderComponent mShaderCConvYV12Void;
     VBoxVHWAGlShaderComponent mShaderSplitBGRA;
 
@@ -967,8 +951,4 @@
     /* expected the dst surface texture to be bound to the 2-nd tex unit */
     VBoxVHWAGlShaderComponent mShaderCKeyDst2;
-//    VBoxVHWAGlShaderComponent mShaderCKeyDstVoid;
-//    VBoxVHWAGlShaderComponent mShaderCKeySrc;
-//    VBoxVHWAGlShaderComponent mShaderCKeySrcVoid;
-
     VBoxVHWAGlShaderComponent mShaderMainOverlay;
     VBoxVHWAGlShaderComponent mShaderMainOverlayNoCKey;
@@ -1001,9 +981,4 @@
         }
     }
-// ensure we don't have empty functions /* paranoya for for ATI on linux */
-//    else
-//    {
-//        apShaders[cShaders++] = &mShaderCKeyDstVoid;
-//    }
 
     if(type & VBOXVHWA_PROGRAM_SRCCOLORKEY)
@@ -1029,5 +1004,4 @@
         else if(fourcc == FOURCC_YV12)
         {
-//            apShaders[cShaders++] = &mShaderSplitBGRA;
             apShaders[cShaders++] = &mShaderCConvYV12;
             bFound = true;
@@ -1115,7 +1089,4 @@
 VBoxVHWAGlProgramVHWA * VBoxVHWAGlProgramMngr::searchProgram(uint32_t type, uint32_t fourcc, bool bCreate)
 {
-//    if(mCurrentProgram && mCurrentProgram->matches(type))
-//        return mCurrentProgram;
-
     for (ProgramList::const_iterator it = mPrograms.begin();
          it != mPrograms.end(); ++ it)
@@ -1142,12 +1113,7 @@
 {
     float r,g,b;
-//    pProgram->start();
-//    pFormat->pixel2Normalized(pCKey->upper(), &r, &g, &b);
-//    int rcU = pProgram->setCKeyUpperRange(r, g, b);
-//    Assert(RT_SUCCESS(rcU));
     pFormat->pixel2Normalized(pCKey->lower(), &r, &g, &b);
     int rcL = bDst ? pProgram->setDstCKeyLowerRange(r, g, b) : pProgram->setSrcCKeyLowerRange(r, g, b);
     Assert(RT_SUCCESS(rcL));
-//    pProgram->stop();
 
     return RT_SUCCESS(rcL) /*&& RT_SUCCESS(rcU)*/ ? VINF_SUCCESS: VERR_GENERAL_FAILURE;
@@ -1187,11 +1153,7 @@
 #endif
 
-//    makeCurrent();
-//    updateTexture(&mRect);
     mUpdateMem2TexRect.set(mRect);
     Assert(!mUpdateMem2TexRect.isClear());
     Assert(mRect.contains(mUpdateMem2TexRect.rect()));
-//    mUpdateTex2FBRect.clear();
-//    Assert(mUpdateTex2FBRect.isClear());
 }
 
@@ -1200,5 +1162,4 @@
     VBOXQGLLOG(("globalInit\n"));
 
-//    glEnable(GL_TEXTURE_2D);
     glEnable(GL_TEXTURE_RECTANGLE);
     glDisable(GL_DEPTH_TEST);
@@ -1210,42 +1171,4 @@
             glPixelStorei(GL_PACK_ALIGNMENT, 1);
             );
-//
-//    VBOXQGL_CHECKERR(
-//            vboxglActiveTexture(GL_TEXTURE1);
-//        );
-//    VBOXQGL_CHECKERR(
-//            glEnable(GL_TEXTURE_2D);
-//            );
-//    VBOXQGL_CHECKERR(
-//            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-//            );
-//    VBOXQGL_CHECKERR(
-//            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-//            );
-//    VBOXQGL_CHECKERR(
-//            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
-//            );
-//    VBOXQGL_CHECKERR(
-//            glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
-//            );
-//
-//    VBOXQGL_CHECKERR(
-//            vboxglActiveTexture(GL_TEXTURE0);
-//        );
-//    VBOXQGL_CHECKERR(
-//            glEnable(GL_TEXTURE_2D);
-//            );
-//    VBOXQGL_CHECKERR(
-//            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-//            );
-//    VBOXQGL_CHECKERR(
-//            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-//            );
-//    VBOXQGL_CHECKERR(
-//            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
-//            );
-//    VBOXQGL_CHECKERR(
-//            glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
-//            );
 }
 
@@ -1315,8 +1238,4 @@
     setRectValues(aTargRect, aSrcRect);
     setVisibleRectValues(aVisTargRect);
-//    mTargSize = QRect(0, 0, aTargSize->width(), aTargSize->height());
-
-//    mBytesPerPixel = calcBytesPerPixel(mColorFormat.format(), mColorFormat.type());
-//    mBytesPerLine = mRect.width() * mBytesPerPixel;
 }
 
@@ -1397,6 +1316,4 @@
 void VBoxVHWASurfaceBase::uninit()
 {
-//    mState->makeCurrent(this);
-
     deleteDisplay();
 
@@ -1729,14 +1646,7 @@
     }
 
-#if 0
-    mUpdateTex2FBRect.add(mUpdateMem2TexRect);
-    Assert(!mUpdateTex2FBRect.isClear());
-    Assert(mRect.contains(mUpdateTex2FBRect.rect()));
-#endif
     mUpdateMem2TexRect.clear();
     Assert(mUpdateMem2TexRect.isClear());
-//#ifdef DEBUG
-//    VBOXPRINTDIF(dbgTime, ("texMem:"));
-//#endif
+
     return true;
 }
@@ -1765,5 +1675,4 @@
     if(buf)
     {
-//    updateBuffer((uchar*)buf, pRect);
         memcpy(buf, mAddress, memSize());
 
@@ -1947,10 +1856,7 @@
     uint32_t t0height = mpTex[0]->rect().height();
 
-//    VBOXQGL_CHECKERR(
             glBegin(GL_QUADS);
             for(int i = 0; i < cSrcTex; i++)
             {
-//                vboxglMultiTexCoord2d(GL_TEXTURE0 + i, ((double)tx1)/mpTex[i]->texRect().width()/(width()/mpTex[i]->rect().width()),
-//                        ((double)ty1)/mpTex[i]->texRect().height()/(height()/mpTex[i]->rect().height()));
                 mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx1/(t0width/mpTex[i]->texRect().width()), ty1/(t0height/mpTex[i]->rect().height()));
             }
@@ -1958,6 +1864,4 @@
             for(int i = 0; i < cSrcTex; i++)
             {
-//                vboxglMultiTexCoord2d(GL_TEXTURE0 + i, ((double)tx1)/mpTex[i]->texRect().width()/(width()/mpTex[i]->rect().width()),
-//                        ((double)ty2)/mpTex[i]->texRect().height()/(height()/mpTex[i]->rect().height()));
                 mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx1/(t0width/mpTex[i]->texRect().width()), ty2/(t0height/mpTex[i]->rect().height()));
             }
@@ -1965,6 +1869,4 @@
             for(int i = 0; i < cSrcTex; i++)
             {
-//                vboxglMultiTexCoord2d(GL_TEXTURE0 + i, ((double)tx2)/mpTex[i]->texRect().width()/(width()/mpTex[i]->rect().width()),
-//                        ((double)ty2)/mpTex[i]->texRect().height()/(height()/mpTex[i]->rect().height()));
                 mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx2/(t0width/mpTex[i]->texRect().width()), ty2/(t0height/mpTex[i]->rect().height()));
 
@@ -1973,11 +1875,8 @@
             for(int i = 0; i < cSrcTex; i++)
             {
-//                vboxglMultiTexCoord2d(GL_TEXTURE0 + i, ((double)tx2)/mpTex[i]->texRect().width()/(width()/mpTex[i]->rect().width()),
-//                        ((double)ty1)/mpTex[i]->texRect().height()/(height()/mpTex[i]->rect().height()));
                 mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx2/(t0width/mpTex[i]->texRect().width()), ty1/(t0height/mpTex[i]->rect().height()));
             }
             glVertex2i(bx2, by1);
             glEnd();
-//            );
 }
 
@@ -1992,5 +1891,4 @@
     uint32_t t0height = mpTex[0]->rect().height();
 
-//    VBOXQGL_CHECKERR(
             glBegin(GL_QUADS);
 
@@ -2024,5 +1922,4 @@
 
             glEnd();
-//            );
 
 }
@@ -2046,8 +1943,4 @@
     VBOXQGLLOG_QRECT("rect: ", pRect ? pRect : &mRect, "\n");
     VBOXQGLLOG_METHODTIME("time ");
-//    if(!(flags & VBOXVHWA_LOCK_DISCARDCONTENTS))
-//    {
-//        synchMem(pRect);
-//    }
 
     mUpdateMem2TexRect.add(pRect ? *pRect : mRect);
@@ -2134,7 +2027,5 @@
 }
 
-void VBoxVHWASurfaceBase::deleteDisplay(
-//        bool bInverted
-        )
+void VBoxVHWASurfaceBase::deleteDisplay()
 {
     if(mVisibleDisplayInitialized)
@@ -2175,14 +2066,4 @@
     if(bProgram)
     {
-//        pProgram->start();
-
-//            if(pSrcCKey != NULL)
-//            {
-//                pProgram->start();
-//                setCKey(pProgram, &pSrcSurface->colorFormat(), pSrcCKey);
-
-//                vboxglActiveTexture(GL_TEXTURE0);
-//            }
-
         if(bBindDst)
         {
@@ -2219,7 +2100,5 @@
     else
     {
-//        vboxglActiveTexture(GL_TEXTURE0);
         mpTex[0]->bind();
-//        VBOXQGLLOG(("binding (primary??) texture: %d\n", mpTex[0]->texture()));
     }
 
@@ -2242,9 +2121,4 @@
         }
     }
-
-//    if(pProgram)
-//    {
-//        pProgram->stop();
-//    }
 }
 
@@ -2394,10 +2268,4 @@
 }
 
-//void VBoxVHWASurfaceBase::setVisibleTargetRect(const QRect & aRect)
-//{
-//    Assert(mVisibleRect.contains(aRect));
-//    mVisibleRect = mSrcRect.intersected(aRect);
-//}
-
 bool VBoxVHWASurfaceBase::performDisplay(VBoxVHWASurfaceBase *pPrimary, bool bForce)
 {
@@ -2453,7 +2321,4 @@
         if(pProgram)
             pProgram->stop();
-
-
-//        doDisplay(pPrimary, NULL, false);
     }
     else
@@ -2658,6 +2523,4 @@
         pFirst = pPipe->detachCmdList(pFirst, pLast);
     } while(pFirst);
-
-//    mDisplay.performDisplay();
 }
 
@@ -2904,7 +2767,4 @@
                         (pCmd->SurfInfo.PixelFormat.fourCC & 0xff000000) >> 24
                         ));
-//#ifdef DEBUG_misha
-//                Assert(0);
-//#endif
                 pCmd->u.out.ErrInfo = -1;
                 return VINF_SUCCESS;
@@ -2933,25 +2793,10 @@
         if(mSurfHandleTable.get(handle))
         {
-//            do
-//            {
-//                if(!mcVGASurfCreated)
-//                {
-//                    /* check if it is a primary surface that needs handle adjusting*/
-//                    if((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)
-//                            && handle2Surface(handle) == mDisplay.getVGA())
-//                    {
-//                        /* remove, the primary surface will be assigned to a new handle assumed by the guest */
-//                        mSurfHandleTable.remove(handle);
-//                        break;
-//                    }
-//                }
-                Assert(0);
-                return VERR_GENERAL_FAILURE;
-//            }while(0);
+            Assert(0);
+            return VERR_GENERAL_FAILURE;
         }
     }
 
     VBoxVHWASurfaceBase *surf = NULL;
-//    VBoxVHWAColorFormat *pFormat = NULL, Format;
     bool bNoPBO = false;
     bool bPrimary = false;
@@ -3039,5 +2884,4 @@
             QRect primaryRect = mDisplay.getPrimary()->rect();
             surf = new VBoxVHWASurfaceBase(this, surfSize,
-//                        ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &surfSize),
                         primaryRect,
                         QRect(0, 0, surfSize.width(), surfSize.height()),
@@ -3057,5 +2901,4 @@
             VBoxVHWAColorFormat format(pCmd->SurfInfo.PixelFormat.fourCC);
             surf = new VBoxVHWASurfaceBase(this, surfSize,
-            //                        ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &QSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height)),
                                     primaryRect,
                                     QRect(0, 0, surfSize.width(), surfSize.height()),
@@ -3103,5 +2946,4 @@
             Assert(pVga->handle() != VBOXVHWA_SURFHANDLE_INVALID);
             Assert(pVga != surf); NOREF(pVga);
-//            Assert(mbVGASurfCreated);
             mDisplay.getVGA()->getComplexList()->add(surf);
 #ifdef DEBUGVHWASTRICT
@@ -3167,5 +3009,4 @@
         {
             mDisplay.removeOverlay(pList);
-//                Assert(mConstructingList != pList);
             if(pList == mConstructingList)
             {
@@ -3533,5 +3374,4 @@
     mRepaintNeeded = true;
 
-//    VBOXVHWA_CKEY_COLORSPACE
     if(pCmd->u.in.flags & VBOXVHWA_CKEY_DESTBLT)
     {
@@ -3946,5 +3786,4 @@
     VBOXQGL_LOAD_OVERLAYSTART(pSSM);
 
-//    char buf[VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_OVERLAY_UPDATE)];
     char *buf = new char[VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE)];
     memset(buf, 0, VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE));
@@ -3962,15 +3801,7 @@
     pUpdateOverlay->u.in.hSrcSurf = hSrc;
     pUpdateOverlay->u.in.hDstSurf = hDst;
-//    Assert(hDst == mDisplay.getVGA()->handle());
-//    VBoxVHWASurfaceBase *pDstSurf = handle2Surface(hDst);
-//    VBoxVHWASurfaceBase *pSrcSurf = handle2Surface(hSrc);
-//    Assert(pSrcSurf);
-//    Assert(pDstSurf);
-//    if(pSrcSurf && pDstSurf)
     {
         pUpdateOverlay->u.in.offDstSurface = VBOXVHWA_OFFSET64_VOID;
-//        vboxVRAMOffset(pDstSurf);
         pUpdateOverlay->u.in.offSrcSurface = VBOXVHWA_OFFSET64_VOID;
-//        vboxVRAMOffset(pSrcSurf);
 
         if(pUpdateOverlay->u.in.flags & VBOXVHWA_OVER_KEYDESTOVERRIDE)
@@ -3997,15 +3828,5 @@
 
         pCmdList->push_back(pCmd);
-//        vboxExecOnResize(&VBoxGLWidget::vboxDoVHWACmdAndFree, pCmd); AssertRC(rc);
-//        if(RT_SUCCESS(rc))
-//        {
-//            rc = pCmd->rc;
-//            AssertRC(rc);
-//        }
-    }
-//    else
-//    {
-//        rc = VERR_GENERAL_FAILURE;
-//    }
+    }
 
     VBOXQGL_LOAD_OVERLAYSTOP(pSSM);
@@ -4263,41 +4084,4 @@
 void VBoxGLWidget::vboxDoTestSurfaces(void* context)
 {
-//    uint32_t width = 103;
-//    uint32_t height = 47;
-//    uint32_t rgbBitCount = 32;
-//    uint32_t r = 0xff, g = 0xff00, b = 0xff0000;
-//    QRect dstRect(10, 50, width, height);
-//    QRect srcRect(0, 0, width, height);
-////    Assert(0);
-//    if(!pSurf1)
-//    {
-//
-////        pSurf1 = new VBoxVHWASurfaceBase(this, width, height,
-////                        VBoxVHWAColorFormat(rgbBitCount,
-////                                r,
-////                                g,
-////                                b),
-////                        NULL, NULL, NULL, NULL);
-//        pSurf1 = new VBoxVHWASurfaceBase(this, &QSize(width, height),
-////                        ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &QSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height)),
-//                        &mDisplay.getPrimary()->rect().size(),
-//                        VBoxVHWAColorFormat(rgbBitCount,
-//                                r,
-//                                g,
-//                                b),
-////                        pSrcBltCKey, pDstBltCKey, pSrcOverlayCKey, pDstOverlayCKey);
-//                        NULL, NULL, NULL, NULL);
-//
-//        pSurf1->init(mDisplay.getVGA(), NULL);
-//
-//        VBoxVHWASurfList *pConstructingList = new VBoxVHWASurfList();
-//        mDisplay.addOverlay(pConstructingList);
-//        pConstructingList->add(pSurf1);
-//        pConstructingList->setCurrentVisible(pSurf1);
-////        pSurf1->performDisplay();
-//    }
-//
-////    pDisplay->blt(&dstRect, pSurf1, &srcRect, NULL, NULL);
-////    pDisplay->performDisplay();
     if(g_iCur >= RT_ELEMENTS(g_apSurf))
         g_iCur = 0;
@@ -4418,17 +4202,4 @@
 }
 
-//void VBoxGLWidget::vboxDoPaint(void *pe)
-//{
-//    Q_UNUSED(pe);
-//
-//#ifdef VBOXQGL_DBG_SURF
-//    vboxDoTestSurfaces(NULL);
-//#endif
-////#ifdef VBOXQGL_PROF_BASE
-////    vboxDoUpdateRect(&((QPaintEvent*)pe)->rect());
-////#endif
-////    mDisplay.performDisplay();
-//}
-
 void VBoxGLWidget::vboxDoUpdateRect(const QRect * pRect)
 {
@@ -4438,7 +4209,4 @@
 void VBoxGLWidget::vboxDoResize(void *resize)
 {
-//    Assert(!format().accum());
-//    Assert(format().alpha());
-//    Assert(format().alphaBufferSize() == 8);
     VBOXQGLLOG(("format().blueBufferSize()(%d)\n", format().blueBufferSize()));
     VBOXQGLLOG(("format().greenBufferSize()(%d)\n", format().greenBufferSize()));
@@ -4450,18 +4218,13 @@
 #endif
 
-//    Assert(!format().depth());
     Assert(format().directRendering());
     Assert(format().doubleBuffer());
     Assert(format().hasOpenGL());
     VBOXQGLLOG(("hasOpenGLOverlays(%d), hasOverlay(%d)\n", format().hasOpenGLOverlays(), format().hasOverlay()));
-//    Assert(format().hasOpenGLOverlays());
-//    Assert(format().hasOverlay());
     Assert(format().plane() == 0);
     Assert(format().rgba());
     Assert(!format().sampleBuffers());
-//    Assert(!format().stencil());
     Assert(!format().stereo());
     VBOXQGLLOG(("swapInterval(%d)\n", format().swapInterval()));
-//    Assert(format().swapInterval() == 0);
 
 
@@ -4496,5 +4259,4 @@
         {
             case 32:
-//                format = VBoxVHWAColorFormat(bitsPerPixel, 0xff, 0xff00, 0xff0000);
                 break;
             case 24:
@@ -4502,13 +4264,5 @@
                 Assert(0);
 #endif
-//                format = VBoxVHWAColorFormat(bitsPerPixel, 0xff, 0xff00, 0xff0000);
-//                remind = true;
                 break;
-//            case 16:
-//                Assert(0);
-////                r = 0xf800;
-////                g = 0x7e0;
-////                b = 0x1f;
-//                break;
             case 8:
 #ifdef DEBUG_misha
@@ -4569,7 +4323,4 @@
         bytesPerLine = re->width()*bitsPerPixel/8;
         mPixelFormat = FramebufferPixelFormat_FOURCC_RGB;
-//        internalformat = 3;//GL_RGB;
-//        format = GL_BGRA_EXT;//GL_RGBA;
-//        type = GL_UNSIGNED_BYTE;
         mUsesGuestVRAM = false;
     }
@@ -4589,9 +4340,4 @@
             if(pConstructingList)
                 delete pConstructingList;
-    //
-    //            mDisplay.addOverlay(pConstructingList);
-    //            //            pConstructingList->add(pSurf1);
-    //            //            pConstructingList->setCurrentVisible(pSurf1);
-    //            ////            pConstructingList->setCurrentVisible(NULL);
         }
     }
@@ -4627,9 +4373,4 @@
         uint32_t width = 100;
         uint32_t height = 60;
-//        uint32_t rgbBitCount = 32;
-//        uint32_t r = 0xff, g = 0xff00, b = 0xff0000;
-//        QRect dstRect(150, 200, width, height);
-//        QRect srcRect(0, 0, 720, 480);
-    //    Assert(0);
 
         for(int i = 0; i < RT_ELEMENTS(g_apSurf); i++)
@@ -4658,28 +4399,11 @@
             }
             pSurf1->updatedMem(&QRect(0,0,width, height));
-//            VBOXQGL_CHECKERR(
-//                    vboxglActiveTexture(GL_TEXTURE0);
-//                );
 
             VBoxVHWASurfList *pConstructingList = new VBoxVHWASurfList();
             mDisplay.addOverlay(pConstructingList);
             pConstructingList->add(pSurf1);
-//            pConstructingList->setCurrentVisible(pSurf1);
-//            pConstructingList->setCurrentVisible(NULL);
             g_apSurf[i] = pSurf1;
 
-//            VBoxVHWAGlProgramVHWA * pProgram = vboxVHWAGetGlProgramMngr()->getProgram(true, false, &pSurf1->colorFormat(), &pDisplay->colorFormat());
-//            pProgram->start();
-//            pProgram->setSrcTexImgWidth(pSurf1->texRect().width());
-//            pProgram->stop();
-        }
-//        else
-//        {
-//            VBoxVHWASurfList *pConstructingList = pSurf1->getComplexList();
-//            mDisplay.addOverlay(pConstructingList);
-//            pConstructingList->add(pSurf1);
-//            pConstructingList->setCurrentVisible(pSurf1);
-////            pConstructingList->setCurrentVisible(NULL);
-//        }
+        }
 
         VBOXVHWACMD_SURF_OVERLAY_UPDATE updateCmd;
@@ -4722,7 +4446,4 @@
         mOnResizeCmdList.clear();
     }
-
-
-//    mDisplay.performDisplay();
 
     if (remind)
@@ -5033,5 +4754,5 @@
         default:
             break;
-    }//    Assert(0);
+    }
     /* indicate that we process and complete the command asynchronously */
     pCmd->Flags |= VBOXVHWACMD_FLAG_HG_ASYNCH;
@@ -5083,18 +4804,4 @@
 }
 
-//VBOXFBOVERLAY_RESUT VBoxQGLOverlay::onPaintEvent (const QPaintEvent *pe, QRect *pRect)
-//{
-//    Q_UNUSED(pe);
-//    Q_UNUSED(pRect);
-//
-////    if(mOverlayWidgetVisible && !mProcessingCommands)
-////    {
-////        Assert(!mGlCurrent);
-////        vboxDoCheckUpdateViewport();
-////        vboxOpExit();
-////    }
-//    return VBOXFBOVERLAY_UNTOUCHED;
-//}
-
 void VBoxQGLOverlay::onResizeEvent (const VBoxResizeEvent *re)
 {
@@ -5160,23 +4867,4 @@
     display.CompleteVHWACommand((BYTE*)cmd);
 }
-
-//void VBoxQGLOverlay::vboxDoUpdateRect(const QRect * pRect)
-//{
-//    if(mGlOn)
-//    {
-//        makeCurrent();
-//        mpOverlayWidget->vboxDoUpdateRect(pRect);
-//        vboxOpExit();
-//    }
-//
-//    mView->viewport()->repaint (pRect->x() - mView->contentsX(),
-//            pRect->y() - mView->contentsY(),
-//            pRect->width(), pRect->height());
-//
-//    /* translate to widget coords
-//     * @todo: may eliminate this */
-////    QPaintEvent pe(pRect->translated(-mView->contentsX(), -mView->contentsY()));
-////    VBoxQImageFrameBuffer::paintEvent (&pe);
-//}
 
 bool VBoxQGLOverlay::vboxSynchGl()
@@ -5285,16 +4973,4 @@
 }
 
-//void VBoxQGLOverlayFrameBuffer::vboxUpdateOverlayPosition(const QPoint & pos)
-//{
-////    makeCurrent();
-//
-//    mpOverlayWidget->move(pos);
-//
-////    /* */
-////    QRect rect = mpOverlayWidget->vboxViewport();
-////    rect.moveTo(pos);
-////    mpOverlayWidget->vboxDoUpdateViewport(rect);
-//}
-
 void VBoxQGLOverlay::vboxCheckUpdateOverlay(const QRect & rect)
 {
@@ -5321,8 +4997,4 @@
         mGlCurrent = false;
     }
-
-//    mpOverlayWidget->vboxDoUpdateViewport(rect);
-//
-//    vboxShowOverlay(show);
 }
 
@@ -5509,17 +5181,9 @@
 int VBoxQGLOverlay::vhwaLoadExec(struct SSMHANDLE * pSSM, uint32_t u32Version)
 {
-//    bool bTmp;
-//    int rc = SSMR3GetBool(pSSM, &bTmp /*&mGlOn*/);         AssertRC(rc);
-//    rc = SSMR3GetBool(pSSM, &bTmp /*&mOverlayVisible*/);         AssertRC(rc);
-//    if(RT_SUCCESS(rc))
     return VBoxGLWidget::vhwaLoadExec(&mOnResizeCmdList, pSSM, u32Version);
-//    return rc;
 }
 
 void VBoxQGLOverlay::vhwaSaveExec(struct SSMHANDLE * pSSM)
 {
-//    int rc = SSMR3PutBool(pSSM, mGlOn);         AssertRC(rc);
-//    rc = SSMR3PutBool(pSSM, mOverlayVisible);         AssertRC(rc);
-//
     if(mpOverlayWidget)
         mpOverlayWidget->vhwaSaveExec(pSSM);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h	(revision 25263)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h	(revision 25264)
@@ -833,5 +833,4 @@
             mPrimary.setCurrentVisible(pVga);
         }
-//        mSurfPrimary = pVga;
         mOverlays.clear();
         return old;
@@ -1178,5 +1177,4 @@
     void vboxDoResize(void *re);
 
-//    void vboxPaintEvent (QPaintEvent *pe) {vboxPerformGLOp(&VBoxGLWidget::vboxDoPaint, pe); }
     void vboxResizeEvent (class VBoxResizeEvent *re) {vboxPerformGLOp(&VBoxGLWidget::vboxDoResize, re); }
 
@@ -1202,6 +1200,4 @@
     bool performDisplayAndSwap(bool bForce)
     {
-//    	VBOXQGLLOG_METHODTIME("t:");
-
     	bForce = mDisplay.performDisplay(bForce | mRepaintNeeded);
         if(bForce)
@@ -1236,8 +1232,6 @@
         }
         VBOXQGLLOG(("paintGL\n"));
-//        else
-//        {
-            mDisplay.performDisplay(true);
-//        }
+
+        mDisplay.performDisplay(true);
     }
 
@@ -1247,5 +1241,4 @@
     static void setupMatricies(const QSize &display);
     static void adjustViewport(const QSize &display, const QRect &viewport);
-//    void vboxDoPaint(void *rec);
 
 
@@ -1293,8 +1286,4 @@
     }
 
-//    /* posts op to UI thread */
-//    int vboxExecOpSynch(PFNVBOXQGLOP pfn, void* pContext);
-//    void vboxExecOnResize(PFNVBOXQGLOP pfn, void* pContext);
-
     void vboxDoProcessVHWACommands(void *pContext);
 
@@ -1318,5 +1307,4 @@
     bool mRepaintNeeded;
 
-//    bool   mbVGASurfCreated;
     QRect mViewport;
 
@@ -1338,11 +1326,4 @@
 };
 
-
-//typedef enum
-//{
-//    VBOXFBOVERLAY_DONE = 1,
-//    VBOXFBOVERLAY_MODIFIED,
-//    VBOXFBOVERLAY_UNTOUCHED
-//} VBOXFBOVERLAY_RESUT;
 
 class VBoxQGLOverlay
@@ -1446,11 +1427,4 @@
     }
 
-//    void vboxOpExit()
-//    {
-//        performDisplayOverlay();
-//        mGlCurrent = false;
-//    }
-
-
     void vboxSetGlOn(bool on);
     bool vboxGetGlOn() { return mGlOn; }
@@ -1461,5 +1435,4 @@
     void vboxDoVHWACmd(void *cmd);
     void addMainDirtyRect(const QRect & aRect);
-//    void vboxUpdateOverlayPosition(const QPoint & pos);
     void vboxCheckUpdateOverlay(const QRect & rect);
     VBoxVHWACommandElement * processCmdList(VBoxVHWACommandElement * pCmd);
@@ -1540,23 +1513,4 @@
     }
 
-//    void paintEvent (QPaintEvent *pe)
-//    {
-//        QRect rect;
-//        VBOXFBOVERLAY_RESUT res = mOverlay.onPaintEvent(pe, &rect);
-//        switch(res)
-//        {
-//            case VBOXFBOVERLAY_MODIFIED:
-//            {
-//                QPaintEvent modified(rect);
-//                T::paintEvent(&modified);
-//            } break;
-//            case VBOXFBOVERLAY_UNTOUCHED:
-//                T::paintEvent(pe);
-//                break;
-//            default:
-//                break;
-//        }
-//    }
-
     void resizeEvent (VBoxResizeEvent *re)
     {
