Changeset 98848 in vbox
- Timestamp:
- Mar 7, 2023 7:55:33 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156171
- 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 33 33 34 34 /* GUI includes: */ 35 #include "UIActionPool.h"36 35 #include "UIActionPoolRuntime.h" 36 #include "UICommon.h" 37 #include "UIExtraDataManager.h" 37 38 #include "UIFrameBuffer.h" 38 #include "UISession.h"39 39 #include "UIMachine.h" 40 40 #include "UIMachineLogic.h" 41 #include "UIMachineView.h" 41 42 #include "UIMachineWindow.h" 42 #include "UIMachineView.h"43 43 #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" 52 45 53 46 /* COM includes: */ 54 #include "CConsole.h"55 47 #include "CDisplay.h" 56 48 #include "CFramebuffer.h" … … 66 58 /* Other includes: */ 67 59 #include <math.h> 68 69 60 #ifdef VBOX_WS_X11 70 /* X11 includes: */71 61 # include <X11/Xlib.h> 72 62 # undef Bool // Qt5 vs Xlib gift.. … … 82 72 // #include <iprt/stdint.h> 83 73 // #include <iprt/win/windows.h> 84 # include <QOffscreenSurface>85 # include <QOpenGLFunctions>86 # include <QOpenGLTexture>87 # include <QOpenGLWidget>88 89 # ifdef RT_OS_LINUX74 # include <QOffscreenSurface> 75 # include <QOpenGLFunctions> 76 # include <QOpenGLTexture> 77 # include <QOpenGLWidget> 78 79 # ifdef RT_OS_LINUX 90 80 /* 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 # endif81 # include <GL/glx.h> 82 # endif 93 83 94 84 class UIFrameBufferPrivate; … … 232 222 GLuint m_guestTexture; 233 223 }; 224 225 /* End of experimental code. */ 234 226 #endif /* VBOX_GUI_WITH_QTGLFRAMEBUFFER */ 227 235 228 236 229 /** IFramebuffer implementation used to maintain VM display video memory. */ … … 252 245 public: 253 246 254 /** Frame-buffer constructor. */247 /** Constructs frame-buffer. */ 255 248 UIFrameBufferPrivate(); 256 /** Frame-buffer destructor. */257 ~UIFrameBufferPrivate();249 /** Destructs frame-buffer. */ 250 virtual ~UIFrameBufferPrivate() RT_OVERRIDE; 258 251 259 252 /** Frame-buffer initialization. … … 284 277 /** Returns default frame-buffer pixel-format. */ 285 278 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; }288 279 289 280 /** Defines whether frame-buffer is <b>unused</b>. … … 1098 1089 #endif 1099 1090 { 1091 LogRel2(("GUI: UIFrameBufferPrivate::UIFrameBufferPrivate %p\n", this)); 1092 1100 1093 /* Update coordinate-system: */ 1101 1094 updateCoordinateSystem(); 1102 1095 } 1103 1096 1097 UIFrameBufferPrivate::~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 1104 1109 HRESULT UIFrameBufferPrivate::init(UIMachineView *pMachineView) 1105 1110 { … … 1110 1115 1111 1116 /* Assign display: */ 1112 m_comDisplay = m_pMachineView->uimachine()->uisession()->display();1117 m_comDisplay = gpMachine->uisession()->display(); 1113 1118 1114 1119 /* Initialize critical-section: */ … … 1125 1130 1126 1131 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);1139 1132 } 1140 1133 … … 1176 1169 void UIFrameBufferPrivate::detach() 1177 1170 { 1178 CFramebuffer frameBuffer = display().QueryFramebuffer(m_uScreenId);1179 if (! frameBuffer.isNull())1171 CFramebuffer comFramebuffer = display().QueryFramebuffer(m_uScreenId); 1172 if (!comFramebuffer.isNull()) 1180 1173 { 1181 1174 display().DetachFramebuffer(m_uScreenId, m_uFramebufferId); … … 2345 2338 } 2346 2339 2347 uchar *UIFrameBuffer::address()2340 uchar *UIFrameBuffer::address() 2348 2341 { 2349 2342 return m_pFrameBuffer->address(); … … 2368 2361 { 2369 2362 return m_pFrameBuffer->bytesPerLine(); 2370 }2371 2372 UIVisualStateType UIFrameBuffer::visualState() const2373 {2374 return m_pFrameBuffer->visualState();2375 2363 } 2376 2364 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r98841 r98848 76 76 77 77 /** Returns frame-buffer data address. */ 78 uchar *address();78 uchar *address(); 79 79 /** Returns frame-buffer width. */ 80 80 ulong width() const; … … 85 85 /** Returns frame-buffer bytes-per-line value. */ 86 86 ulong bytesPerLine() const; 87 /** Returns the visual-state this frame-buffer is used for. */88 UIVisualStateType visualState() const;89 87 90 88 /** Defines whether frame-buffer is <b>unused</b>. … … 148 146 149 147 /** Holds the frame-buffer private instance. */ 150 ComObjPtr<UIFrameBufferPrivate> m_pFrameBuffer;148 ComObjPtr<UIFrameBufferPrivate> m_pFrameBuffer; 151 149 152 150 /** Holds whether frame-buffer was initialized already. */
Note:
See TracChangeset
for help on using the changeset viewer.