VirtualBox

Ignore:
Timestamp:
Oct 24, 2011 8:44:38 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: do not re-create the framebuffer on every view switch (untested Quartz2D code).

File:
1 edited

Legend:

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

    r39095 r39097  
    362362#ifdef VBOX_GUI_USE_QUARTZ2D
    363363        case VBoxDefs::Quartz2DMode:
     364        {
    364365            /* Indicate that we are doing all drawing stuff ourself: */
    365366            viewport()->setAttribute(Qt::WA_PaintOnScreen);
     367            UIFrameBuffer* pFrameBuffer = uisession()->frameBuffer(screenId());
     368            if (pFrameBuffer)
     369                pFrameBuffer->setView(this);
     370            else
     371            {
    366372# ifdef VBOX_WITH_VIDEOHWACCEL
    367             if (m_fAccelerate2DVideo)
    368             {
    369                 UIFrameBuffer* pFramebuffer = uisession()->frameBuffer(screenId());
    370                 if (pFramebuffer)
    371                     pFramebuffer->setView(this);
     373                if (m_fAccelerate2DVideo)
     374                {
     375                    /** these two additional template args is a workaround to
     376                     * this [VBox|UI] duplication
     377                     * @todo: they are to be removed once VBox stuff is gone */
     378                    pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
     379                }
    372380                else
    373                 {
    374                     /* these two additional template args is a workaround to this [VBox|UI] duplication
    375                      * @todo: they are to be removed once VBox stuff is gone */
    376                     pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQuartz2D, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
    377                     uisession()->setFrameBuffer(screenId(), pFramebuffer);
    378                 }
    379                 m_pFrameBuffer = pFramebuffer;
     381                    pFrameBuffer = new UIFrameBufferSDL(this);
     382# else /* VBOX_WITH_VIDEOHWACCEL */
     383                pFrameBuffer = new UIFrameBufferSDL(this);
     384# endif /* !VBOX_WITH_VIDEOHWACCEL */
     385                uisession()->setFrameBuffer(screenId(), pFrameBuffer);
    380386            }
    381             else
    382                 m_pFrameBuffer = new UIFrameBufferQuartz2D(this);
    383 # else /* VBOX_WITH_VIDEOHWACCEL */
    384             m_pFrameBuffer = new UIFrameBufferQuartz2D(this);
    385 # endif /* !VBOX_WITH_VIDEOHWACCEL */
    386             break;
     387            m_pFrameBuffer = pFrameBuffer;
     388            break;
     389        }
    387390#endif /* VBOX_GUI_USE_QUARTZ2D */
    388391        default:
     
    505508        /* Process pending frame-buffer resize events: */
    506509        QApplication::sendPostedEvents(this, VBoxDefs::ResizeEventType);
    507         if (   vboxGlobal().vmRenderMode() == VBoxDefs::QImageMode
     510        if (   0
     511#ifdef VBOX_GUI_USE_QIMAGE
     512            || vboxGlobal().vmRenderMode() == VBoxDefs::QImageMode
     513#endif
     514#ifdef VBOX_GUI_USE_SDL
    508515            || vboxGlobal().vmRenderMode() == VBoxDefs::SDLMode
     516#endif
     517#ifdef VBOX_GUI_USE_QUARTZ2D
     518            || vboxGlobal().vmRenderMode() == VBoxDefs::Quartz2DMode)
     519#endif
    509520#ifdef VBOX_WITH_VIDEOHWACCEL
    510521            || m_fAccelerate2DVideo
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