VirtualBox

Changeset 54632 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 4, 2015 5:23:21 PM (10 years ago)
Author:
vboxsync
Message:

Mac OS X host 3D: unscaled HiDPI: always set viewport according to NSView backing store size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m

    r54599 r54632  
    23642364    VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR CIter;
    23652365    const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry;
    2366        
     2366
    23672367    CrVrScrCompositorConstIterInit(pCompositor, &CIter);
    23682368
     
    23702370#if defined(VBOX_WITH_CONFIGURABLE_HIDPI_SCALING) && !defined(IN_VMSVGA3D)
    23712371    /* Adjust viewport according to current NSView's backing store parameters. */
    2372     crDebug("HiDPI: vboxPresentToViewCS: up-scaling is %s.", render_spu.fUnscaledHiDPI ? "OFF" : "ON");
    23732372    if (render_spu.fUnscaledHiDPI)
    23742373    {
    2375         NSRect regularBounds = [self bounds];
    2376         NSRect backingBounds = [self safeConvertRectToBacking:&regularBounds];
    2377         glViewport(0, 0, backingBounds.size.width, backingBounds.size.height);
    2378 
    23792374        /* Update stretch factor in order to satisfy current NSView's backing store parameters. */
    23802375        backingStretchFactor = [self safeGetBackingScaleFactor];
    23812376    }
    2382     else
    2383         backingStretchFactor = 1.;
     2377
     2378    NSRect regularBounds = [self bounds];
     2379    NSRect backingBounds = [self safeConvertRectToBacking:&regularBounds];
     2380    glViewport(0, 0, backingBounds.size.width, backingBounds.size.height);
     2381
     2382    crDebug("HiDPI: vboxPresentToViewCS: up-scaling is %s (backingStretchFactor=%d).",
     2383        render_spu.fUnscaledHiDPI ? "OFF" : "ON", (int)backingStretchFactor);
    23842384#endif
    23852385
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