Changeset 53847 in vbox for trunk/src/VBox/HostServices/SharedOpenGL
- Timestamp:
- Jan 16, 2015 8:53:12 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97665
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r53103 r53847 38 38 #include <VBox/HostServices/VBoxCrOpenGLSvc.h> 39 39 #include <VBox/vmm/ssm.h> 40 #include <VBox/VBoxOGL.h> 40 41 41 42 #include "cr_mem.h" … … 1366 1367 break; 1367 1368 } 1369 case SHCRGL_HOST_FN_SET_SCALE_FACTOR: 1370 { 1371 /* Verify parameter count and types. */ 1372 if (cParms != 1 1373 || paParms[0].type != VBOX_HGCM_SVC_PARM_PTR 1374 || paParms[0].u.pointer.size != sizeof(CRVBOXHGCMSETSCALEFACTOR) 1375 || !paParms[0].u.pointer.addr) 1376 { 1377 WARN(("invalid parameter")); 1378 rc = VERR_INVALID_PARAMETER; 1379 break; 1380 } 1381 1382 CRVBOXHGCMSETSCALEFACTOR *pData = (CRVBOXHGCMSETSCALEFACTOR *)paParms[0].u.pointer.addr; 1383 double dScaleFactorW = (double)(pData->u32ScaleFactorWMultiplied) / VBOX_OGL_SCALE_FACTOR_MULTIPLIER; 1384 double dScaleFactorH = (double)(pData->u32ScaleFactorHMultiplied) / VBOX_OGL_SCALE_FACTOR_MULTIPLIER; 1385 1386 rc = VBoxOglSetScaleFactor(pData->u32Screen, dScaleFactorW, dScaleFactorH); 1387 1388 /* Log scaling factor rounded to nearest 'int' value (not so precise). */ 1389 LogRel(("OpenGL: Set 3D content scale factor to (%u, %u), multiplier %d.\n", 1390 pData->u32ScaleFactorWMultiplied, 1391 pData->u32ScaleFactorHMultiplied, 1392 (int)VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 1393 1394 break; 1395 } 1368 1396 default: 1369 1397 WARN(("svcHostCallPerform: unexpected u32Function %d", u32Function)); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter/server_presenter.cpp
r53158 r53847 1829 1829 } 1830 1830 1831 extern "C" DECLEXPORT(int) VBoxOglSetScaleFactor(uint32_t idScreen, double dScaleFactorW, double dScaleFactorH) 1832 { 1833 if (idScreen >= CR_MAX_GUEST_MONITORS) 1834 { 1835 WARN(("invalid idScreen %d", idScreen)); 1836 return VERR_INVALID_PARAMETER; 1837 } 1838 1839 CR_FBDISPLAY_INFO *pDpInfo = &g_CrPresenter.aDisplayInfos[idScreen]; 1840 if (pDpInfo->pDpWin) 1841 { 1842 CrFbWindow *pWin = pDpInfo->pDpWin->getWindow(); 1843 if (pWin) 1844 { 1845 bool rc; 1846 rc = pWin->SetScaleFactor((GLdouble)dScaleFactorW, (GLdouble)dScaleFactorH); 1847 return rc ? 0 : VERR_LOCK_FAILED; 1848 } 1849 } 1850 1851 return VERR_INVALID_PARAMETER; 1852 } 1853 1831 1854 int CrPMgrScreenChanged(uint32_t idScreen) 1832 1855 {
Note:
See TracChangeset
for help on using the changeset viewer.