Changeset 27697 in vbox
- Timestamp:
- Mar 25, 2010 11:57:38 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59293
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r27682 r27697 4184 4184 } 4185 4185 4186 void VBoxQGLOverlay::updateAttachment(QWidget *pViewport, QObject *pPostEventObject) 4187 { 4188 mCmdPipe.updatePostEventObject(pPostEventObject); 4189 if (mpViewport != pViewport) 4190 { 4191 mpViewport = pViewport; 4192 mpOverlayWgt = NULL; 4193 mOverlayWidgetVisible = false; 4194 initGl(); 4195 vboxDoCheckUpdateViewport(); 4196 mGlCurrent = false; 4197 } 4198 } 4199 4186 4200 int VBoxQGLOverlay::reset() 4187 4201 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r27682 r27697 1303 1303 class VBoxVHWACommandElement * detachCmdList(class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free); 1304 1304 void reset(class VBoxVHWACommandElement ** ppHead, class VBoxVHWACommandElement ** ppTail); 1305 void updatePostEventObject(QObject *m_pObject) { m_pParent = m_pObject; } 1305 1306 private: 1306 1307 RTCRITSECT mCritSect; … … 1677 1678 } 1678 1679 1679 void update Viewport(QWidget *pViewport);1680 void updateAttachment(QWidget *pViewport, QObject *pPostEventObject); 1680 1681 1681 1682 int onVHWACommand (struct _VBOXVHWACMD * pCommand); … … 1822 1823 { 1823 1824 public: 1825 VBoxOverlayFrameBuffer (V *pView, VBoxQGLOverlay *pOverlay, CSession * aSession) 1826 : T (pView), 1827 mpOverlay (pOverlay), 1828 mpView (pView) 1829 {} 1830 1824 1831 VBoxOverlayFrameBuffer (V *pView, QWidget *pWidget, CSession * aSession) 1825 1832 : T (pView), 1826 m Overlay (pWidget, pView, aSession),1833 mpOverlay (new VBoxQGLOverlay(pWidget, pView, aSession)), 1827 1834 mpView (pView) 1828 1835 {} … … 1831 1838 STDMETHOD(ProcessVHWACommand)(BYTE *pCommand) 1832 1839 { 1833 return m Overlay.onVHWACommand ((struct _VBOXVHWACMD*)pCommand);1840 return mpOverlay->onVHWACommand ((struct _VBOXVHWACMD*)pCommand); 1834 1841 } 1835 1842 1836 1843 void doProcessVHWACommand (QEvent * pEvent) 1837 1844 { 1838 m Overlay.onVHWACommandEvent (pEvent);1845 mpOverlay->onVHWACommandEvent (pEvent); 1839 1846 } 1840 1847 … … 1844 1851 BOOL *aFinished) 1845 1852 { 1846 if (m Overlay.onRequestResize (aScreenId, aPixelFormat,1853 if (mpOverlay->onRequestResize (aScreenId, aPixelFormat, 1847 1854 aVRAM, aBitsPerPixel, aBytesPerLine, 1848 1855 aWidth, aHeight, … … 1860 1867 ULONG aW, ULONG aH) 1861 1868 { 1862 if (m Overlay.onNotifyUpdate (aX, aY, aW, aH))1869 if (mpOverlay->onNotifyUpdate (aX, aY, aW, aH)) 1863 1870 return S_OK; 1864 1871 return T::NotifyUpdate (aX, aY, aW, aH); … … 1868 1875 { 1869 1876 T::resizeEvent (re); 1870 m Overlay.onResizeEventPostprocess (VBoxFBSizeInfo(re),1877 mpOverlay->onResizeEventPostprocess (VBoxFBSizeInfo(re), 1871 1878 QPoint(mpView->contentsX(), mpView->contentsY())); 1872 1879 } … … 1874 1881 void viewportResized (QResizeEvent * re) 1875 1882 { 1876 m Overlay.onViewportResized (re);1883 mpOverlay->onViewportResized (re); 1877 1884 T::viewportResized (re); 1878 1885 } … … 1880 1887 void viewportScrolled (int dx, int dy) 1881 1888 { 1882 m Overlay.onViewportScrolled (QPoint(mpView->contentsX(), mpView->contentsY()));1889 mpOverlay->onViewportScrolled (QPoint(mpView->contentsX(), mpView->contentsY())); 1883 1890 T::viewportScrolled (dx, dy); 1884 1891 } 1885 1892 private: 1886 VBoxQGLOverlay mOverlay;1893 VBoxQGLOverlay *mpOverlay; 1887 1894 V *mpView; 1888 1895 }; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r27683 r27697 488 488 case VBoxDefs::QImageMode: 489 489 # ifdef VBOX_WITH_VIDEOHWACCEL 490 /* these two additional template args is a workaround to this [VBox|UI] duplication 491 * @todo: they are to be removed once VBox stuff is gone */ 492 m_pFrameBuffer = m_fAccelerate2DVideo ? new VBoxOverlayFrameBuffer<UIFrameBufferQImage, UIMachineView, UIResizeEvent>(this, viewport(), &machineWindowWrapper()->session()) : new UIFrameBufferQImage(this); 490 if (m_fAccelerate2DVideo) 491 { 492 class VBoxQGLOverlay* pOverlay = uisession()->overlayForScreen(screenId()); 493 pOverlay->updateAttachment(viewport(), this); 494 /* these two additional template args is a workaround to this [VBox|UI] duplication 495 * @todo: they are to be removed once VBox stuff is gone */ 496 m_pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQImage, UIMachineView, UIResizeEvent>(this, pOverlay, &machineWindowWrapper()->session()); 497 } 498 else 499 m_pFrameBuffer = new UIFrameBufferQImage(this); 493 500 # else 494 501 m_pFrameBuffer = new UIFrameBufferQImage(this); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r27622 r27697 36 36 #include "VBoxProblemReporter.h" 37 37 #include "UIFirstRunWzd.h" 38 #ifdef VBOX_WITH_VIDEOHWACCEL 39 # include "VBoxFBOverlay.h" 40 #endif 38 41 39 42 #ifdef Q_WS_X11 … … 1488 1491 } 1489 1492 1493 #ifdef VBOX_WITH_VIDEOHWACCEL 1494 /* 2D video overlay state + API */ 1495 class VBoxQGLOverlay* UISession::overlayForScreen(ulong screenId) 1496 { 1497 /* durty hack to fill the list as needed */ 1498 if (m_OverlaysList.size() <= (int)screenId) 1499 { 1500 for (int i = m_OverlaysList.size(); i <= (int)screenId; ++i) 1501 m_OverlaysList.append(new VBoxQGLOverlay((QWidget *)NULL, (QObject *)NULL, &m_session)); 1502 } 1503 return m_OverlaysList.at((int)screenId); 1504 } 1505 #endif -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r27376 r27697 140 140 void setMouseIntegrated(bool fIsMouseIntegrated) { m_fIsMouseIntegrated = fIsMouseIntegrated; } 141 141 142 #ifdef VBOX_WITH_VIDEOHWACCEL 143 /* 2D video overlay state + API */ 144 class VBoxQGLOverlay* overlayForScreen(ulong screenId); 145 #endif 146 142 147 signals: 143 148 … … 203 208 UIMachineMenuBar *m_pMenuPool; 204 209 210 #ifdef VBOX_WITH_VIDEOHWACCEL 211 /* 2D video overlay state + API 212 * this does not get re-created on mode change 213 * Each screen has its own Overlay state */ 214 QList<class VBoxQGLOverlay*> m_OverlaysList; 215 #endif 216 205 217 /* Common variables: */ 206 218 KMachineState m_machineState;
Note:
See TracChangeset
for help on using the changeset viewer.