diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-07-13 16:25:37 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-08-06 11:45:28 +0000 |
commit | 62a56adfa6cab1fe1099cfc1be9750276732f35e (patch) | |
tree | 82992aec04a1fee2fa13db2b84d9386427b86e01 /src/gui/kernel/qhighdpiscaling.cpp | |
parent | 6c4bd85c1fada88e7f3f97d9a5e26af31dcd6bbe (diff) |
Compile-time option for disabling high-DPI scaling
Even if QHighDpiScaling::isActive() returns false, there
is a small overhead from calling functions and multiplying
with 1.0. This change adds a QT_NO_HIGHDPISCALING #ifdef
that replaces all conversion functions with empty inline
functions.
Task-number: QTBUG-46615
Change-Id: Idf85e1700e3adf7f7174c6fa3f5e1d006d74c826
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qhighdpiscaling.cpp')
-rw-r--r-- | src/gui/kernel/qhighdpiscaling.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index 19e3045fc9..de586ac46c 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcScaling, "qt.scaling"); +#ifndef QT_NO_HIGHDPISCALING static const char legacyDevicePixelEnvVar[] = "QT_DEVICE_PIXEL_RATIO"; static const char scaleFactorEnvVar[] = "QT_SCALE_FACTOR"; static const char autoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR"; @@ -317,4 +318,5 @@ QPoint QHighDpiScaling::origin(const QPlatformScreen *platformScreen) return platformScreen->geometry().topLeft(); } +#endif //QT_NO_HIGHDPISCALING QT_END_NAMESPACE |