Changeset 41404 in vbox
- Timestamp:
- May 22, 2012 4:41:38 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h
r36843 r41404 42 42 #define SHCRGL_HOST_FN_CRHGSMI_CTL (11) 43 43 #endif 44 #define SHCRGL_HOST_FN_VIEWPORT_CHANGED (15) 44 45 #define SHCRGL_HOST_FN_SET_OUTPUT_REDIRECT (20) 45 46 /* crOpenGL guest functions */ … … 67 68 #define SHCRGL_CPARMS_WRITE_READ_BUFFERED (3) 68 69 #define SHCRGL_CPARMS_SET_OUTPUT_REDIRECT (1) 69 70 #define SHCRGL_CPARMS_VIEWPORT_CHANGED (5) 70 71 71 72 /* @todo Move to H3DOR.h begin */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r41107 r41404 791 791 } 792 792 793 void UIMachineView::scrollContentsBy(int dx, int dy) 794 { 793 795 #ifdef VBOX_WITH_VIDEOHWACCEL 794 void UIMachineView::scrollContentsBy(int dx, int dy)795 {796 796 if (m_pFrameBuffer) 797 797 { 798 798 m_pFrameBuffer->viewportScrolled(dx, dy); 799 799 } 800 #endif /* VBOX_WITH_VIDEOHWACCEL */ 800 801 QAbstractScrollArea::scrollContentsBy(dx, dy); 801 } 802 #endif /* VBOX_WITH_VIDEOHWACCEL */ 802 803 session().GetConsole().GetDisplay().ViewportChanged(screenId(), 804 contentsX(), 805 contentsY(), 806 contentsWidth(), 807 contentsHeight()); 808 } 809 803 810 804 811 #ifdef Q_WS_MAC … … 1003 1010 bool UIMachineView::eventFilter(QObject *pWatched, QEvent *pEvent) 1004 1011 { 1005 #ifdef VBOX_WITH_VIDEOHWACCEL1006 1012 if (pWatched == viewport()) 1007 1013 { … … 1010 1016 case QEvent::Resize: 1011 1017 { 1018 QResizeEvent* pResizeEvent = static_cast<QResizeEvent*>(pEvent); 1019 #ifdef VBOX_WITH_VIDEOHWACCEL 1012 1020 if (m_pFrameBuffer) 1013 m_pFrameBuffer->viewportResized(static_cast<QResizeEvent*>(pEvent)); 1021 m_pFrameBuffer->viewportResized(pResizeEvent); 1022 #endif /* VBOX_WITH_VIDEOHWACCEL */ 1023 session().GetConsole().GetDisplay().ViewportChanged(screenId(), 1024 contentsX(), 1025 contentsY(), 1026 contentsWidth(), 1027 contentsHeight()); 1014 1028 break; 1015 1029 } … … 1018 1032 } 1019 1033 } 1020 #endif /* VBOX_WITH_VIDEOHWACCEL */1021 1034 if (pWatched == machineWindow()) 1022 1035 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r41107 r41404 165 165 void scrollBy(int dx, int dy); 166 166 static void dimImage(QImage &img); 167 #ifdef VBOX_WITH_VIDEOHWACCEL168 167 void scrollContentsBy(int dx, int dy); 169 #endif /* VBOX_WITH_VIDEOHWACCEL */170 168 #ifdef Q_WS_MAC 171 169 void updateDockIcon(); -
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r41380 r41404 169 169 170 170 typedef struct { 171 int32_t x, y; 172 uint32_t w, h; 173 } CRScreenViewportInfo; 174 175 176 typedef struct { 171 177 unsigned short tcpip_port; 172 178 173 179 CRScreenInfo screen[CR_MAX_GUEST_MONITORS]; 180 CRScreenViewportInfo screenVieport[CR_MAX_GUEST_MONITORS]; 174 181 int screenCount; 175 182 … … 312 319 extern DECLEXPORT(int32_t) crVBoxServerOutputRedirectSet(const CROutputRedirect *pCallbacks); 313 320 321 extern DECLEXPORT(int32_t) crVBoxServerSetScreenViewport(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h); 322 314 323 #ifdef VBOX_WITH_CRHGSMI 315 324 /* We moved all CrHgsmi command processing to crserverlib to keep the logic of dealing with CrHgsmi commands in one place. -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r41128 r41404 1133 1133 rc = VINF_SUCCESS; 1134 1134 } 1135 break; 1136 } 1137 case SHCRGL_HOST_FN_VIEWPORT_CHANGED: 1138 { 1139 Log(("svcCall: SHCRGL_HOST_FN_VIEWPORT_CHANGED\n")); 1140 1141 /* Verify parameter count and types. */ 1142 if (cParms != SHCRGL_CPARMS_VIEWPORT_CHANGED) 1143 { 1144 LogRel(("SHCRGL_HOST_FN_VIEWPORT_CHANGED: cParms invalid - %d", cParms)); 1145 rc = VERR_INVALID_PARAMETER; 1146 break; 1147 } 1148 1149 for (int i = 0; i < SHCRGL_CPARMS_VIEWPORT_CHANGED; ++i) 1150 { 1151 if (paParms[i].type != VBOX_HGCM_SVC_PARM_32BIT) 1152 { 1153 LogRel(("SHCRGL_HOST_FN_VIEWPORT_CHANGED: param[%d] type invalid - %d", i, paParms[i].type)); 1154 rc = VERR_INVALID_PARAMETER; 1155 break; 1156 } 1157 } 1158 1159 if (!RT_SUCCESS(rc)) 1160 { 1161 LogRel(("SHCRGL_HOST_FN_VIEWPORT_CHANGED: param validation failed, returning..")); 1162 break; 1163 } 1164 1165 rc = crVBoxServerSetScreenViewport((int)paParms[0].u.uint32, 1166 paParms[1].u.uint32, /* x */ 1167 paParms[2].u.uint32, /* y */ 1168 paParms[3].u.uint32, /* w */ 1169 paParms[4].u.uint32 /* h */); 1170 if (!RT_SUCCESS(rc)) 1171 { 1172 LogRel(("SHCRGL_HOST_FN_VIEWPORT_CHANGED: crVBoxServerSetScreenViewport failed, rc %d", rc)); 1173 break; 1174 } 1175 1135 1176 break; 1136 1177 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r41380 r41404 1389 1389 } 1390 1390 1391 static void crVBoxServerUpdateScreenViewportCB(unsigned long key, void *data1, void *data2) 1392 { 1393 CRMuralInfo *mural = (CRMuralInfo*) data1; 1394 int *sIndex = (int*) data2; 1395 1396 if (mural->screenId != sIndex) 1397 return; 1398 1399 if (!mural->width || !mural->height) 1400 return; 1401 1402 crServerCheckMuralGeometry(mural); 1403 } 1404 1405 1406 DECLEXPORT(int32_t) crVBoxServerSetScreenViewport(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h) 1407 { 1408 CRScreenViewportInfo *pVieport; 1409 GLboolean fPosChanged, fSizeChanged; 1410 1411 crDebug("crVBoxServerSetScreenViewport(%i)", sIndex); 1412 1413 if (sIndex<0 || sIndex>=cr_server.screenCount) 1414 { 1415 crWarning("crVBoxServerSetScreenViewport: invalid screen id %d", sIndex); 1416 return VERR_INVALID_PARAMETER; 1417 } 1418 1419 pVieport = &cr_server.screenVieport[sIndex]; 1420 fPosChanged = (pVieport->x != x || pVieport->y != y); 1421 fSizeChanged = (pVieport->w != w || pVieport->h != h); 1422 1423 if (!fPosChanged && !fSizeChanged) 1424 { 1425 crDebug("crVBoxServerSetScreenViewport: no changes"); 1426 return; 1427 } 1428 1429 if (fPosChanged) 1430 { 1431 pVieport->x = x; 1432 pVieport->y = y; 1433 1434 crHashtableWalk(cr_server.muralTable, crVBoxServerUpdateScreenViewportCB, NULL); 1435 } 1436 1437 if (fSizeChanged) 1438 { 1439 pVieport->w = w; 1440 pVieport->h = h; 1441 1442 /* no need to do anything here actually */ 1443 } 1444 return VINF_SUCCESS; 1445 } 1446 1391 1447 1392 1448 #ifdef VBOX_WITH_CRHGSMI -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c
r41258 r41404 103 103 if (cr_server.screenCount<2 && !cr_server.bForceOffscreenRendering) 104 104 { 105 CRScreenViewportInfo *pVieport = &cr_server.screenVieport[mural->screenId]; 105 106 CRASSERT(cr_server.screenCount>0); 106 107 … … 108 109 mural->hY = mural->gY-cr_server.screen[0].y; 109 110 110 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX , mural->hY);111 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX - pVieport->x, mural->hY - pVieport->y); 111 112 112 113 return; … … 157 158 if (overlappingScreenCount<2 && !cr_server.bForceOffscreenRendering) 158 159 { 160 CRScreenViewportInfo *pVieport = &cr_server.screenVieport[mural->screenId]; 161 159 162 if (mural->bUseFBO) 160 163 { … … 163 166 } 164 167 165 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX , mural->hY);168 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX - pVieport->x, mural->hY - pVieport->y); 166 169 } 167 170 else … … 193 196 if (!mural->bUseFBO) 194 197 { 195 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX, mural->hY); 198 CRScreenViewportInfo *pVieport = &cr_server.screenVieport[mural->screenId]; 199 200 cr_server.head_spu->dispatch_table.WindowPosition(mural->spuWindow, mural->hX - pVieport->x, mural->hY - pVieport->y); 196 201 } 197 202 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r41137 r41404 12582 12582 <interface 12583 12583 name="IDisplay" extends="$unknown" 12584 uuid=" 09EED313-CD56-4D06-BD56-FAC0F716B5DD"12584 uuid="4b75c45c-e22e-4b75-b7cd-7ce9a83bb36e" 12585 12585 wsmap="managed" 12586 12586 > … … 12844 12844 </method> 12845 12845 12846 <method name="viewportChanged"> 12847 <desc> 12848 Signals that framebuffer window viewport has changed. 12849 12850 <result name="E_INVALIDARG"> 12851 The specified viewport data is invalid. 12852 </result> 12853 12854 </desc> 12855 12856 <param name="screenId" type="unsigned long" dir="in"> 12857 <desc> 12858 Monitor to take the screenshot from. 12859 </desc> 12860 </param> 12861 <param name="x" type="unsigned long" dir="in"> 12862 <desc> 12863 Framebuffer x offset. 12864 </desc> 12865 </param> 12866 <param name="y" type="unsigned long" dir="in"> 12867 <desc> 12868 Framebuffer y offset. 12869 </desc> 12870 </param> 12871 <param name="width" type="unsigned long" dir="in"> 12872 <desc> 12873 Viewport width. 12874 </desc> 12875 </param> 12876 <param name="height" type="unsigned long" dir="in"> 12877 <desc> 12878 Viewport height. 12879 </desc> 12880 </param> 12881 </method> 12846 12882 </interface> 12847 12883 -
trunk/src/VBox/Main/include/DisplayImpl.h
r39603 r41404 172 172 STDMETHOD(CompleteVHWACommand)(BYTE *pCommand); 173 173 174 STDMETHOD(ViewportChanged)(ULONG aScreenId, ULONG x, ULONG y, ULONG width, ULONG height); 175 174 176 static const PDMDRVREG DrvReg; 175 177 -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r41240 r41404 2863 2863 return E_NOTIMPL; 2864 2864 #endif 2865 } 2866 2867 STDMETHODIMP Display::ViewportChanged(ULONG aScreenId, ULONG x, ULONG y, ULONG width, ULONG height) 2868 { 2869 #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL) 2870 BOOL is3denabled; 2871 mParent->machine()->COMGETTER(Accelerate3DEnabled)(&is3denabled); 2872 2873 if (is3denabled) 2874 { 2875 VBOXHGCMSVCPARM aParms[5]; 2876 2877 aParms[0].type = VBOX_HGCM_SVC_PARM_32BIT; 2878 aParms[0].u.uint32 = aScreenId; 2879 2880 aParms[1].type = VBOX_HGCM_SVC_PARM_32BIT; 2881 aParms[1].u.uint32 = x; 2882 2883 aParms[2].type = VBOX_HGCM_SVC_PARM_32BIT; 2884 aParms[2].u.uint32 = y; 2885 2886 2887 aParms[3].type = VBOX_HGCM_SVC_PARM_32BIT; 2888 aParms[3].u.uint32 = width; 2889 2890 aParms[4].type = VBOX_HGCM_SVC_PARM_32BIT; 2891 aParms[4].u.uint32 = height; 2892 2893 VMMDev *pVMMDev = mParent->getVMMDev(); 2894 2895 if (pVMMDev) 2896 pVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_VIEWPORT_CHANGED, SHCRGL_CPARMS_VIEWPORT_CHANGED, aParms); 2897 } 2898 #endif /* VBOX_WITH_CROGL && VBOX_WITH_HGCM */ 2899 return S_OK; 2865 2900 } 2866 2901
Note:
See TracChangeset
for help on using the changeset viewer.