eglfs: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I4c43809954ed720de95b3056c13bf520577e3280
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
Marc Mutz 2014-09-09 11:47:13 +02:00
parent 4aba06aa47
commit 9b62d37894
3 changed files with 4 additions and 4 deletions

View File

@ -145,7 +145,7 @@ QSurfaceFormat QEglFSHooks::surfaceFormatFor(const QSurfaceFormat &inputFormat)
{
QSurfaceFormat format = inputFormat;
static const bool force888 = qgetenv("QT_QPA_EGLFS_FORCE888").toInt();
static const bool force888 = qEnvironmentVariableIntValue("QT_QPA_EGLFS_FORCE888");
if (force888) {
format.setRedBufferSize(8);
format.setGreenBufferSize(8);
@ -189,7 +189,7 @@ QEGLPlatformCursor *QEglFSHooks::createCursor(QPlatformScreen *screen) const
void QEglFSHooks::waitForVSync() const
{
#if defined(FBIO_WAITFORVSYNC)
static const bool forceSync = qgetenv("QT_QPA_EGLFS_FORCEVSYNC").toInt();
static const bool forceSync = qEnvironmentVariableIntValue("QT_QPA_EGLFS_FORCEVSYNC");
if (forceSync && framebuffer != -1) {
int arg = 0;
if (ioctl(framebuffer, FBIO_WAITFORVSYNC, &arg) == -1)

View File

@ -321,7 +321,7 @@ EGLNativeWindowType QEglFSX11Hooks::createNativeWindow(QPlatformWindow *platform
xcb_change_property(m_connection, XCB_PROP_MODE_REPLACE, m_window,
m_atoms[Atoms::WM_PROTOCOLS], XCB_ATOM_ATOM, 32, 1, &m_atoms[Atoms::WM_DELETE_WINDOW]);
if (qgetenv("EGLFS_X11_FULLSCREEN").toInt()) {
if (qEnvironmentVariableIntValue("EGLFS_X11_FULLSCREEN")) {
// Go fullscreen. The QScreen and QWindow size is controlled by EGLFS_X11_SIZE regardless,
// this is just the native window.
xcb_change_property(m_connection, XCB_PROP_MODE_REPLACE, m_window,

View File

@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
QEglFSIntegration::QEglFSIntegration()
{
mDisableInputHandlers = qgetenv("QT_QPA_EGLFS_DISABLE_INPUT").toInt();
mDisableInputHandlers = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DISABLE_INPUT");
initResources();
}