diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-09-09 11:45:38 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2014-09-12 09:58:15 +0200 |
commit | f88c5415ffac69d51c82489908a18f9b88190f59 (patch) | |
tree | 945aaa1ba7aa42f139b500973fe10c11ebacecdf /src/platformsupport | |
parent | 9f0d5b3b6cf61008abad340f18c543d6c109a0a8 (diff) |
eglconvenience: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: Id50609c1f3511287d99e24b03e48c0a254893194
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglconvenience.cpp | 10 | ||||
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformcontext.cpp | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp index 5eed47050f..ca8f1bc333 100644 --- a/src/platformsupport/eglconvenience/qeglconvenience.cpp +++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp @@ -465,8 +465,8 @@ QSizeF q_physicalScreenSizeFromFb(int framebufferDevice, const QSize &screenSize if (size.isEmpty()) { // Note: in millimeters - int width = qgetenv("QT_QPA_EGLFS_PHYSICAL_WIDTH").toInt(); - int height = qgetenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT").toInt(); + int width = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_WIDTH"); + int height = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_HEIGHT"); if (width && height) { size.setWidth(width); @@ -507,8 +507,8 @@ QSize q_screenSizeFromFb(int framebufferDevice) static QSize size; if (size.isEmpty()) { - int width = qgetenv("QT_QPA_EGLFS_WIDTH").toInt(); - int height = qgetenv("QT_QPA_EGLFS_HEIGHT").toInt(); + int width = qEnvironmentVariableIntValue("QT_QPA_EGLFS_WIDTH"); + int height = qEnvironmentVariableIntValue("QT_QPA_EGLFS_HEIGHT"); if (width && height) { size.setWidth(width); @@ -539,7 +539,7 @@ QSize q_screenSizeFromFb(int framebufferDevice) int q_screenDepthFromFb(int framebufferDevice) { const int defaultDepth = 32; - static int depth = qgetenv("QT_QPA_EGLFS_DEPTH").toInt(); + static int depth = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DEPTH"); if (depth == 0) { struct fb_var_screeninfo vinfo; diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index dce8bd888c..7a10ba172a 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -189,7 +189,7 @@ void QEGLPlatformContext::init(const QSurfaceFormat &format, QPlatformOpenGLCont return; } - static const bool printConfig = qgetenv("QT_QPA_EGLFS_DEBUG").toInt(); + static const bool printConfig = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DEBUG"); if (printConfig) { qDebug() << "Created context for format" << format << "with config:"; q_printEglConfig(m_eglDisplay, m_eglConfig); |