VirtualBox

Changeset 39065 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 20, 2011 9:47:43 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: do not re-create the framebuffer on every view switch (done for SDL too).

File:
1 edited

Legend:

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

    r39063 r39065  
    311311#ifdef VBOX_GUI_USE_SDL
    312312        case VBoxDefs::SDLMode:
     313        {
    313314            /* Indicate that we are doing all drawing stuff ourself: */
    314315            // TODO_NEW_CORE
     
    318319            XFlush(QX11Info::display());
    319320# endif /* Q_WS_X11 */
     321            UIFrameBuffer* pFrameBuffer = uisession()->frameBuffer(screenId());
     322            if (pFrameBuffer)
     323                pFrameBuffer->setView(this);
     324            else
     325            {
    320326# if defined(VBOX_WITH_VIDEOHWACCEL) && defined(DEBUG_misha) /* not tested yet */
    321             if (m_fAccelerate2DVideo)
    322             {
    323                 class UIFrameBuffer* pFramebuffer = uisession()->frameBuffer(screenId());
    324                 if (pFramebuffer)
    325                     pFramebuffer->setView(this);
     327                if (m_fAccelerate2DVideo)
     328                {
     329                    /** these two additional template args is a workaround to
     330                     * this [VBox|UI] duplication
     331                     * @todo: they are to be removed once VBox stuff is gone */
     332                    pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
     333                }
    326334                else
    327                 {
    328                     /* these two additional template args is a workaround to this [VBox|UI] duplication
    329                      * @todo: they are to be removed once VBox stuff is gone */
    330                     pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
    331                     uisession()->setFrameBuffer(screenId(), pFramebuffer);
    332                 }
    333                 m_pFrameBuffer = pFramebuffer;
    334             }
    335             else
    336                 m_pFrameBuffer = new UIFrameBufferSDL(this);
    337 # else
    338             m_pFrameBuffer = new UIFrameBufferSDL(this);
    339 # endif
     335                    pFrameBuffer = new UIFrameBufferSDL(this);
     336# else /* VBOX_WITH_VIDEOHWACCEL */
     337                pFrameBuffer = new UIFrameBufferSDL(this);
     338# endif /* !VBOX_WITH_VIDEOHWACCEL */
     339                uisession()->setFrameBuffer(screenId(), pFrameBuffer);
     340            }
     341            m_pFrameBuffer = pFrameBuffer;
    340342            /* Disable scrollbars because we cannot correctly draw in a scrolled window using SDL: */
    341343            horizontalScrollBar()->setEnabled(false);
    342344            verticalScrollBar()->setEnabled(false);
    343345            break;
     346        }
    344347#endif /* VBOX_GUI_USE_SDL */
    345348#if 0 // TODO: Enable DDraw frame buffer!
     
    503506        QApplication::sendPostedEvents(this, VBoxDefs::ResizeEventType);
    504507        if (   m_fAccelerate2DVideo
    505             || vboxGlobal().vmRenderMode() == VBoxDefs::QImageMode)
     508            || vboxGlobal().vmRenderMode() == VBoxDefs::QImageMode
     509            || vboxGlobal().vmRenderMode() == VBoxDefs::SDLMode)
    506510        {
    507511            Assert(m_pFrameBuffer == uisession()->frameBuffer(screenId()));
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