Changeset 25583 in vbox
- Timestamp:
- Dec 25, 2009 11:10:46 AM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r25526 r25583 782 782 { 783 783 case VBoxDefs::QGLMode: 784 pViewport = new VBoxGLWidget (this, this );784 pViewport = new VBoxGLWidget (this, this, NULL); 785 785 break; 786 786 default: … … 839 839 mFrameBuf = 840 840 #ifdef VBOX_WITH_VIDEOHWACCEL 841 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQImageFrameBuffer> (this) :841 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQImageFrameBuffer> (this, &mainWnd->session()) : 842 842 #endif 843 843 new VBoxQImageFrameBuffer (this); … … 856 856 mFrameBuf = 857 857 #if defined(VBOX_WITH_VIDEOHWACCEL) && defined(DEBUG_misha) /* not tested yet */ 858 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxSDLFrameBuffer> (this ) :858 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxSDLFrameBuffer> (this, &mainWnd->session()) : 859 859 #endif 860 860 new VBoxSDLFrameBuffer (this); … … 879 879 mFrameBuf = 880 880 #ifdef VBOX_WITH_VIDEOHWACCEL 881 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQuartz2DFrameBuffer> (this ) :881 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQuartz2DFrameBuffer> (this, &mainWnd->session()) : 882 882 #endif 883 883 new VBoxQuartz2DFrameBuffer (this); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.h
r25505 r25583 115 115 void onDisplayResize (ulong aHeight, ulong aWidth); 116 116 117 #ifdef VBOX_WITH_VIDEOHWACCEL 118 /* used for obtaining the extradata settings */ 119 CSession &session() { return mSession; } 120 #endif 117 121 signals: 118 122 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r25526 r25583 1188 1188 VBoxVHWAColorKey * pSrcBltCKey, VBoxVHWAColorKey * pDstBltCKey, 1189 1189 VBoxVHWAColorKey * pSrcOverlayCKey, VBoxVHWAColorKey * pDstOverlayCKey, 1190 #ifdef VBOXVHWA_USE_TEXGROUP 1191 uint32_t cBackTex, 1192 #endif 1193 bool bVGA) : 1190 VBOXVHWAIMG_TYPE aImgFlags) : 1194 1191 mRect(0,0,aSize.width(),aSize.height()), 1195 1192 mAddress(NULL), … … 1222 1219 resetDefaultSrcOverlayCKey(); 1223 1220 1224 mImage = vboxVHWAImageCreate(QRect(0,0,aSize.width(),aSize.height()), aColorFormat, getGlProgramMngr(), bVGA ? 0 : (VBOXVHWAIMG_PBO | VBOXVHWAIMG_PBOIMG | VBOXVHWAIMG_FBO));1221 mImage = vboxVHWAImageCreate(QRect(0,0,aSize.width(),aSize.height()), aColorFormat, getGlProgramMngr(), aImgFlags); 1225 1222 1226 1223 setRectValues(aTargRect, aSrcRect); … … 1919 1916 }; 1920 1917 1921 VBoxGLWidget::VBoxGLWidget (VBoxConsoleView *aView, QWidget *aParent )1918 VBoxGLWidget::VBoxGLWidget (VBoxConsoleView *aView, QWidget *aParent, VBoxVHWASettings *aSettings) 1922 1919 : QGLWidget (new VBoxGLContext(VBoxGLWidget::vboxGLFormat()), aParent), 1923 1920 mSurfHandleTable(128), /* 128 should be enough */ … … 1930 1927 mView(aView), 1931 1928 mConstructingList(NULL), 1932 mcRemaining2Contruct(0) 1929 mcRemaining2Contruct(0), 1930 mSettings(aSettings) 1933 1931 #ifdef VBOXVHWA_PROFILE_FPS 1934 1932 , … … 2255 2253 2256 2254 #ifdef VBOXVHWA_ALLOW_PRIMARY_AND_OVERLAY_ONLY 2257 if ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) == 0)2255 if ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) == 0) 2258 2256 { 2259 2257 #ifdef DEBUGVHWASTRICT 2260 Assert (0);2258 Assert (0); 2261 2259 #endif 2262 2260 pCmd->u.out.ErrInfo = -1; … … 2265 2263 #endif 2266 2264 2267 if (pCmd->u.in.bIsDifferentPixelFormat)2268 { 2269 if (!(pCmd->SurfInfo.flags & VBOXVHWA_SD_PIXELFORMAT))2270 { 2271 Assert (0);2265 if (pCmd->u.in.bIsDifferentPixelFormat) 2266 { 2267 if (!(pCmd->SurfInfo.flags & VBOXVHWA_SD_PIXELFORMAT)) 2268 { 2269 Assert (0); 2272 2270 pCmd->u.out.ErrInfo = -1; 2273 2271 return VINF_SUCCESS; 2274 2272 } 2275 2273 2276 if (pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_RGB)2277 { 2278 if (pCmd->SurfInfo.PixelFormat.c.rgbBitCount != 322274 if (pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_RGB) 2275 { 2276 if (pCmd->SurfInfo.PixelFormat.c.rgbBitCount != 32 2279 2277 || pCmd->SurfInfo.PixelFormat.c.rgbBitCount != 24) 2280 2278 { 2281 Assert (0);2279 Assert (0); 2282 2280 pCmd->u.out.ErrInfo = -1; 2283 2281 return VINF_SUCCESS; 2284 2282 } 2285 2283 } 2286 else if (pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_FOURCC)2284 else if (pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_FOURCC) 2287 2285 { 2288 2286 /* detect whether we support this format */ 2289 bool bFound = false; 2290 for(int i = 0; i < info.getFourccSupportedCount(); i++) 2287 bool bFound = mSettings->isSupported (info, pCmd->SurfInfo.PixelFormat.fourCC); 2288 2289 if (!bFound) 2291 2290 { 2292 if(info.getFourccSupportedList()[i] == pCmd->SurfInfo.PixelFormat.fourCC) 2293 { 2294 bFound = true; 2295 break; 2296 } 2297 } 2298 2299 if(!bFound) 2300 { 2301 VBOXQGLLOG(("!!unsupported fourcc!!!: %c%c%c%c\n", 2291 VBOXQGLLOG (("!!unsupported fourcc!!!: %c%c%c%c\n", 2302 2292 (pCmd->SurfInfo.PixelFormat.fourCC & 0x000000ff), 2303 2293 (pCmd->SurfInfo.PixelFormat.fourCC & 0x0000ff00) >> 8, … … 2311 2301 else 2312 2302 { 2313 Assert (0);2303 Assert (0); 2314 2304 pCmd->u.out.ErrInfo = -1; 2315 2305 return VINF_SUCCESS; … … 2321 2311 } 2322 2312 2323 int VBoxGLWidget::vhwaSurfaceCreate (struct _VBOXVHWACMD_SURF_CREATE *pCmd)2324 { 2325 VBOXQGLLOG_ENTER (("\n"));2313 int VBoxGLWidget::vhwaSurfaceCreate (struct _VBOXVHWACMD_SURF_CREATE *pCmd) 2314 { 2315 VBOXQGLLOG_ENTER (("\n")); 2326 2316 2327 2317 uint32_t handle = VBOXVHWA_SURFHANDLE_INVALID; … … 2413 2403 if(!surf) 2414 2404 { 2405 VBOXVHWAIMG_TYPE fFlags = 0; 2406 if(!bNoPBO) 2407 { 2408 fFlags |= VBOXVHWAIMG_PBO | VBOXVHWAIMG_PBOIMG; 2409 if(mSettings->isStretchLinearEnabled()) 2410 fFlags |= VBOXVHWAIMG_FBO; 2411 } 2412 2415 2413 if(pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_RGB) 2416 2414 { … … 2431 2429 0, 2432 2430 #endif 2433 bNoPBO);2431 fFlags); 2434 2432 } 2435 2433 else if(pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_FOURCC) … … 2449 2447 0, 2450 2448 #endif 2451 bNoPBO);2449 fFlags); 2452 2450 } 2453 2451 else … … 3000 2998 // pCmd->u.out.caps2 |= VBOXVHWA_CAPS2_COPYFOURCC; 3001 2999 3002 pCmd->u.out.numFourCC = info.getFourccSupportedCount();3000 pCmd->u.out.numFourCC = mSettings->getIntersection(info, 0, NULL); 3003 3001 } 3004 3002 } … … 3013 3011 3014 3012 const VBoxVHWAInfo & info = vboxVHWAGetSupportInfo(context()); 3015 3016 Assert(pCmd->numFourCC >= (uint32_t)info.getFourccSupportedCount()); 3017 if(pCmd->numFourCC < (uint32_t)info.getFourccSupportedCount()) 3013 uint32_t aFourcc[VBOXVHWA_NUMFOURCC]; 3014 int num = mSettings->getIntersection(info, VBOXVHWA_NUMFOURCC, aFourcc); 3015 Assert(pCmd->numFourCC >= (uint32_t)num); 3016 if(pCmd->numFourCC < (uint32_t)num) 3018 3017 return VERR_GENERAL_FAILURE; 3019 3018 3020 pCmd->numFourCC = (uint32_t)info.getFourccSupportedCount(); 3021 for(int i = 0; i < info.getFourccSupportedCount(); i++) 3022 { 3023 pCmd->FourCC[i] = info.getFourccSupportedList()[i]; 3024 } 3019 pCmd->numFourCC = (uint32_t)num; 3020 memcpy(pCmd->FourCC, aFourcc, num*sizeof(aFourcc[0])); 3025 3021 return VINF_SUCCESS; 3026 3022 } … … 3857 3853 0, 3858 3854 #endif 3859 true);3855 0); 3860 3856 pDisplay->init(NULL, mUsesGuestVRAM ? re->VRAM() : NULL); 3861 3857 mDisplay.setVGA(pDisplay); … … 3960 3956 } 3961 3957 3962 VBoxVHWAColorFormat::VBoxVHWAColorFormat (uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b) :3963 mWidthCompression (1),3964 mHeightCompression (1)3965 { 3966 init (bitsPerPixel, r, g, b);3967 } 3968 3969 VBoxVHWAColorFormat::VBoxVHWAColorFormat (uint32_t fourcc) :3970 mWidthCompression (1),3971 mHeightCompression (1)3972 { 3973 init (fourcc);3974 } 3975 3976 void VBoxVHWAColorFormat::init (uint32_t fourcc)3958 VBoxVHWAColorFormat::VBoxVHWAColorFormat (uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b) : 3959 mWidthCompression (1), 3960 mHeightCompression (1) 3961 { 3962 init (bitsPerPixel, r, g, b); 3963 } 3964 3965 VBoxVHWAColorFormat::VBoxVHWAColorFormat (uint32_t fourcc) : 3966 mWidthCompression (1), 3967 mHeightCompression (1) 3968 { 3969 init (fourcc); 3970 } 3971 3972 void VBoxVHWAColorFormat::init (uint32_t fourcc) 3977 3973 { 3978 3974 mDataFormat = fourcc; … … 3980 3976 mFormat = GL_BGRA_EXT;//GL_RGBA; 3981 3977 mType = GL_UNSIGNED_BYTE; 3982 mR = VBoxVHWAColorComponent (0xff);3983 mG = VBoxVHWAColorComponent (0xff);3984 mB = VBoxVHWAColorComponent (0xff);3985 mA = VBoxVHWAColorComponent (0xff);3978 mR = VBoxVHWAColorComponent (0xff); 3979 mG = VBoxVHWAColorComponent (0xff); 3980 mB = VBoxVHWAColorComponent (0xff); 3981 mA = VBoxVHWAColorComponent (0xff); 3986 3982 mBitsPerPixelTex = 32; 3987 3983 … … 4010 4006 } 4011 4007 4012 void VBoxVHWAColorFormat::init (uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b)4008 void VBoxVHWAColorFormat::init (uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b) 4013 4009 { 4014 4010 mBitsPerPixel = bitsPerPixel; … … 4021 4017 mFormat = GL_BGRA_EXT;//GL_RGBA; 4022 4018 mType = GL_UNSIGNED_BYTE; 4023 mR = VBoxVHWAColorComponent (r);4024 mG = VBoxVHWAColorComponent (g);4025 mB = VBoxVHWAColorComponent (b);4019 mR = VBoxVHWAColorComponent (r); 4020 mG = VBoxVHWAColorComponent (g); 4021 mB = VBoxVHWAColorComponent (b); 4026 4022 break; 4027 4023 case 24: … … 4032 4028 mFormat = GL_BGR_EXT; 4033 4029 mType = GL_UNSIGNED_BYTE; 4034 mR = VBoxVHWAColorComponent (r);4035 mG = VBoxVHWAColorComponent (g);4036 mB = VBoxVHWAColorComponent (b);4030 mR = VBoxVHWAColorComponent (r); 4031 mG = VBoxVHWAColorComponent (g); 4032 mB = VBoxVHWAColorComponent (b); 4037 4033 break; 4038 4034 case 16: … … 4043 4039 mFormat = GL_BGR_EXT; 4044 4040 mType = GL_UNSIGNED_BYTE; /* TODO" ??? */ 4045 mR = VBoxVHWAColorComponent (r);4046 mG = VBoxVHWAColorComponent (g);4047 mB = VBoxVHWAColorComponent (b);4041 mR = VBoxVHWAColorComponent (r); 4042 mG = VBoxVHWAColorComponent (g); 4043 mB = VBoxVHWAColorComponent (b); 4048 4044 break; 4049 4045 case 8: … … 4054 4050 mFormat = GL_RED;//GL_RGB; 4055 4051 mType = GL_UNSIGNED_BYTE; 4056 mR = VBoxVHWAColorComponent (0xff);4052 mR = VBoxVHWAColorComponent (0xff); 4057 4053 break; 4058 4054 case 1: … … 4063 4059 mFormat = GL_COLOR_INDEX; 4064 4060 mType = GL_BITMAP; 4065 mR = VBoxVHWAColorComponent (0x1);4061 mR = VBoxVHWAColorComponent (0x1); 4066 4062 break; 4067 4063 default: … … 4085 4081 } 4086 4082 4087 VBoxVHWAColorComponent::VBoxVHWAColorComponent (uint32_t aMask)4088 { 4089 unsigned f = ASMBitFirstSetU32 (aMask);4083 VBoxVHWAColorComponent::VBoxVHWAColorComponent (uint32_t aMask) 4084 { 4085 unsigned f = ASMBitFirstSetU32 (aMask); 4090 4086 if(f) 4091 4087 { 4092 4088 mOffset = f - 1; 4093 f = ASMBitFirstSetU32 (~(aMask >> mOffset));4089 f = ASMBitFirstSetU32 (~(aMask >> mOffset)); 4094 4090 if(f) 4095 4091 { … … 4101 4097 } 4102 4098 4103 Assert (mcBits);4099 Assert (mcBits); 4104 4100 mMask = (((uint32_t)0xffffffff) >> (32 - mcBits)) << mOffset; 4105 Assert (mMask == aMask);4101 Assert (mMask == aMask); 4106 4102 4107 4103 mRange = (mMask >> mOffset) + 1; … … 4118 4114 void VBoxVHWAColorFormat::pixel2Normalized (uint32_t pix, float *r, float *g, float *b) const 4119 4115 { 4120 *r = mR.colorValNorm(pix); 4121 *g = mG.colorValNorm(pix); 4122 *b = mB.colorValNorm(pix); 4123 } 4124 4125 VBoxQGLOverlay::VBoxQGLOverlay (VBoxConsoleView *aView, VBoxFrameBuffer * aContainer) 4126 : mpOverlayWidget(NULL), 4127 mView(aView), 4128 mContainer(aContainer), 4129 mGlOn(false), 4130 mOverlayWidgetVisible(false), 4131 mOverlayVisible(false), 4132 mGlCurrent(false), 4133 mProcessingCommands(false), 4134 mNeedOverlayRepaint(false), 4135 mNeedSetVisible(false), 4136 mCmdPipe(aView) 4116 *r = mR.colorValNorm (pix); 4117 *g = mG.colorValNorm (pix); 4118 *b = mB.colorValNorm (pix); 4119 } 4120 4121 VBoxQGLOverlay::VBoxQGLOverlay (VBoxConsoleView *aView, VBoxFrameBuffer * aContainer, CSession * aSession) 4122 : mpOverlayWidget (NULL), 4123 mView (aView), 4124 mContainer (aContainer), 4125 mGlOn (false), 4126 mOverlayWidgetVisible (false), 4127 mOverlayVisible (false), 4128 mGlCurrent (false), 4129 mProcessingCommands (false), 4130 mNeedOverlayRepaint (false), 4131 mNeedSetVisible (false), 4132 mCmdPipe (aView), 4133 mSettings (*aSession) 4137 4134 { 4138 4135 /* postpone the gl widget initialization to avoid conflict with 3D on Mac */ … … 4144 4141 return; 4145 4142 4146 mpOverlayWidget = new VBoxGLWidget (mView, mView->viewport() );4143 mpOverlayWidget = new VBoxGLWidget (mView, mView->viewport(), &mSettings); 4147 4144 4148 4145 VBoxGLContext *pc = (VBoxGLContext*)mpOverlayWidget->context(); 4149 pc->allowDoneCurrent (false);4146 pc->allowDoneCurrent (false); 4150 4147 4151 4148 mOverlayWidgetVisible = true; /* to ensure it is set hidden with vboxShowOverlay */ 4152 vboxShowOverlay (false);4153 4154 mpOverlayWidget->setMouseTracking (true);4149 vboxShowOverlay (false); 4150 4151 mpOverlayWidget->setMouseTracking (true); 4155 4152 } 4156 4153 … … 5348 5345 } 5349 5346 5350 //int VBoxVHWATextureImage::updateDstCKeyInfo(const VBoxVHWAColorKey * pDstCKey) 5351 //{ 5352 // if(mpProgram) 5353 // { 5354 // pProgram->start(); 5355 // int rc = setCKey(mpProgram, &mColorFormat, pDstCKey, true); 5356 // pProgram->stop(); 5357 // return rc; 5358 // } 5359 // return VERR_INVALID_STATE; 5360 //} 5361 // 5362 //int VBoxVHWATextureImage::updateSrcCKeyInfo(const VBoxVHWAColorKey * pSrcCKey) 5363 //{ 5364 // if(mpProgram) 5365 // { 5366 // pProgram->start(); 5367 // int rc = setCKey(mpProgram, &mColorFormat, pSrcCKey, false); 5368 // pProgram->stop(); 5369 // return rc; 5370 // } 5371 // return VERR_INVALID_STATE; 5372 //} 5373 5374 int VBoxVHWATextureImage::setCKey(VBoxVHWAGlProgramVHWA * pProgram, const VBoxVHWAColorFormat * pFormat, const VBoxVHWAColorKey * pCKey, bool bDst) 5347 int VBoxVHWATextureImage::setCKey (VBoxVHWAGlProgramVHWA * pProgram, const VBoxVHWAColorFormat * pFormat, const VBoxVHWAColorKey * pCKey, bool bDst) 5375 5348 { 5376 5349 float r,g,b; 5377 pFormat->pixel2Normalized (pCKey->lower(), &r, &g, &b);5378 int rcL = bDst ? pProgram->setDstCKeyLowerRange (r, g, b) : pProgram->setSrcCKeyLowerRange(r, g, b);5350 pFormat->pixel2Normalized (pCKey->lower(), &r, &g, &b); 5351 int rcL = bDst ? pProgram->setDstCKeyLowerRange (r, g, b) : pProgram->setSrcCKeyLowerRange (r, g, b); 5379 5352 Assert(RT_SUCCESS(rcL)); 5380 5353 … … 5382 5355 } 5383 5356 5384 5357 VBoxVHWASettings::VBoxVHWASettings (CSession &session) 5358 { 5359 CMachine machine = session.GetMachine(); 5360 5361 QString str = machine.GetExtraData (VBoxDefs::GUI_Accelerate2D_StretchLinear); 5362 mStretchLinearEnabled = str != "off"; 5363 5364 uint32_t aFourccs[VBOXVHWA_NUMFOURCC]; 5365 int num = 0; 5366 str = machine.GetExtraData (VBoxDefs::GUI_Accelerate2D_PixformatAYUV); 5367 if (str != "off") 5368 aFourccs[num++] = FOURCC_AYUV; 5369 str = machine.GetExtraData (VBoxDefs::GUI_Accelerate2D_PixformatUYVY); 5370 if (str != "off") 5371 aFourccs[num++] = FOURCC_UYVY; 5372 str = machine.GetExtraData (VBoxDefs::GUI_Accelerate2D_PixformatYUY2); 5373 if (str != "off") 5374 aFourccs[num++] = FOURCC_YUY2; 5375 str = machine.GetExtraData (VBoxDefs::GUI_Accelerate2D_PixformatYV12); 5376 if (str != "off") 5377 aFourccs[num++] = FOURCC_YV12; 5378 5379 mFourccEnabledCount = num; 5380 memcpy(mFourccEnabledList, aFourccs, num* sizeof (aFourccs[0])); 5381 } 5382 5383 int VBoxVHWASettings::calcIntersection (int c1, const uint32_t *a1, int c2, const uint32_t *a2, int cOut, uint32_t *aOut) 5384 { 5385 /* fourcc arrays are not big, so linear search is enough, 5386 * also no need to check for duplicates */ 5387 int cMatch = 0; 5388 for (int i = 0; i < c1; ++i) 5389 { 5390 uint32_t cur1 = a1[i]; 5391 for (int j = 0; j < c2; ++j) 5392 { 5393 uint32_t cur2 = a2[j]; 5394 if(cur1 == cur2) 5395 { 5396 if(cOut > cMatch && aOut) 5397 aOut[cMatch] = cur1; 5398 ++cMatch; 5399 break; 5400 } 5401 } 5402 } 5403 5404 return cMatch; 5405 } 5385 5406 5386 5407 #endif -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r25470 r25583 63 63 64 64 #endif 65 66 class VBoxVHWASettings 67 { 68 public: 69 VBoxVHWASettings (CSession &session); 70 71 int fourccEnabledCount() const { return mFourccEnabledCount; } 72 const uint32_t * fourccEnabledList() const { return mFourccEnabledList; } 73 74 bool isStretchLinearEnabled() const { return mStretchLinearEnabled; } 75 76 static int calcIntersection (int c1, const uint32_t *a1, int c2, const uint32_t *a2, int cOut, uint32_t *aOut); 77 78 int getIntersection (const VBoxVHWAInfo &aInfo, int cOut, uint32_t *aOut) 79 { 80 return calcIntersection (mFourccEnabledCount, mFourccEnabledList, aInfo.getFourccSupportedCount(), aInfo.getFourccSupportedList(), cOut, aOut); 81 } 82 83 bool isSupported(const VBoxVHWAInfo &aInfo, uint32_t format) 84 { 85 return calcIntersection (mFourccEnabledCount, mFourccEnabledList, 1, &format, 0, NULL) 86 && calcIntersection (aInfo.getFourccSupportedCount(), aInfo.getFourccSupportedList(), 1, &format, 0, NULL); 87 } 88 private: 89 uint32_t mFourccEnabledList[VBOXVHWA_NUMFOURCC]; 90 int mFourccEnabledCount; 91 bool mStretchLinearEnabled; 92 }; 65 93 66 94 class VBoxVHWADirtyRect … … 709 737 { 710 738 public: 711 VBoxVHWASurfaceBase (739 VBoxVHWASurfaceBase ( 712 740 class VBoxGLWidget *aWidget, 713 741 const QSize & aSize, … … 718 746 VBoxVHWAColorKey * pSrcBltCKey, VBoxVHWAColorKey * pDstBltCKey, 719 747 VBoxVHWAColorKey * pSrcOverlayCKey, VBoxVHWAColorKey * pDstOverlayCKey, 720 bool bVGA);748 VBOXVHWAIMG_TYPE aImgFlags); 721 749 722 750 virtual ~VBoxVHWASurfaceBase(); 723 751 724 void init (VBoxVHWASurfaceBase * pPrimary, uchar *pvMem);752 void init (VBoxVHWASurfaceBase * pPrimary, uchar *pvMem); 725 753 726 754 void uninit(); … … 728 756 static void globalInit(); 729 757 730 // int blt(const QRect * aDstRect, VBoxVHWASurfaceBase * aSrtSurface, const QRect * aSrcRect, const VBoxVHWAColorKey * pDstCKeyOverride, const VBoxVHWAColorKey * pSrcCKeyOverride); 731 732 int lock(const QRect * pRect, uint32_t flags); 758 int lock (const QRect * pRect, uint32_t flags); 733 759 734 760 int unlock(); 735 761 736 void updatedMem (const QRect * aRect);737 738 bool performDisplay (VBoxVHWASurfaceBase *pPrimary, bool bForce);762 void updatedMem (const QRect * aRect); 763 764 bool performDisplay (VBoxVHWASurfaceBase *pPrimary, bool bForce); 739 765 740 766 void setRects (const QRect & aTargRect, const QRect & aSrcRect); … … 743 769 void updateVisibility (VBoxVHWASurfaceBase *pPrimary, const QRect & aVisibleTargRect, bool bNotIntersected, bool bForce); 744 770 745 static ulong calcBytesPerPixel (GLenum format, GLenum type);746 747 static GLsizei makePowerOf2 (GLsizei val);771 static ulong calcBytesPerPixel (GLenum format, GLenum type); 772 773 static GLsizei makePowerOf2 (GLsizei val); 748 774 749 775 bool addressAlocated() const { return mFreeAddress; } 750 uchar * address() { return mAddress; }776 uchar * address() { return mAddress; } 751 777 752 778 ulong memSize(); … … 756 782 const QSize size() {return mRect.size();} 757 783 758 // GLenum format() {return mImage->colorFormat().format(); }759 // GLint internalFormat() { return mImage->colorFormat().internalFormat(); }760 // GLenum type() { return mImage->colorFormat().type(); }761 784 uint32_t fourcc() {return mImage->colorFormat().fourcc(); } 762 785 … … 773 796 void resetDefaultDstOverlayCKey() { mpDstOverlayCKey = mpDefaultDstOverlayCKey; } 774 797 775 void setDstBltCKey (const VBoxVHWAColorKey * ckey)798 void setDstBltCKey (const VBoxVHWAColorKey * ckey) 776 799 { 777 800 if(ckey) … … 786 809 } 787 810 788 void setSrcBltCKey (const VBoxVHWAColorKey * ckey)811 void setSrcBltCKey (const VBoxVHWAColorKey * ckey) 789 812 { 790 813 if(ckey) … … 799 822 } 800 823 801 void setDefaultDstOverlayCKey (const VBoxVHWAColorKey * ckey)824 void setDefaultDstOverlayCKey (const VBoxVHWAColorKey * ckey) 802 825 { 803 826 if(ckey) … … 812 835 } 813 836 814 void setDefaultSrcOverlayCKey (const VBoxVHWAColorKey * ckey)837 void setDefaultSrcOverlayCKey (const VBoxVHWAColorKey * ckey) 815 838 { 816 839 if(ckey) … … 825 848 } 826 849 827 void setOverriddenDstOverlayCKey (const VBoxVHWAColorKey * ckey)850 void setOverriddenDstOverlayCKey (const VBoxVHWAColorKey * ckey) 828 851 { 829 852 if(ckey) … … 838 861 } 839 862 840 void setOverriddenSrcOverlayCKey (const VBoxVHWAColorKey * ckey)863 void setOverriddenSrcOverlayCKey (const VBoxVHWAColorKey * ckey) 841 864 { 842 865 if(ckey) … … 856 879 } 857 880 858 const VBoxVHWAColorKey * getActiveDstOverlayCKey (VBoxVHWASurfaceBase * pPrimary)881 const VBoxVHWAColorKey * getActiveDstOverlayCKey (VBoxVHWASurfaceBase * pPrimary) 859 882 { 860 883 return mpDstOverlayCKey ? mpDefaultDstOverlayCKey : (pPrimary ? pPrimary->mpDstOverlayCKey : NULL); … … 883 906 void setVisibleRectValues (const QRect & aVisTargRect); 884 907 885 void setComplexList (VBoxVHWASurfList *aComplexList) { mComplexList = aComplexList; }908 void setComplexList (VBoxVHWASurfList *aComplexList) { mComplexList = aComplexList; } 886 909 void initDisplay(); 887 910 888 bool synchTexMem (const QRect * aRect);889 890 int performBlt (const QRect * pDstRect, VBoxVHWASurfaceBase * pSrcSurface, const QRect * pSrcRect, const VBoxVHWAColorKey * pDstCKey, const VBoxVHWAColorKey * pSrcCKey, bool blt);911 bool synchTexMem (const QRect * aRect); 912 913 int performBlt (const QRect * pDstRect, VBoxVHWASurfaceBase * pSrcSurface, const QRect * pSrcRect, const VBoxVHWAColorKey * pDstCKey, const VBoxVHWAColorKey * pSrcCKey, bool blt); 891 914 892 915 QRect mRect; /* == Inv FB size */ … … 1315 1338 { 1316 1339 public: 1317 VBoxGLWidget (class VBoxConsoleView *aView, QWidget *aParent );1340 VBoxGLWidget (class VBoxConsoleView *aView, QWidget *aParent, VBoxVHWASettings *aSettings); 1318 1341 ~VBoxGLWidget(); 1319 1342 … … 1523 1546 class VBoxVHWAGlProgramMngr *mpMngr; 1524 1547 1548 VBoxVHWASettings *mSettings; 1549 1525 1550 #ifdef VBOXVHWA_PROFILE_FPS 1526 1551 VBoxVHWADbgTimer mFPSCounter; … … 1648 1673 { 1649 1674 public: 1650 VBoxQGLOverlay (class VBoxConsoleView *aView, class VBoxFrameBuffer * aContainer );1651 1652 int onVHWACommand (struct _VBOXVHWACMD * pCommand);1653 1654 void onVHWACommandEvent (QEvent * pEvent);1675 VBoxQGLOverlay (class VBoxConsoleView *aView, class VBoxFrameBuffer * aContainer, CSession * aSession); 1676 1677 int onVHWACommand (struct _VBOXVHWACMD * pCommand); 1678 1679 void onVHWACommandEvent (QEvent * pEvent); 1655 1680 1656 1681 /** … … 1677 1702 void onResizeEventPostprocess (const class VBoxResizeEvent *re); 1678 1703 1679 void onViewportResized (QResizeEvent * /*re*/)1704 void onViewportResized (QResizeEvent * /*re*/) 1680 1705 { 1681 1706 vboxDoCheckUpdateViewport(); … … 1683 1708 } 1684 1709 1685 void onViewportScrolled (int /*dx*/, int /*dy*/)1710 void onViewportScrolled (int /*dx*/, int /*dy*/) 1686 1711 { 1687 1712 vboxDoCheckUpdateViewport(); … … 1696 1721 1697 1722 /* not supposed to be called by clients */ 1698 int vhwaLoadExec (struct SSMHANDLE * pSSM, uint32_t u32Version);1699 void vhwaSaveExec (struct SSMHANDLE * pSSM);1700 private: 1701 int vhwaSurfaceUnlock (struct _VBOXVHWACMD_SURF_UNLOCK *pCmd);1723 int vhwaLoadExec (struct SSMHANDLE * pSSM, uint32_t u32Version); 1724 void vhwaSaveExec (struct SSMHANDLE * pSSM); 1725 private: 1726 int vhwaSurfaceUnlock (struct _VBOXVHWACMD_SURF_UNLOCK *pCmd); 1702 1727 1703 1728 void repaintMain(); … … 1712 1737 { 1713 1738 mNeedSetVisible = false; 1714 mpOverlayWidget->setVisible (true);1739 mpOverlayWidget->setVisible (true); 1715 1740 } 1716 1741 } … … 1735 1760 { 1736 1761 makeCurrent(); 1737 mpOverlayWidget->performDisplayAndSwap (false);1738 } 1739 } 1740 1741 void vboxSetGlOn (bool on);1762 mpOverlayWidget->performDisplayAndSwap (false); 1763 } 1764 } 1765 1766 void vboxSetGlOn (bool on); 1742 1767 bool vboxGetGlOn() { return mGlOn; } 1743 1768 bool vboxSynchGl(); 1744 1769 void vboxDoVHWACmdExec(void *cmd); 1745 void vboxShowOverlay (bool show);1770 void vboxShowOverlay (bool show); 1746 1771 void vboxDoCheckUpdateViewport(); 1747 void vboxDoVHWACmd (void *cmd);1748 void addMainDirtyRect (const QRect & aRect);1749 void vboxCheckUpdateOverlay (const QRect & rect);1750 VBoxVHWACommandElement * processCmdList (VBoxVHWACommandElement * pCmd);1751 1752 int vhwaConstruct (struct _VBOXVHWACMD_HH_CONSTRUCT *pCmd);1772 void vboxDoVHWACmd (void *cmd); 1773 void addMainDirtyRect (const QRect & aRect); 1774 void vboxCheckUpdateOverlay (const QRect & rect); 1775 VBoxVHWACommandElement * processCmdList (VBoxVHWACommandElement * pCmd); 1776 1777 int vhwaConstruct (struct _VBOXVHWACMD_HH_CONSTRUCT *pCmd); 1753 1778 1754 1779 int reset(); … … 1776 1801 * till the framebuffer size is restored */ 1777 1802 VHWACommandList mOnResizeCmdList; 1803 1804 VBoxVHWASettings mSettings; 1778 1805 }; 1779 1806 … … 1783 1810 { 1784 1811 public: 1785 VBoxOverlayFrameBuffer (class VBoxConsoleView *aView )1786 : T (aView),1787 mOverlay (aView, this)1812 VBoxOverlayFrameBuffer (class VBoxConsoleView *aView, CSession * aSession) 1813 : T (aView), 1814 mOverlay (aView, this, aSession) 1788 1815 {} 1789 1816 … … 1791 1818 STDMETHOD(ProcessVHWACommand)(BYTE *pCommand) 1792 1819 { 1793 return mOverlay.onVHWACommand ((struct _VBOXVHWACMD*)pCommand);1794 } 1795 1796 void doProcessVHWACommand (QEvent * pEvent)1797 { 1798 mOverlay.onVHWACommandEvent (pEvent);1820 return mOverlay.onVHWACommand ((struct _VBOXVHWACMD*)pCommand); 1821 } 1822 1823 void doProcessVHWACommand (QEvent * pEvent) 1824 { 1825 mOverlay.onVHWACommandEvent (pEvent); 1799 1826 } 1800 1827 … … 1804 1831 BOOL *aFinished) 1805 1832 { 1806 if (mOverlay.onRequestResize (aScreenId, aPixelFormat,1833 if (mOverlay.onRequestResize (aScreenId, aPixelFormat, 1807 1834 aVRAM, aBitsPerPixel, aBytesPerLine, 1808 1835 aWidth, aHeight, … … 1820 1847 ULONG aW, ULONG aH) 1821 1848 { 1822 if (mOverlay.onNotifyUpdate (aX, aY, aW, aH))1849 if (mOverlay.onNotifyUpdate (aX, aY, aW, aH)) 1823 1850 return S_OK; 1824 1851 return T::NotifyUpdate (aX, aY, aW, aH); … … 1834 1861 void viewportResized (QResizeEvent * re) 1835 1862 { 1836 mOverlay.onViewportResized (re);1837 T::viewportResized (re);1863 mOverlay.onViewportResized (re); 1864 T::viewportResized (re); 1838 1865 } 1839 1866 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGLSupportInfo.cpp
r25526 r25583 278 278 VBOXQGLLOGREL (("gl version string: 0%s\n", str)); 279 279 280 mGLVersion = parseVersion (str);280 mGLVersion = parseVersion (str); 281 281 Assert(mGLVersion > 0); 282 282 if(mGLVersion < 0) … … 288 288 VBOXQGLLOGREL (("gl version: 0x%x\n", mGLVersion)); 289 289 VBOXQGL_CHECKERR( 290 str = glGetString (GL_EXTENSIONS);290 str = glGetString (GL_EXTENSIONS); 291 291 ); 292 293 VBOXQGLLOGREL (("gl extensions: %s\n", str)); 292 294 293 295 const char * pos = strstr((const char *)str, "GL_ARB_multitexture"); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.cpp
r25318 r25583 63 63 const char* VBoxDefs::GUI_Export_Bucket = "GUI/Export/Bucket"; 64 64 const char* VBoxDefs::GUI_PreventBetaWarning = "GUI/PreventBetaWarning"; 65 #ifdef VBOX_WITH_VIDEOHWACCEL 66 const char* VBoxDefs::GUI_Accelerate2D_StretchLinear = "GUI/Accelerate2D/StretchLinear"; 67 const char* VBoxDefs::GUI_Accelerate2D_PixformatYV12 = "GUI/Accelerate2D/PixformatYV12"; 68 const char* VBoxDefs::GUI_Accelerate2D_PixformatUYVY = "GUI/Accelerate2D/PixformatUYVY"; 69 const char* VBoxDefs::GUI_Accelerate2D_PixformatYUY2 = "GUI/Accelerate2D/PixformatYUY2"; 70 const char* VBoxDefs::GUI_Accelerate2D_PixformatAYUV = "GUI/Accelerate2D/PixformatAYUV"; 71 #endif -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h
r25318 r25583 181 181 static const char* GUI_Export_Bucket; 182 182 static const char* GUI_PreventBetaWarning; 183 184 #ifdef VBOX_WITH_VIDEOHWACCEL 185 static const char* GUI_Accelerate2D_StretchLinear; 186 static const char* GUI_Accelerate2D_PixformatYV12; 187 static const char* GUI_Accelerate2D_PixformatUYVY; 188 static const char* GUI_Accelerate2D_PixformatYUY2; 189 static const char* GUI_Accelerate2D_PixformatAYUV; 190 #endif 183 191 }; 184 192
Note:
See TracChangeset
for help on using the changeset viewer.