Changeset 27839 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 30, 2010 8:31:42 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r27762 r27839 820 820 /* these two additional template args is a workaround to this [VBox|UI] duplication 821 821 * @todo: they are to be removed once VBox stuff is gone */ 822 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQImageFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session() ) :822 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQImageFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session(), 0) : 823 823 #endif 824 824 new VBoxQImageFrameBuffer (this); … … 839 839 /* these two additional template args is a workaround to this [VBox|UI] duplication 840 840 * @todo: they are to be removed once VBox stuff is gone */ 841 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxSDLFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session() ) :841 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxSDLFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session(), 0) : 842 842 #endif 843 843 new VBoxSDLFrameBuffer (this); … … 864 864 /* these two additional template args is a workaround to this [VBox|UI] duplication 865 865 * @todo: they are to be removed once VBox stuff is gone */ 866 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQuartz2DFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session() ) :866 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQuartz2DFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session(), 0) : 867 867 #endif 868 868 new VBoxQuartz2DFrameBuffer (this); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r27785 r27839 2204 2204 2205 2205 VBoxVHWASurfaceBase *surf = NULL; 2206 const VBoxVHWASurfaceBase *existingSurf = NULL; 2206 /* in case the Framebuffer is working in "not using VRAM" mode, 2207 * we need to report the pitch, etc. info of the form guest expects from us*/ 2208 VBoxVHWAColorFormat reportedFormat; 2209 /* paranoya to ensure the VBoxVHWAColorFormat API works properly */ 2210 Assert(!reportedFormat.isValid()); 2207 2211 bool bNoPBO = false; 2208 2212 bool bPrimary = false; … … 2233 2237 } 2234 2238 2235 if (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)2239 if (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE) 2236 2240 { 2237 2241 bNoPBO = true; … … 2240 2244 2241 2245 Assert((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN) == 0); 2242 if (pVga->handle() == VBOXVHWA_SURFHANDLE_INVALID2246 if (pVga->handle() == VBOXVHWA_SURFHANDLE_INVALID 2243 2247 && (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN) == 0) 2244 2248 { … … 2251 2255 // && pCmd->SurfInfo.height == pVga->height()) 2252 2256 { 2253 VBoxVHWAColorFormat format(pCmd->SurfInfo.PixelFormat.c.rgbBitCount,2257 reportedFormat = VBoxVHWAColorFormat(pCmd->SurfInfo.PixelFormat.c.rgbBitCount, 2254 2258 pCmd->SurfInfo.PixelFormat.m1.rgbRBitMask, 2255 2259 pCmd->SurfInfo.PixelFormat.m2.rgbGBitMask, 2256 2260 pCmd->SurfInfo.PixelFormat.m3.rgbBBitMask); 2257 Assert(pVga->pixelFormat().equals(format)); 2261 // the assert below is incorrect in case the Framebuffer is working in "not using VRAM" mode 2262 // Assert(pVga->pixelFormat().equals(format)); 2258 2263 // if(pVga->pixelFormat().equals(format)) 2259 2264 { 2260 existingSurf = pVga;2261 2265 surf = pVga; 2262 2266 … … 2282 2286 if(!surf) 2283 2287 { 2288 Assert(!(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)); 2284 2289 VBOXVHWAIMG_TYPE fFlags = 0; 2285 2290 if(!bNoPBO) … … 2336 2341 2337 2342 uchar * addr = vboxVRAMAddressFromOffset(pCmd->SurfInfo.offSurface); 2338 if (!existingSurf) 2339 surf->init(mDisplay.getPrimary(), addr); 2343 surf->init(mDisplay.getPrimary(), addr); 2340 2344 2341 2345 if(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) … … 2376 2380 } 2377 2381 } 2382 else 2383 { 2384 Assert(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE); 2385 } 2378 2386 2379 2387 Assert(mDisplay.getVGA() == mDisplay.getPrimary()); … … 2382 2390 VBOXQGLLOG(("bps: %d\n", surf->bitsPerPixel())); 2383 2391 2384 pCmd->SurfInfo.pitch = surf->bitsPerPixel() * surf->width() / 8; 2385 pCmd->SurfInfo.sizeX = surf->memSize(); 2386 pCmd->SurfInfo.sizeY = 1; 2392 if (!reportedFormat.isValid()) 2393 { 2394 pCmd->SurfInfo.pitch = surf->bitsPerPixel() * surf->width() / 8; 2395 pCmd->SurfInfo.sizeX = surf->memSize(); 2396 pCmd->SurfInfo.sizeY = 1; 2397 } 2398 else 2399 { 2400 /* this is the case of Framebuffer not using Gueat VRAM */ 2401 /* can happen for primary surface creation only */ 2402 Assert(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE); 2403 pCmd->SurfInfo.pitch = (reportedFormat.bitsPerPixel() * surf->width() + 7) / 8; 2404 /* we support only RGB case now, otherwise we would need more complicated mechanism of memsize calculation */ 2405 Assert(!reportedFormat.fourcc()); 2406 pCmd->SurfInfo.sizeX = (reportedFormat.bitsPerPixel() * surf->width() + 7) / 8 * surf->height(); 2407 pCmd->SurfInfo.sizeY = 1; 2408 } 2387 2409 2388 2410 if(handle != VBOXVHWA_SURFHANDLE_INVALID) … … 2495 2517 VBOXQGLLOG_ENTER(("pSurf (0x%x)\n",pSurf)); 2496 2518 vboxCheckUpdateAddress (pSurf, pCmd->u.in.offSurface); 2497 if (pCmd->u.in.rectValid)2519 if (pCmd->u.in.rectValid) 2498 2520 { 2499 2521 QRect r = VBOXVHWA_CONSTRUCT_QRECT_FROM_RECTL_WH(&pCmd->u.in.rect); … … 3665 3687 Assert ((size.bytesPerLine() & 3) == 0); 3666 3688 fallback = ((size.bytesPerLine() & 3) != 0); 3689 Assert(!fallback); 3667 3690 } 3668 3691 if (!fallback) … … 3671 3694 Assert ((bitsPerLine & (size.bitsPerPixel() - 1)) == 0); 3672 3695 fallback = ((bitsPerLine & (size.bitsPerPixel() - 1)) != 0); 3696 Assert(!fallback); 3673 3697 } 3674 3698 if (!fallback) … … 3681 3705 else 3682 3706 { 3707 AssertBreakpoint(); 3683 3708 fallback = true; 3684 3709 } … … 3686 3711 if (fallback) 3687 3712 { 3713 /* we should never come to fallback more now */ 3714 AssertBreakpoint(); 3688 3715 /* we don't support either the pixel format or the color depth, 3689 3716 * fallback to a self-provided 32bpp RGB buffer */ … … 3998 4025 } 3999 4026 4000 VBoxQGLOverlay::VBoxQGLOverlay (QWidget *pViewport,QObject *pPostEventObject, CSession * aSession )4027 VBoxQGLOverlay::VBoxQGLOverlay (QWidget *pViewport,QObject *pPostEventObject, CSession * aSession, uint32_t id) 4001 4028 : mpOverlayWgt (NULL), 4002 4029 mpViewport (pViewport), … … 4010 4037 mCmdPipe (pPostEventObject), 4011 4038 mSettings (*aSession), 4012 mpSession(aSession) 4039 mpSession(aSession), 4040 m_id(id) 4013 4041 { 4014 4042 /* postpone the gl widget initialization to avoid conflict with 3D on Mac */ … … 4062 4090 if (mOverlayImage.hasSurfaces()) 4063 4091 { 4064 Assert(!mOverlayVisible);4092 // Assert(!mOverlayVisible); 4065 4093 if (pViewport) 4066 4094 { … … 4068 4096 // vboxDoCheckUpdateViewport(); 4069 4097 } 4070 Assert(!mOverlayVisible);4098 // Assert(!mOverlayVisible); 4071 4099 } 4072 4100 mGlCurrent = false; … … 4604 4632 { 4605 4633 PVM pVM = (PVM)pCmd->pVM; 4606 uint32_t intsId = 0; /* @todo: set the proper id */4634 uint32_t intsId = m_id; 4607 4635 4608 4636 char nameFuf[sizeof(VBOXQGL_STATE_NAMEBASE) + 8]; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r27777 r27839 226 226 VBoxVHWAColorFormat(uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b); 227 227 VBoxVHWAColorFormat(uint32_t fourcc); 228 VBoxVHWAColorFormat(){} 228 VBoxVHWAColorFormat() : 229 mBitsPerPixel(0) /* needed for isValid() to work */ 230 {} 229 231 GLint internalFormat() const {return mInternalFormat; } 230 232 GLenum format() const {return mFormat; } … … 1575 1577 #ifdef VBOX_WITH_VIDEOHWACCEL 1576 1578 1577 void vboxCheckUpdateAddress 1579 void vboxCheckUpdateAddress(VBoxVHWASurfaceBase * pSurface, uint64_t offset) 1578 1580 { 1579 1581 if (pSurface->addressAlocated()) 1580 1582 { 1583 Assert(!mDisplay.isPrimary(pSurface)); 1581 1584 uchar * addr = vboxVRAMAddressFromOffset(offset); 1582 if (addr)1585 if (addr) 1583 1586 { 1584 1587 pSurface->setAddress(addr); … … 1761 1764 { 1762 1765 public: 1763 VBoxQGLOverlay (QWidget *pViewport, QObject *pPostEventObject, CSession * aSession);1766 VBoxQGLOverlay(QWidget *pViewport, QObject *pPostEventObject, CSession * aSession, uint32_t id); 1764 1767 ~VBoxQGLOverlay() 1765 1768 { … … 1912 1915 1913 1916 QGLWidget *mpShareWgt; 1917 1918 uint32_t m_id; 1914 1919 }; 1915 1920 … … 1920 1925 { 1921 1926 public: 1922 VBoxOverlayFrameBuffer (V *pView, CSession * aSession )1927 VBoxOverlayFrameBuffer (V *pView, CSession * aSession, uint32_t id) 1923 1928 : T (pView), 1924 mOverlay(pView->viewport(), pView, aSession ),1929 mOverlay(pView->viewport(), pView, aSession, id), 1925 1930 mpView (pView) 1926 1931 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r27769 r27839 497 497 /* these two additional template args is a workaround to this [VBox|UI] duplication 498 498 * @todo: they are to be removed once VBox stuff is gone */ 499 pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQImage, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session() );499 pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQImage, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId()); 500 500 uisession()->setFrameBuffer(screenId(), pFramebuffer); 501 501 } … … 536 536 /* these two additional template args is a workaround to this [VBox|UI] duplication 537 537 * @todo: they are to be removed once VBox stuff is gone */ 538 pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session() );538 pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId()); 539 539 uisession()->setFrameBuffer(screenId(), pFramebuffer); 540 540 } … … 579 579 /* these two additional template args is a workaround to this [VBox|UI] duplication 580 580 * @todo: they are to be removed once VBox stuff is gone */ 581 pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQuartz2D, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session() );581 pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQuartz2D, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId()); 582 582 uisession()->setFrameBuffer(screenId(), pFramebuffer); 583 583 }
Note:
See TracChangeset
for help on using the changeset viewer.