VirtualBox

Changeset 27839 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 30, 2010 8:31:42 PM (15 years ago)
Author:
vboxsync
Message:

2d: working multi-monitor + some fixing for working with not-using-VRAM mode

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

Legend:

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

    r27762 r27839  
    820820                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    821821                     * @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) :
    823823#endif
    824824                    new VBoxQImageFrameBuffer (this);
     
    839839                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    840840                     * @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) :
    842842#endif
    843843                    new VBoxSDLFrameBuffer (this);
     
    864864                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    865865                     * @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) :
    867867#endif
    868868                    new VBoxQuartz2DFrameBuffer (this);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r27785 r27839  
    22042204
    22052205    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());
    22072211    bool bNoPBO = false;
    22082212    bool bPrimary = false;
     
    22332237    }
    22342238
    2235     if(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)
     2239    if (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)
    22362240    {
    22372241        bNoPBO = true;
     
    22402244
    22412245        Assert((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN) == 0);
    2242         if(pVga->handle() == VBOXVHWA_SURFHANDLE_INVALID
     2246        if (pVga->handle() == VBOXVHWA_SURFHANDLE_INVALID
    22432247                && (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN) == 0)
    22442248        {
     
    22512255//                        && pCmd->SurfInfo.height == pVga->height())
    22522256                {
    2253                     VBoxVHWAColorFormat format(pCmd->SurfInfo.PixelFormat.c.rgbBitCount,
     2257                    reportedFormat = VBoxVHWAColorFormat(pCmd->SurfInfo.PixelFormat.c.rgbBitCount,
    22542258                                                pCmd->SurfInfo.PixelFormat.m1.rgbRBitMask,
    22552259                                                pCmd->SurfInfo.PixelFormat.m2.rgbGBitMask,
    22562260                                                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));
    22582263//                    if(pVga->pixelFormat().equals(format))
    22592264                    {
    2260                         existingSurf = pVga;
    22612265                        surf = pVga;
    22622266
     
    22822286    if(!surf)
    22832287    {
     2288        Assert(!(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE));
    22842289        VBOXVHWAIMG_TYPE fFlags = 0;
    22852290        if(!bNoPBO)
     
    23362341
    23372342        uchar * addr = vboxVRAMAddressFromOffset(pCmd->SurfInfo.offSurface);
    2338         if (!existingSurf)
    2339             surf->init(mDisplay.getPrimary(), addr);
     2343        surf->init(mDisplay.getPrimary(), addr);
    23402344
    23412345        if(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY)
     
    23762380        }
    23772381    }
     2382    else
     2383    {
     2384        Assert(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE);
     2385    }
    23782386
    23792387    Assert(mDisplay.getVGA() == mDisplay.getPrimary());
     
    23822390    VBOXQGLLOG(("bps: %d\n", surf->bitsPerPixel()));
    23832391
    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    }
    23872409
    23882410    if(handle != VBOXVHWA_SURFHANDLE_INVALID)
     
    24952517    VBOXQGLLOG_ENTER(("pSurf (0x%x)\n",pSurf));
    24962518    vboxCheckUpdateAddress (pSurf, pCmd->u.in.offSurface);
    2497     if(pCmd->u.in.rectValid)
     2519    if (pCmd->u.in.rectValid)
    24982520    {
    24992521        QRect r = VBOXVHWA_CONSTRUCT_QRECT_FROM_RECTL_WH(&pCmd->u.in.rect);
     
    36653687            Assert ((size.bytesPerLine() & 3) == 0);
    36663688            fallback = ((size.bytesPerLine() & 3) != 0);
     3689            Assert(!fallback);
    36673690        }
    36683691        if (!fallback)
     
    36713694            Assert ((bitsPerLine & (size.bitsPerPixel() - 1)) == 0);
    36723695            fallback = ((bitsPerLine & (size.bitsPerPixel() - 1)) != 0);
     3696            Assert(!fallback);
    36733697        }
    36743698        if (!fallback)
     
    36813705    else
    36823706    {
     3707        AssertBreakpoint();
    36833708        fallback = true;
    36843709    }
     
    36863711    if (fallback)
    36873712    {
     3713        /* we should never come to fallback more now */
     3714        AssertBreakpoint();
    36883715        /* we don't support either the pixel format or the color depth,
    36893716         * fallback to a self-provided 32bpp RGB buffer */
     
    39984025}
    39994026
    4000 VBoxQGLOverlay::VBoxQGLOverlay (QWidget *pViewport,QObject *pPostEventObject,  CSession * aSession)
     4027VBoxQGLOverlay::VBoxQGLOverlay (QWidget *pViewport,QObject *pPostEventObject,  CSession * aSession, uint32_t id)
    40014028    : mpOverlayWgt (NULL),
    40024029      mpViewport (pViewport),
     
    40104037      mCmdPipe (pPostEventObject),
    40114038      mSettings (*aSession),
    4012       mpSession(aSession)
     4039      mpSession(aSession),
     4040      m_id(id)
    40134041{
    40144042    /* postpone the gl widget initialization to avoid conflict with 3D on Mac */
     
    40624090        if (mOverlayImage.hasSurfaces())
    40634091        {
    4064             Assert(!mOverlayVisible);
     4092//            Assert(!mOverlayVisible);
    40654093            if (pViewport)
    40664094            {
     
    40684096//            vboxDoCheckUpdateViewport();
    40694097            }
    4070             Assert(!mOverlayVisible);
     4098//            Assert(!mOverlayVisible);
    40714099        }
    40724100        mGlCurrent = false;
     
    46044632{
    46054633    PVM pVM = (PVM)pCmd->pVM;
    4606     uint32_t intsId = 0; /* @todo: set the proper id */
     4634    uint32_t intsId = m_id;
    46074635
    46084636    char nameFuf[sizeof(VBOXQGL_STATE_NAMEBASE) + 8];
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h

    r27777 r27839  
    226226    VBoxVHWAColorFormat(uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b);
    227227    VBoxVHWAColorFormat(uint32_t fourcc);
    228     VBoxVHWAColorFormat(){}
     228    VBoxVHWAColorFormat() :
     229        mBitsPerPixel(0) /* needed for isValid() to work */
     230    {}
    229231    GLint internalFormat() const {return mInternalFormat; }
    230232    GLenum format() const {return mFormat; }
     
    15751577#ifdef VBOX_WITH_VIDEOHWACCEL
    15761578
    1577     void vboxCheckUpdateAddress (VBoxVHWASurfaceBase * pSurface, uint64_t offset)
     1579    void vboxCheckUpdateAddress(VBoxVHWASurfaceBase * pSurface, uint64_t offset)
    15781580    {
    15791581        if (pSurface->addressAlocated())
    15801582        {
     1583            Assert(!mDisplay.isPrimary(pSurface));
    15811584            uchar * addr = vboxVRAMAddressFromOffset(offset);
    1582             if(addr)
     1585            if (addr)
    15831586            {
    15841587                pSurface->setAddress(addr);
     
    17611764{
    17621765public:
    1763     VBoxQGLOverlay (QWidget *pViewport, QObject *pPostEventObject, CSession * aSession);
     1766    VBoxQGLOverlay(QWidget *pViewport, QObject *pPostEventObject, CSession * aSession, uint32_t id);
    17641767    ~VBoxQGLOverlay()
    17651768    {
     
    19121915
    19131916    QGLWidget *mpShareWgt;
     1917
     1918    uint32_t m_id;
    19141919};
    19151920
     
    19201925{
    19211926public:
    1922     VBoxOverlayFrameBuffer (V *pView, CSession * aSession)
     1927    VBoxOverlayFrameBuffer (V *pView, CSession * aSession, uint32_t id)
    19231928        : T (pView),
    1924           mOverlay(pView->viewport(), pView, aSession),
     1929          mOverlay(pView->viewport(), pView, aSession, id),
    19251930          mpView (pView)
    19261931    {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r27769 r27839  
    497497                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    498498                     * @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());
    500500                    uisession()->setFrameBuffer(screenId(), pFramebuffer);
    501501                }
     
    536536                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    537537                     * @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());
    539539                    uisession()->setFrameBuffer(screenId(), pFramebuffer);
    540540                }
     
    579579                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    580580                     * @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());
    582582                    uisession()->setFrameBuffer(screenId(), pFramebuffer);
    583583                }
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