diff options
author | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-05-26 22:22:37 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-05-29 15:41:38 +0000 |
commit | f9b1596fe1aeacf4f3d977c32e74b7ad585d3d3e (patch) | |
tree | 82c04fce2ef3a56540ebb6e06df5b29a4f1fa71b /src/plugins | |
parent | c2d5ecf8766d3da70b17348e92cda31b00e204a7 (diff) |
Refactor QHighDpiScaling internals and usage
Overall goal is to simplify, separate concerns, and
improve cross-platform-ness and testability.
QT_SCALE_FACTOR is now a pure cross-platform global
scale factor setter has no "auto". "auto" requires
input from the platform plugin via QPlatformScreen::
pixelDensity() and gets a separate environment variable:
QT_AUTO_SCREEN_SCALE_FACTOR
The effective scale factor (aka devicePixelRatio) is now
computed as the product of the global, screen, and
window scale factors. This matches how devicePixelRatio
is computed in general (the window system devicePixelRatio
is also a factor), and makes QT_SCALE_FACTOR
work consistently regardless if there is a window
scale factor set or not. This also means we can remove
the if/else casing from the nativePixels conversion
functions.
Add QHighDpiScaling initializer which reads the environment
variables and sets the "active" variables. Call it
during QGuiApplication construction, before the platform
plugin is created
Add per-screen scale factor setting capability to
the manual test. This makes it possible to test
this logic on all platforms. The command line argument
is --screen-scale-factor.
Change-Id: I054337cbae37a01cdd731d26d9cb628fcecdb652
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/android/androidjnimain.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index cf9a96b993..184fc58cf0 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -574,7 +574,7 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/, m_density = density; if (m_highDpiScalingEnabled) - QHighDpiScaling::setFactor(density); + QHighDpiScaling::setGlobalFactor(density); if (!m_androidPlatformIntegration) { QAndroidPlatformIntegration::setDefaultDisplayMetrics(desktopWidthPixels, |