VirtualBox

Changeset 98848 in vbox


Ignore:
Timestamp:
Mar 7, 2023 7:55:33 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156171
Message:

FE/Qt: bugref:10322: Runtime UI: Small cleanup for UIFrameBuffer class.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
2 edited

Legend:

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

    r98841 r98848  
    3333
    3434/* GUI includes: */
    35 #include "UIActionPool.h"
    3635#include "UIActionPoolRuntime.h"
     36#include "UICommon.h"
     37#include "UIExtraDataManager.h"
    3738#include "UIFrameBuffer.h"
    38 #include "UISession.h"
    3939#include "UIMachine.h"
    4040#include "UIMachineLogic.h"
     41#include "UIMachineView.h"
    4142#include "UIMachineWindow.h"
    42 #include "UIMachineView.h"
    4343#include "UINotificationCenter.h"
    44 #include "UIExtraDataManager.h"
    45 #include "UICommon.h"
    46 #ifdef VBOX_WITH_MASKED_SEAMLESS
    47 # include "UIMachineWindow.h"
    48 #endif /* VBOX_WITH_MASKED_SEAMLESS */
    49 #ifdef VBOX_WS_X11
    50 # include "VBoxUtils-x11.h"
    51 #endif
     44#include "UISession.h"
    5245
    5346/* COM includes: */
    54 #include "CConsole.h"
    5547#include "CDisplay.h"
    5648#include "CFramebuffer.h"
     
    6658/* Other includes: */
    6759#include <math.h>
    68 
    6960#ifdef VBOX_WS_X11
    70 /* X11 includes: */
    7161# include <X11/Xlib.h>
    7262# undef Bool // Qt5 vs Xlib gift..
     
    8272// #include <iprt/stdint.h>
    8373// #include <iprt/win/windows.h>
    84 #include <QOffscreenSurface>
    85 #include <QOpenGLFunctions>
    86 #include <QOpenGLTexture>
    87 #include <QOpenGLWidget>
    88 
    89 # ifdef RT_OS_LINUX
     74# include <QOffscreenSurface>
     75# include <QOpenGLFunctions>
     76# include <QOpenGLTexture>
     77# include <QOpenGLWidget>
     78
     79#  ifdef RT_OS_LINUX
    9080/* GL/glx.h must be included after Qt GL headers (which define GL_GLEXT_LEGACY) to avoid GL_GLEXT_VERSION conflict. */
    91 #include <GL/glx.h>
    92 # endif
     81#   include <GL/glx.h>
     82#  endif
    9383
    9484class UIFrameBufferPrivate;
     
    232222    GLuint m_guestTexture;
    233223};
     224
     225/* End of experimental code. */
    234226#endif /* VBOX_GUI_WITH_QTGLFRAMEBUFFER */
     227
    235228
    236229/** IFramebuffer implementation used to maintain VM display video memory. */
     
    252245public:
    253246
    254     /** Frame-buffer constructor. */
     247    /** Constructs frame-buffer. */
    255248    UIFrameBufferPrivate();
    256     /** Frame-buffer destructor. */
    257     ~UIFrameBufferPrivate();
     249    /** Destructs frame-buffer. */
     250    virtual ~UIFrameBufferPrivate() RT_OVERRIDE;
    258251
    259252    /** Frame-buffer initialization.
     
    284277    /** Returns default frame-buffer pixel-format. */
    285278    ulong pixelFormat() const { return KBitmapFormat_BGR; }
    286     /** Returns the visual-state this frame-buffer is used for. */
    287     UIVisualStateType visualState() const { return m_pMachineView ? m_pMachineView->visualStateType() : UIVisualStateType_Invalid; }
    288279
    289280    /** Defines whether frame-buffer is <b>unused</b>.
     
    10981089#endif
    10991090{
     1091    LogRel2(("GUI: UIFrameBufferPrivate::UIFrameBufferPrivate %p\n", this));
     1092
    11001093    /* Update coordinate-system: */
    11011094    updateCoordinateSystem();
    11021095}
    11031096
     1097UIFrameBufferPrivate::~UIFrameBufferPrivate()
     1098{
     1099    LogRel2(("GUI: UIFrameBufferPrivate::~UIFrameBufferPrivate %p\n", this));
     1100
     1101    /* Disconnect handlers: */
     1102    if (m_pMachineView)
     1103        cleanupConnections();
     1104
     1105    /* Deinitialize critical-section: */
     1106    RTCritSectDelete(&m_critSect);
     1107}
     1108
    11041109HRESULT UIFrameBufferPrivate::init(UIMachineView *pMachineView)
    11051110{
     
    11101115
    11111116    /* Assign display: */
    1112     m_comDisplay = m_pMachineView->uimachine()->uisession()->display();
     1117    m_comDisplay = gpMachine->uisession()->display();
    11131118
    11141119    /* Initialize critical-section: */
     
    11251130
    11261131    return S_OK;
    1127 }
    1128 
    1129 UIFrameBufferPrivate::~UIFrameBufferPrivate()
    1130 {
    1131     LogRel2(("GUI: UIFrameBufferPrivate::~UIFrameBufferPrivate %p\n", this));
    1132 
    1133     /* Disconnect handlers: */
    1134     if (m_pMachineView)
    1135         cleanupConnections();
    1136 
    1137     /* Deinitialize critical-section: */
    1138     RTCritSectDelete(&m_critSect);
    11391132}
    11401133
     
    11761169void UIFrameBufferPrivate::detach()
    11771170{
    1178     CFramebuffer frameBuffer = display().QueryFramebuffer(m_uScreenId);
    1179     if (!frameBuffer.isNull())
     1171    CFramebuffer comFramebuffer = display().QueryFramebuffer(m_uScreenId);
     1172    if (!comFramebuffer.isNull())
    11801173    {
    11811174        display().DetachFramebuffer(m_uScreenId, m_uFramebufferId);
     
    23452338}
    23462339
    2347 uchar* UIFrameBuffer::address()
     2340uchar *UIFrameBuffer::address()
    23482341{
    23492342    return m_pFrameBuffer->address();
     
    23682361{
    23692362    return m_pFrameBuffer->bytesPerLine();
    2370 }
    2371 
    2372 UIVisualStateType UIFrameBuffer::visualState() const
    2373 {
    2374     return m_pFrameBuffer->visualState();
    23752363}
    23762364
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h

    r98841 r98848  
    7676
    7777    /** Returns frame-buffer data address. */
    78     uchar* address();
     78    uchar *address();
    7979    /** Returns frame-buffer width. */
    8080    ulong width() const;
     
    8585    /** Returns frame-buffer bytes-per-line value. */
    8686    ulong bytesPerLine() const;
    87     /** Returns the visual-state this frame-buffer is used for. */
    88     UIVisualStateType visualState() const;
    8987
    9088    /** Defines whether frame-buffer is <b>unused</b>.
     
    148146
    149147    /** Holds the frame-buffer private instance. */
    150     ComObjPtr<UIFrameBufferPrivate> m_pFrameBuffer;
     148    ComObjPtr<UIFrameBufferPrivate>  m_pFrameBuffer;
    151149
    152150    /** Holds whether frame-buffer was initialized already. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette