summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfswindow.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-02-24 09:14:20 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-26 22:01:27 +0100
commit1b76cf017427a98bf4487f3cf576611d82097539 (patch)
treef7348ce5e47854ea1e608a873b19b4c6889e5a41 /src/plugins/platforms/eglfs/qeglfswindow.cpp
parentbc5170f274572a4b262569c12d5d3c6ef892aaf2 (diff)
EGLFS: Replace the global static 'hooks' variable with a function
Having a global static variable in a header is a poor choice to start with. All .cpp including that header must use that variable or the compiler will warn of an unused static. Second, for the case of platform hooks, it's possible that it is reading the value of a variable that isn't initialised yet. Change-Id: Id823c2be9cfededb9c31fb76a9080d4122577ca4 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfswindow.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index 26f701d7ba..4a0e2a9a7d 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -76,18 +76,18 @@ void QEglFSWindow::create()
return;
if (window()->type() == Qt::Desktop) {
- QRect rect(QPoint(), hooks->screenSize());
+ QRect rect(QPoint(), QEglFSHooks::hooks()->screenSize());
QPlatformWindow::setGeometry(rect);
QWindowSystemInterface::handleGeometryChange(window(), rect);
return;
}
EGLDisplay display = (static_cast<QEglFSScreen *>(window()->screen()->handle()))->display();
- QSurfaceFormat platformFormat = hooks->surfaceFormatFor(window()->requestedFormat());
+ QSurfaceFormat platformFormat = QEglFSHooks::hooks()->surfaceFormatFor(window()->requestedFormat());
EGLConfig config = QEglFSIntegration::chooseConfig(display, platformFormat);
m_format = q_glFormatFromConfig(display, config);
- m_window = hooks->createNativeWindow(hooks->screenSize(), m_format);
+ m_window = QEglFSHooks::hooks()->createNativeWindow(QEglFSHooks::hooks()->screenSize(), m_format);
m_surface = eglCreateWindowSurface(display, config, m_window, NULL);
if (m_surface == EGL_NO_SURFACE) {
EGLint error = eglGetError();
@@ -105,7 +105,7 @@ void QEglFSWindow::destroy()
}
if (m_window) {
- hooks->destroyNativeWindow(m_window);
+ QEglFSHooks::hooks()->destroyNativeWindow(m_window);
m_window = 0;
}
}