Changeset 54582 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/render
- Timestamp:
- Mar 2, 2015 3:42:16 PM (10 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/render
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r52641 r54582 1868 1868 } 1869 1869 1870 DECLEXPORT(void) renderspuSetUnscaledHiDPI(bool fEnable) 1871 { 1872 render_spu.fUnscaledHiDPI = fEnable; 1873 } 1874 1870 1875 #define FILLIN( NAME, FUNC ) \ 1871 1876 table[i].name = crStrdup(NAME); \ -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
r52560 r54582 348 348 # endif 349 349 #endif /* RT_OS_DARWIN */ 350 /* If TRUE, render should tell window server to prevent artificial content 351 * up-scaling when displayed on HiDPI monitor. */ 352 bool fUnscaledHiDPI; 350 353 } RenderSPU; 351 354 … … 495 498 DECLEXPORT(void) renderspuSetWindowId(uint64_t winId); 496 499 DECLEXPORT(void) renderspuReparentWindow(GLint window); 500 DECLEXPORT(void) renderspuSetUnscaledHiDPI(bool fEnable); 497 501 #ifdef __cplusplus 498 502 } -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
r54466 r54582 1429 1429 1430 1430 self = [super initWithFrame:frame]; 1431 #ifdef VBOX_WITH_CONFIGURABLE_HIDPI_SCALING 1432 [self performSelector:@selector(setWantsBestResolutionOpenGLSurface:) withObject: (id)YES]; 1431 #if defined(VBOX_WITH_CONFIGURABLE_HIDPI_SCALING) && !defined(IN_VMSVGA3D) 1432 crDebug("HiDPI: up-scaling is %s on NSView init.", render_spu.fUnscaledHiDPI ? "OFF" : "ON"); 1433 if (render_spu.fUnscaledHiDPI) 1434 [self performSelector:@selector(setWantsBestResolutionOpenGLSurface:) withObject: (id)YES]; 1433 1435 #endif 1434 1436 … … 2366 2368 2367 2369 float backingStretchFactor = 1.; 2368 #if def VBOX_WITH_CONFIGURABLE_HIDPI_SCALING2370 #if defined(VBOX_WITH_CONFIGURABLE_HIDPI_SCALING) && !defined(IN_VMSVGA3D) 2369 2371 /* Adjust viewport according to current NSView's backing store parameters. */ 2370 NSRect regularBounds = [self bounds]; 2371 NSRect backingBounds = [self safeConvertRectToBacking:®ularBounds]; 2372 glViewport(0, 0, backingBounds.size.width, backingBounds.size.height); 2373 2374 /* Update strech factor in order to satisfy current NSView's backing store parameters. */ 2375 backingStretchFactor = [self safeGetBackingScaleFactor]; 2372 crDebug("HiDPI: vboxPresentToViewCS: up-scaling is %s.", render_spu.fUnscaledHiDPI ? "OFF" : "ON"); 2373 if (render_spu.fUnscaledHiDPI) 2374 { 2375 NSRect regularBounds = [self bounds]; 2376 NSRect backingBounds = [self safeConvertRectToBacking:®ularBounds]; 2377 glViewport(0, 0, backingBounds.size.width, backingBounds.size.height); 2378 2379 /* Update stretch factor in order to satisfy current NSView's backing store parameters. */ 2380 backingStretchFactor = [self safeGetBackingScaleFactor]; 2381 } 2382 else 2383 backingStretchFactor = 1.; 2376 2384 #endif 2377 2385
Note:
See TracChangeset
for help on using the changeset viewer.