Merge branch 'development' into cmake/warn_virtual

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Framework/AzCore/AzCore/Memory/HeapSchema.h
#	Code/Framework/AzCore/AzCore/Memory/HphaSchema.h
#	Code/Framework/AzCore/AzCore/Memory/MallocSchema.h
#	Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h
This commit is contained in:
Esteban Papp
2021-09-14 15:32:35 -07:00
70 changed files with 565 additions and 225 deletions
@@ -0,0 +1,31 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AzCore/Casting/numeric_cast.h>
#include <AzQtComponents/Utilities/PixmapScaleUtilities.h>
#include <QtGui/private/qhighdpiscaling_p.h>
namespace AzQtComponents
{
QPixmap ScalePixmapForScreenDpi(
QPixmap pixmap, QScreen* screen, QSize size, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformationMode)
{
qreal screenDpiFactor = QHighDpiScaling::factor(screen);
pixmap.setDevicePixelRatio(screenDpiFactor);
QPixmap scaledPixmap;
size.setWidth(aznumeric_cast<int>(aznumeric_cast<qreal>(size.width()) * screenDpiFactor));
size.setHeight(aznumeric_cast<int>(aznumeric_cast<qreal>(size.height()) * screenDpiFactor));
scaledPixmap = pixmap.scaled(size, aspectRatioMode, transformationMode);
return scaledPixmap;
}
}
@@ -0,0 +1,19 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzQtComponents/AzQtComponentsAPI.h>
#include <QPixmap>
#include <QScreen>
namespace AzQtComponents
{
AZ_QT_COMPONENTS_API QPixmap ScalePixmapForScreenDpi(QPixmap pixmap, QScreen* screen, QSize size, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformationMode);
}; // namespace AzQtComponents
@@ -276,6 +276,8 @@ set(FILES
Utilities/HandleDpiAwareness.cpp
Utilities/HandleDpiAwareness.h
Utilities/MouseHider.h
Utilities/PixmapScaleUtilities.cpp
Utilities/PixmapScaleUtilities.h
Utilities/QtPluginPaths.cpp
Utilities/QtPluginPaths.h
Utilities/QtWindowUtilities.cpp