VirtualBox

Changeset 53897 in vbox


Ignore:
Timestamp:
Jan 21, 2015 12:11:05 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
97746
Message:

FE/Qt: 3635: Scaling mode support: 3D Acceleration support.

File:
1 edited

Legend:

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

    r53372 r53897  
    3737# include "CConsole.h"
    3838# include "CDisplay.h"
     39
     40/* Other VBox includes: */
     41#include <VBox/VBoxOGL.h>
    3942
    4043#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    6366    saveMachineViewSettings();
    6467
    65     /* Disable scaling: */
    66     frameBuffer()->setScaledSize(QSize());
     68    /* Return scaled-size to 'normal' mode: */
     69    applyMachineViewScaleFactor();
    6770
    6871    /* Cleanup frame buffer: */
     
    7275void UIMachineViewScale::sltPerformGuestScale()
    7376{
    74     /* Check if scale is requested: */
    75     /* Set new frame-buffer scale-factor: */
     77    /* Adjust frame-buffer scaled-size: */
    7678    frameBuffer()->setScaledSize(viewport()->size());
     79
     80    /* Propagate scale-factor to 3D service if necessary: */
     81    if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
     82    {
     83        const double xRatio = (double)frameBuffer()->scaledSize().width() / frameBuffer()->width();
     84        const double yRatio = (double)frameBuffer()->scaledSize().height() / frameBuffer()->height();
     85        display().NotifyScaleFactorChange(m_uScreenId,
     86                                          (uint32_t)(xRatio * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),
     87                                          (uint32_t)(yRatio * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));
     88    }
    7789
    7890    /* Scale the pause-pixmap: */
Note: See TracChangeset for help on using the changeset viewer.

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