VirtualBox

Changeset 54603 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 3, 2015 5:30:55 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: 6278: Adding 3D API calls for the Unscaled HiDPI Output Mode.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r54590 r54603  
    173173void UIMachineView::applyMachineViewScaleFactor()
    174174{
    175     /* Take the scale-factor into account: */
     175    /* Take the scale-factor related attributes into account: */
    176176    const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
     177    const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
    177178    frameBuffer()->setScaleFactor(dScaleFactor);
    178     /* Propagate scale-factor to 3D service if necessary: */
     179    frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
     180    /* Propagate the scale-factor related attributes to 3D service if necessary: */
    179181    if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
    180182    {
     
    182184                                          (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),
    183185                                          (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));
    184     }
    185 
    186     /* Take unscaled HiDPI output mode into account: */
    187     const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
    188     frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
     186        display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);
     187    }
    189188
    190189    /* Perform frame-buffer rescaling: */
    191190    frameBuffer()->performRescale();
     191
     192    // TODO: How to make it work?
     193    display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight());
    192194}
    193195
     
    367369    const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
    368370    frameBuffer()->setScaleFactor(dScaleFactor);
    369     /* Propagate scale-factor to 3D service if necessary: */
     371    /* Propagate the scale-factor to 3D service if necessary: */
    370372    if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
    371373    {
     
    383385    updateScaledPausePixmap();
    384386    viewport()->update();
     387
     388    // TODO: How to make it work?
     389    display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight());
    385390}
    386391
     
    391396        return;
    392397
    393     /* Take unscaled HiDPI output mode into account: */
     398    /* Take the unscaled HiDPI output mode into account: */
    394399    const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
    395400    frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
     401    /* Propagate the unscaled HiDPI output mode to 3D service if necessary: */
     402    if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
     403    {
     404        display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);
     405    }
    396406
    397407    /* Handle scale attributes change: */
     
    403413    updateScaledPausePixmap();
    404414    viewport()->update();
     415
     416    // TODO: How to make it work?
     417    display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight());
    405418}
    406419
     
    539552        m_pFrameBuffer->setHiDPIOptimizationType(uisession()->hiDPIOptimizationType());
    540553
    541         /* Take scale-factor into account: */
    542         const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
    543         m_pFrameBuffer->setScaleFactor(dScaleFactor);
    544         /* Propagate scale-factor to 3D service if necessary: */
    545         if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
    546         {
    547             display().NotifyScaleFactorChange(m_uScreenId,
    548                                               (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),
    549                                               (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));
    550         }
    551 
    552554#ifdef Q_WS_MAC
    553555        /* Take backing scale-factor into account: */
     
    555557#endif /* Q_WS_MAC */
    556558
    557         /* Take unscaled HiDPI output mode into account: */
     559        /* Take the scale-factor related attributes into account: */
     560        const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
    558561        const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
     562        m_pFrameBuffer->setScaleFactor(dScaleFactor);
    559563        m_pFrameBuffer->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
     564        /* Propagate the scale-factor related attributes to 3D service if necessary: */
     565        if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
     566        {
     567            display().NotifyScaleFactorChange(m_uScreenId,
     568                                              (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),
     569                                              (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));
     570            display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);
     571        }
    560572
    561573        /* Perform frame-buffer rescaling: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r54104 r54603  
    148148    const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
    149149    frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
     150    /* Propagate unscaled-hidpi-output feature to 3D service if necessary: */
     151    if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
     152    {
     153        display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);
     154    }
    150155
    151156    /* Perform frame-buffer rescaling: */
    152157    frameBuffer()->performRescale();
     158
     159    // TODO: How to make it work?
     160    display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight());
    153161}
    154162
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