Changeset 25264 in vbox
- Timestamp:
- Dec 9, 2009 10:26:39 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 55790
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r25257 r25264 908 908 mShaderCConvApplyAYUV(":/cconvApplyAYUV.c", GL_FRAGMENT_SHADER), 909 909 mShaderCConvAYUV(":/cconvAYUV.c", GL_FRAGMENT_SHADER), 910 // mShaderCConvAYUVVoid(":/cconvAYUV_void.c", GL_FRAGMENT_SHADER),911 910 mShaderCConvBGR(":/cconvBGR.c", GL_FRAGMENT_SHADER), 912 // mShaderCConvBGRVoid(":/cconvBGR_void.c", GL_FRAGMENT_SHADER),913 911 mShaderCConvUYVY(":/cconvUYVY.c", GL_FRAGMENT_SHADER), 914 // mShaderCConvUYVYVoid(":/cconvUYVY_void.c", GL_FRAGMENT_SHADER),915 912 mShaderCConvYUY2(":/cconvYUY2.c", GL_FRAGMENT_SHADER), 916 // mShaderCConvYUY2Void(":/cconvYUY2_void.c", GL_FRAGMENT_SHADER),917 913 mShaderCConvYV12(":/cconvYV12.c", GL_FRAGMENT_SHADER), 918 // mShaderCConvYV12Void(":/cconvYV12_void.c", GL_FRAGMENT_SHADER),919 914 mShaderSplitBGRA(":/splitBGRA.c", GL_FRAGMENT_SHADER), 920 915 mShaderCKeyDst(":/ckeyDst.c", GL_FRAGMENT_SHADER), 921 916 mShaderCKeyDst2(":/ckeyDst2.c", GL_FRAGMENT_SHADER), 922 // mShaderCKeyDstVoid(":/ckeyDst_void.c", GL_FRAGMENT_SHADER),923 // mShaderCKeySrc;924 // mShaderCKeySrcVoid;925 917 mShaderMainOverlay(":/mainOverlay.c", GL_FRAGMENT_SHADER), 926 918 mShaderMainOverlayNoCKey(":/mainOverlayNoCKey.c", GL_FRAGMENT_SHADER), … … 942 934 VBoxVHWAGlProgramVHWA * createProgram(uint32_t type, uint32_t fourcc); 943 935 944 // int startProgram(VBoxVHWAGlProgramVHWA * pProgram) {mCurrentProgram = pProgram; return pProgram->start();}945 946 936 typedef std::list <VBoxVHWAGlProgramVHWA*> ProgramList; 947 937 948 // VBoxVHWAGlProgramVHWA * mCurrentProgram;949 938 ProgramList mPrograms; 950 939 … … 952 941 953 942 VBoxVHWAGlShaderComponent mShaderCConvAYUV; 954 // VBoxVHWAGlShaderComponent mShaderCConvAYUVVoid;955 943 VBoxVHWAGlShaderComponent mShaderCConvBGR; 956 // VBoxVHWAGlShaderComponent mShaderCConvBGRVoid;957 944 VBoxVHWAGlShaderComponent mShaderCConvUYVY; 958 // VBoxVHWAGlShaderComponent mShaderCConvUYVYVoid;959 945 VBoxVHWAGlShaderComponent mShaderCConvYUY2; 960 // VBoxVHWAGlShaderComponent mShaderCConvYUY2Void;961 946 VBoxVHWAGlShaderComponent mShaderCConvYV12; 962 // VBoxVHWAGlShaderComponent mShaderCConvYV12Void;963 947 VBoxVHWAGlShaderComponent mShaderSplitBGRA; 964 948 … … 967 951 /* expected the dst surface texture to be bound to the 2-nd tex unit */ 968 952 VBoxVHWAGlShaderComponent mShaderCKeyDst2; 969 // VBoxVHWAGlShaderComponent mShaderCKeyDstVoid;970 // VBoxVHWAGlShaderComponent mShaderCKeySrc;971 // VBoxVHWAGlShaderComponent mShaderCKeySrcVoid;972 973 953 VBoxVHWAGlShaderComponent mShaderMainOverlay; 974 954 VBoxVHWAGlShaderComponent mShaderMainOverlayNoCKey; … … 1001 981 } 1002 982 } 1003 // ensure we don't have empty functions /* paranoya for for ATI on linux */1004 // else1005 // {1006 // apShaders[cShaders++] = &mShaderCKeyDstVoid;1007 // }1008 983 1009 984 if(type & VBOXVHWA_PROGRAM_SRCCOLORKEY) … … 1029 1004 else if(fourcc == FOURCC_YV12) 1030 1005 { 1031 // apShaders[cShaders++] = &mShaderSplitBGRA;1032 1006 apShaders[cShaders++] = &mShaderCConvYV12; 1033 1007 bFound = true; … … 1115 1089 VBoxVHWAGlProgramVHWA * VBoxVHWAGlProgramMngr::searchProgram(uint32_t type, uint32_t fourcc, bool bCreate) 1116 1090 { 1117 // if(mCurrentProgram && mCurrentProgram->matches(type))1118 // return mCurrentProgram;1119 1120 1091 for (ProgramList::const_iterator it = mPrograms.begin(); 1121 1092 it != mPrograms.end(); ++ it) … … 1142 1113 { 1143 1114 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));1148 1115 pFormat->pixel2Normalized(pCKey->lower(), &r, &g, &b); 1149 1116 int rcL = bDst ? pProgram->setDstCKeyLowerRange(r, g, b) : pProgram->setSrcCKeyLowerRange(r, g, b); 1150 1117 Assert(RT_SUCCESS(rcL)); 1151 // pProgram->stop();1152 1118 1153 1119 return RT_SUCCESS(rcL) /*&& RT_SUCCESS(rcU)*/ ? VINF_SUCCESS: VERR_GENERAL_FAILURE; … … 1187 1153 #endif 1188 1154 1189 // makeCurrent();1190 // updateTexture(&mRect);1191 1155 mUpdateMem2TexRect.set(mRect); 1192 1156 Assert(!mUpdateMem2TexRect.isClear()); 1193 1157 Assert(mRect.contains(mUpdateMem2TexRect.rect())); 1194 // mUpdateTex2FBRect.clear();1195 // Assert(mUpdateTex2FBRect.isClear());1196 1158 } 1197 1159 … … 1200 1162 VBOXQGLLOG(("globalInit\n")); 1201 1163 1202 // glEnable(GL_TEXTURE_2D);1203 1164 glEnable(GL_TEXTURE_RECTANGLE); 1204 1165 glDisable(GL_DEPTH_TEST); … … 1210 1171 glPixelStorei(GL_PACK_ALIGNMENT, 1); 1211 1172 ); 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 // );1250 1173 } 1251 1174 … … 1315 1238 setRectValues(aTargRect, aSrcRect); 1316 1239 setVisibleRectValues(aVisTargRect); 1317 // mTargSize = QRect(0, 0, aTargSize->width(), aTargSize->height());1318 1319 // mBytesPerPixel = calcBytesPerPixel(mColorFormat.format(), mColorFormat.type());1320 // mBytesPerLine = mRect.width() * mBytesPerPixel;1321 1240 } 1322 1241 … … 1397 1316 void VBoxVHWASurfaceBase::uninit() 1398 1317 { 1399 // mState->makeCurrent(this);1400 1401 1318 deleteDisplay(); 1402 1319 … … 1729 1646 } 1730 1647 1731 #if 01732 mUpdateTex2FBRect.add(mUpdateMem2TexRect);1733 Assert(!mUpdateTex2FBRect.isClear());1734 Assert(mRect.contains(mUpdateTex2FBRect.rect()));1735 #endif1736 1648 mUpdateMem2TexRect.clear(); 1737 1649 Assert(mUpdateMem2TexRect.isClear()); 1738 //#ifdef DEBUG 1739 // VBOXPRINTDIF(dbgTime, ("texMem:")); 1740 //#endif 1650 1741 1651 return true; 1742 1652 } … … 1765 1675 if(buf) 1766 1676 { 1767 // updateBuffer((uchar*)buf, pRect);1768 1677 memcpy(buf, mAddress, memSize()); 1769 1678 … … 1947 1856 uint32_t t0height = mpTex[0]->rect().height(); 1948 1857 1949 // VBOXQGL_CHECKERR(1950 1858 glBegin(GL_QUADS); 1951 1859 for(int i = 0; i < cSrcTex; i++) 1952 1860 { 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()));1955 1861 mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx1/(t0width/mpTex[i]->texRect().width()), ty1/(t0height/mpTex[i]->rect().height())); 1956 1862 } … … 1958 1864 for(int i = 0; i < cSrcTex; i++) 1959 1865 { 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()));1962 1866 mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx1/(t0width/mpTex[i]->texRect().width()), ty2/(t0height/mpTex[i]->rect().height())); 1963 1867 } … … 1965 1869 for(int i = 0; i < cSrcTex; i++) 1966 1870 { 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()));1969 1871 mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx2/(t0width/mpTex[i]->texRect().width()), ty2/(t0height/mpTex[i]->rect().height())); 1970 1872 … … 1973 1875 for(int i = 0; i < cSrcTex; i++) 1974 1876 { 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()));1977 1877 mpTex[i]->multiTexCoord(GL_TEXTURE0 + i, tx2/(t0width/mpTex[i]->texRect().width()), ty1/(t0height/mpTex[i]->rect().height())); 1978 1878 } 1979 1879 glVertex2i(bx2, by1); 1980 1880 glEnd(); 1981 // );1982 1881 } 1983 1882 … … 1992 1891 uint32_t t0height = mpTex[0]->rect().height(); 1993 1892 1994 // VBOXQGL_CHECKERR(1995 1893 glBegin(GL_QUADS); 1996 1894 … … 2024 1922 2025 1923 glEnd(); 2026 // );2027 1924 2028 1925 } … … 2046 1943 VBOXQGLLOG_QRECT("rect: ", pRect ? pRect : &mRect, "\n"); 2047 1944 VBOXQGLLOG_METHODTIME("time "); 2048 // if(!(flags & VBOXVHWA_LOCK_DISCARDCONTENTS))2049 // {2050 // synchMem(pRect);2051 // }2052 1945 2053 1946 mUpdateMem2TexRect.add(pRect ? *pRect : mRect); … … 2134 2027 } 2135 2028 2136 void VBoxVHWASurfaceBase::deleteDisplay( 2137 // bool bInverted 2138 ) 2029 void VBoxVHWASurfaceBase::deleteDisplay() 2139 2030 { 2140 2031 if(mVisibleDisplayInitialized) … … 2175 2066 if(bProgram) 2176 2067 { 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 2187 2068 if(bBindDst) 2188 2069 { … … 2219 2100 else 2220 2101 { 2221 // vboxglActiveTexture(GL_TEXTURE0);2222 2102 mpTex[0]->bind(); 2223 // VBOXQGLLOG(("binding (primary??) texture: %d\n", mpTex[0]->texture()));2224 2103 } 2225 2104 … … 2242 2121 } 2243 2122 } 2244 2245 // if(pProgram)2246 // {2247 // pProgram->stop();2248 // }2249 2123 } 2250 2124 … … 2394 2268 } 2395 2269 2396 //void VBoxVHWASurfaceBase::setVisibleTargetRect(const QRect & aRect)2397 //{2398 // Assert(mVisibleRect.contains(aRect));2399 // mVisibleRect = mSrcRect.intersected(aRect);2400 //}2401 2402 2270 bool VBoxVHWASurfaceBase::performDisplay(VBoxVHWASurfaceBase *pPrimary, bool bForce) 2403 2271 { … … 2453 2321 if(pProgram) 2454 2322 pProgram->stop(); 2455 2456 2457 // doDisplay(pPrimary, NULL, false);2458 2323 } 2459 2324 else … … 2658 2523 pFirst = pPipe->detachCmdList(pFirst, pLast); 2659 2524 } while(pFirst); 2660 2661 // mDisplay.performDisplay();2662 2525 } 2663 2526 … … 2904 2767 (pCmd->SurfInfo.PixelFormat.fourCC & 0xff000000) >> 24 2905 2768 )); 2906 //#ifdef DEBUG_misha2907 // Assert(0);2908 //#endif2909 2769 pCmd->u.out.ErrInfo = -1; 2910 2770 return VINF_SUCCESS; … … 2933 2793 if(mSurfHandleTable.get(handle)) 2934 2794 { 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; 2951 2797 } 2952 2798 } 2953 2799 2954 2800 VBoxVHWASurfaceBase *surf = NULL; 2955 // VBoxVHWAColorFormat *pFormat = NULL, Format;2956 2801 bool bNoPBO = false; 2957 2802 bool bPrimary = false; … … 3039 2884 QRect primaryRect = mDisplay.getPrimary()->rect(); 3040 2885 surf = new VBoxVHWASurfaceBase(this, surfSize, 3041 // ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &surfSize),3042 2886 primaryRect, 3043 2887 QRect(0, 0, surfSize.width(), surfSize.height()), … … 3057 2901 VBoxVHWAColorFormat format(pCmd->SurfInfo.PixelFormat.fourCC); 3058 2902 surf = new VBoxVHWASurfaceBase(this, surfSize, 3059 // ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &QSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height)),3060 2903 primaryRect, 3061 2904 QRect(0, 0, surfSize.width(), surfSize.height()), … … 3103 2946 Assert(pVga->handle() != VBOXVHWA_SURFHANDLE_INVALID); 3104 2947 Assert(pVga != surf); NOREF(pVga); 3105 // Assert(mbVGASurfCreated);3106 2948 mDisplay.getVGA()->getComplexList()->add(surf); 3107 2949 #ifdef DEBUGVHWASTRICT … … 3167 3009 { 3168 3010 mDisplay.removeOverlay(pList); 3169 // Assert(mConstructingList != pList);3170 3011 if(pList == mConstructingList) 3171 3012 { … … 3533 3374 mRepaintNeeded = true; 3534 3375 3535 // VBOXVHWA_CKEY_COLORSPACE3536 3376 if(pCmd->u.in.flags & VBOXVHWA_CKEY_DESTBLT) 3537 3377 { … … 3946 3786 VBOXQGL_LOAD_OVERLAYSTART(pSSM); 3947 3787 3948 // char buf[VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_OVERLAY_UPDATE)];3949 3788 char *buf = new char[VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE)]; 3950 3789 memset(buf, 0, VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE)); … … 3962 3801 pUpdateOverlay->u.in.hSrcSurf = hSrc; 3963 3802 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)3970 3803 { 3971 3804 pUpdateOverlay->u.in.offDstSurface = VBOXVHWA_OFFSET64_VOID; 3972 // vboxVRAMOffset(pDstSurf);3973 3805 pUpdateOverlay->u.in.offSrcSurface = VBOXVHWA_OFFSET64_VOID; 3974 // vboxVRAMOffset(pSrcSurf);3975 3806 3976 3807 if(pUpdateOverlay->u.in.flags & VBOXVHWA_OVER_KEYDESTOVERRIDE) … … 3997 3828 3998 3829 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 } 4010 3831 4011 3832 VBOXQGL_LOAD_OVERLAYSTOP(pSSM); … … 4263 4084 void VBoxGLWidget::vboxDoTestSurfaces(void* context) 4264 4085 { 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();4302 4086 if(g_iCur >= RT_ELEMENTS(g_apSurf)) 4303 4087 g_iCur = 0; … … 4418 4202 } 4419 4203 4420 //void VBoxGLWidget::vboxDoPaint(void *pe)4421 //{4422 // Q_UNUSED(pe);4423 //4424 //#ifdef VBOXQGL_DBG_SURF4425 // vboxDoTestSurfaces(NULL);4426 //#endif4427 ////#ifdef VBOXQGL_PROF_BASE4428 //// vboxDoUpdateRect(&((QPaintEvent*)pe)->rect());4429 ////#endif4430 //// mDisplay.performDisplay();4431 //}4432 4433 4204 void VBoxGLWidget::vboxDoUpdateRect(const QRect * pRect) 4434 4205 { … … 4438 4209 void VBoxGLWidget::vboxDoResize(void *resize) 4439 4210 { 4440 // Assert(!format().accum());4441 // Assert(format().alpha());4442 // Assert(format().alphaBufferSize() == 8);4443 4211 VBOXQGLLOG(("format().blueBufferSize()(%d)\n", format().blueBufferSize())); 4444 4212 VBOXQGLLOG(("format().greenBufferSize()(%d)\n", format().greenBufferSize())); … … 4450 4218 #endif 4451 4219 4452 // Assert(!format().depth());4453 4220 Assert(format().directRendering()); 4454 4221 Assert(format().doubleBuffer()); 4455 4222 Assert(format().hasOpenGL()); 4456 4223 VBOXQGLLOG(("hasOpenGLOverlays(%d), hasOverlay(%d)\n", format().hasOpenGLOverlays(), format().hasOverlay())); 4457 // Assert(format().hasOpenGLOverlays());4458 // Assert(format().hasOverlay());4459 4224 Assert(format().plane() == 0); 4460 4225 Assert(format().rgba()); 4461 4226 Assert(!format().sampleBuffers()); 4462 // Assert(!format().stencil());4463 4227 Assert(!format().stereo()); 4464 4228 VBOXQGLLOG(("swapInterval(%d)\n", format().swapInterval())); 4465 // Assert(format().swapInterval() == 0);4466 4229 4467 4230 … … 4496 4259 { 4497 4260 case 32: 4498 // format = VBoxVHWAColorFormat(bitsPerPixel, 0xff, 0xff00, 0xff0000);4499 4261 break; 4500 4262 case 24: … … 4502 4264 Assert(0); 4503 4265 #endif 4504 // format = VBoxVHWAColorFormat(bitsPerPixel, 0xff, 0xff00, 0xff0000);4505 // remind = true;4506 4266 break; 4507 // case 16:4508 // Assert(0);4509 //// r = 0xf800;4510 //// g = 0x7e0;4511 //// b = 0x1f;4512 // break;4513 4267 case 8: 4514 4268 #ifdef DEBUG_misha … … 4569 4323 bytesPerLine = re->width()*bitsPerPixel/8; 4570 4324 mPixelFormat = FramebufferPixelFormat_FOURCC_RGB; 4571 // internalformat = 3;//GL_RGB;4572 // format = GL_BGRA_EXT;//GL_RGBA;4573 // type = GL_UNSIGNED_BYTE;4574 4325 mUsesGuestVRAM = false; 4575 4326 } … … 4589 4340 if(pConstructingList) 4590 4341 delete pConstructingList; 4591 //4592 // mDisplay.addOverlay(pConstructingList);4593 // // pConstructingList->add(pSurf1);4594 // // pConstructingList->setCurrentVisible(pSurf1);4595 // //// pConstructingList->setCurrentVisible(NULL);4596 4342 } 4597 4343 } … … 4627 4373 uint32_t width = 100; 4628 4374 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);4634 4375 4635 4376 for(int i = 0; i < RT_ELEMENTS(g_apSurf); i++) … … 4658 4399 } 4659 4400 pSurf1->updatedMem(&QRect(0,0,width, height)); 4660 // VBOXQGL_CHECKERR(4661 // vboxglActiveTexture(GL_TEXTURE0);4662 // );4663 4401 4664 4402 VBoxVHWASurfList *pConstructingList = new VBoxVHWASurfList(); 4665 4403 mDisplay.addOverlay(pConstructingList); 4666 4404 pConstructingList->add(pSurf1); 4667 // pConstructingList->setCurrentVisible(pSurf1);4668 // pConstructingList->setCurrentVisible(NULL);4669 4405 g_apSurf[i] = pSurf1; 4670 4406 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 } 4684 4408 4685 4409 VBOXVHWACMD_SURF_OVERLAY_UPDATE updateCmd; … … 4722 4446 mOnResizeCmdList.clear(); 4723 4447 } 4724 4725 4726 // mDisplay.performDisplay();4727 4448 4728 4449 if (remind) … … 5033 4754 default: 5034 4755 break; 5035 } // Assert(0);4756 } 5036 4757 /* indicate that we process and complete the command asynchronously */ 5037 4758 pCmd->Flags |= VBOXVHWACMD_FLAG_HG_ASYNCH; … … 5083 4804 } 5084 4805 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 5099 4806 void VBoxQGLOverlay::onResizeEvent (const VBoxResizeEvent *re) 5100 4807 { … … 5160 4867 display.CompleteVHWACommand((BYTE*)cmd); 5161 4868 } 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 coords5177 // * @todo: may eliminate this */5178 //// QPaintEvent pe(pRect->translated(-mView->contentsX(), -mView->contentsY()));5179 //// VBoxQImageFrameBuffer::paintEvent (&pe);5180 //}5181 4869 5182 4870 bool VBoxQGLOverlay::vboxSynchGl() … … 5285 4973 } 5286 4974 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 5299 4975 void VBoxQGLOverlay::vboxCheckUpdateOverlay(const QRect & rect) 5300 4976 { … … 5321 4997 mGlCurrent = false; 5322 4998 } 5323 5324 // mpOverlayWidget->vboxDoUpdateViewport(rect);5325 //5326 // vboxShowOverlay(show);5327 4999 } 5328 5000 … … 5509 5181 int VBoxQGLOverlay::vhwaLoadExec(struct SSMHANDLE * pSSM, uint32_t u32Version) 5510 5182 { 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))5515 5183 return VBoxGLWidget::vhwaLoadExec(&mOnResizeCmdList, pSSM, u32Version); 5516 // return rc;5517 5184 } 5518 5185 5519 5186 void VBoxQGLOverlay::vhwaSaveExec(struct SSMHANDLE * pSSM) 5520 5187 { 5521 // int rc = SSMR3PutBool(pSSM, mGlOn); AssertRC(rc);5522 // rc = SSMR3PutBool(pSSM, mOverlayVisible); AssertRC(rc);5523 //5524 5188 if(mpOverlayWidget) 5525 5189 mpOverlayWidget->vhwaSaveExec(pSSM); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r25257 r25264 833 833 mPrimary.setCurrentVisible(pVga); 834 834 } 835 // mSurfPrimary = pVga;836 835 mOverlays.clear(); 837 836 return old; … … 1178 1177 void vboxDoResize(void *re); 1179 1178 1180 // void vboxPaintEvent (QPaintEvent *pe) {vboxPerformGLOp(&VBoxGLWidget::vboxDoPaint, pe); }1181 1179 void vboxResizeEvent (class VBoxResizeEvent *re) {vboxPerformGLOp(&VBoxGLWidget::vboxDoResize, re); } 1182 1180 … … 1202 1200 bool performDisplayAndSwap(bool bForce) 1203 1201 { 1204 // VBOXQGLLOG_METHODTIME("t:");1205 1206 1202 bForce = mDisplay.performDisplay(bForce | mRepaintNeeded); 1207 1203 if(bForce) … … 1236 1232 } 1237 1233 VBOXQGLLOG(("paintGL\n")); 1238 // else 1239 // { 1240 mDisplay.performDisplay(true); 1241 // } 1234 1235 mDisplay.performDisplay(true); 1242 1236 } 1243 1237 … … 1247 1241 static void setupMatricies(const QSize &display); 1248 1242 static void adjustViewport(const QSize &display, const QRect &viewport); 1249 // void vboxDoPaint(void *rec);1250 1243 1251 1244 … … 1293 1286 } 1294 1287 1295 // /* posts op to UI thread */1296 // int vboxExecOpSynch(PFNVBOXQGLOP pfn, void* pContext);1297 // void vboxExecOnResize(PFNVBOXQGLOP pfn, void* pContext);1298 1299 1288 void vboxDoProcessVHWACommands(void *pContext); 1300 1289 … … 1318 1307 bool mRepaintNeeded; 1319 1308 1320 // bool mbVGASurfCreated;1321 1309 QRect mViewport; 1322 1310 … … 1338 1326 }; 1339 1327 1340 1341 //typedef enum1342 //{1343 // VBOXFBOVERLAY_DONE = 1,1344 // VBOXFBOVERLAY_MODIFIED,1345 // VBOXFBOVERLAY_UNTOUCHED1346 //} VBOXFBOVERLAY_RESUT;1347 1328 1348 1329 class VBoxQGLOverlay … … 1446 1427 } 1447 1428 1448 // void vboxOpExit()1449 // {1450 // performDisplayOverlay();1451 // mGlCurrent = false;1452 // }1453 1454 1455 1429 void vboxSetGlOn(bool on); 1456 1430 bool vboxGetGlOn() { return mGlOn; } … … 1461 1435 void vboxDoVHWACmd(void *cmd); 1462 1436 void addMainDirtyRect(const QRect & aRect); 1463 // void vboxUpdateOverlayPosition(const QPoint & pos);1464 1437 void vboxCheckUpdateOverlay(const QRect & rect); 1465 1438 VBoxVHWACommandElement * processCmdList(VBoxVHWACommandElement * pCmd); … … 1540 1513 } 1541 1514 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 1561 1515 void resizeEvent (VBoxResizeEvent *re) 1562 1516 {
Note:
See TracChangeset
for help on using the changeset viewer.