VirtualBox

Ignore:
Timestamp:
Mar 2, 2015 3:42:16 PM (10 years ago)
Author:
vboxsync
Message:

Host 3D unscaled HiDPI output: privide notifyHiDPIOutputPolicyChange() IDisplay interface to GUI in ouder to notify 3D about corresponding user option value change.

Location:
trunk/src/VBox/HostServices/SharedOpenGL/render
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    r52641 r54582  
    18681868}
    18691869
     1870DECLEXPORT(void) renderspuSetUnscaledHiDPI(bool fEnable)
     1871{
     1872    render_spu.fUnscaledHiDPI = fEnable;
     1873}
     1874
    18701875#define FILLIN( NAME, FUNC ) \
    18711876  table[i].name = crStrdup(NAME); \
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r52560 r54582  
    348348# endif
    349349#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;
    350353} RenderSPU;
    351354
     
    495498DECLEXPORT(void) renderspuSetWindowId(uint64_t winId);
    496499DECLEXPORT(void) renderspuReparentWindow(GLint window);
     500DECLEXPORT(void) renderspuSetUnscaledHiDPI(bool fEnable);
    497501#ifdef __cplusplus
    498502}
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m

    r54466 r54582  
    14291429   
    14301430    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];
    14331435#endif
    14341436
     
    23662368
    23672369    float backingStretchFactor = 1.;
    2368 #ifdef VBOX_WITH_CONFIGURABLE_HIDPI_SCALING
     2370#if defined(VBOX_WITH_CONFIGURABLE_HIDPI_SCALING) && !defined(IN_VMSVGA3D)
    23692371    /* Adjust viewport according to current NSView's backing store parameters. */
    2370     NSRect regularBounds = [self bounds];
    2371     NSRect backingBounds = [self safeConvertRectToBacking:&regularBounds];
    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:&regularBounds];
     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.;
    23762384#endif
    23772385
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette