VirtualBox

Changeset 56057 in vbox


Ignore:
Timestamp:
May 25, 2015 1:33:44 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Scaling: Use the performance scaling (Qt::FastTransformation) for the cases with integer scale-factor.

File:
1 edited

Legend:

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

    r55834 r56057  
    5757#include <VBox/VBoxVideo3D.h>
    5858
     59/* Other includes: */
     60#include <math.h>
     61
    5962#ifdef Q_WS_X11
    6063/* X11 includes: */
     
    290293    void paintSeamless(QPaintEvent *pEvent);
    291294
    292     /** Returns the transformation mode corresponding to the passed ScalingOptimizationType. */
    293     static Qt::TransformationMode transformationMode(ScalingOptimizationType type);
     295    /** Returns the transformation mode corresponding to the passed @a dScaleFactor and ScalingOptimizationType. */
     296    static Qt::TransformationMode transformationMode(double dScaleFactor, ScalingOptimizationType type);
    294297
    295298    /** Erases corresponding @a rect with @a painter. */
     
    13431346        /* And scaling the image to predefined scaled-factor: */
    13441347        scaledImage = scaledImage.scaled(m_scaledSize, Qt::IgnoreAspectRatio,
    1345                                          transformationMode(scalingOptimizationType()));
     1348                                         transformationMode(m_dScaleFactor, scalingOptimizationType()));
    13461349    }
    13471350    /* Finally we are choosing image to paint from: */
     
    13841387        /* And scaling the image to predefined scaled-factor: */
    13851388        scaledImage = scaledImage.scaled(m_scaledSize, Qt::IgnoreAspectRatio,
    1386                                          transformationMode(scalingOptimizationType()));
     1389                                         transformationMode(m_dScaleFactor, scalingOptimizationType()));
    13871390    }
    13881391    /* Finally we are choosing image to paint from: */
     
    14401443
    14411444/* static */
    1442 Qt::TransformationMode UIFrameBufferPrivate::transformationMode(ScalingOptimizationType type)
     1445Qt::TransformationMode UIFrameBufferPrivate::transformationMode(double dScaleFactor, ScalingOptimizationType type)
    14431446{
    14441447    switch (type)
    14451448    {
     1449        /* Check if optimization type is forced to be 'Performance': */
    14461450        case ScalingOptimizationType_Performance: return Qt::FastTransformation;
    14471451        default: break;
    14481452    }
    1449     return Qt::SmoothTransformation;
     1453    /* For integer-scaling we are choosing the 'Performance' optimization type ourselves: */
     1454    return floor(dScaleFactor) == dScaleFactor ? Qt::FastTransformation : Qt::SmoothTransformation;
    14501455}
    14511456
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