eglfs: hooks can never be null
e60ca0de60
reworked the hooks design.
hooks is initialized with a stub pointer if we don't have a platform
hook.
Change-Id: Ia60facfebd9e4d9c08d237c6d49793efb598130f
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
parent
5672cbf131
commit
dd699d5ea5
@ -123,8 +123,7 @@ QEglFSScreen::QEglFSScreen()
|
|||||||
qWarning("QEglScreen %p\n", this);
|
qWarning("QEglScreen %p\n", this);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (hooks)
|
hooks->platformInit();
|
||||||
hooks->platformInit();
|
|
||||||
|
|
||||||
EGLint major, minor;
|
EGLint major, minor;
|
||||||
|
|
||||||
@ -165,13 +164,11 @@ QEglFSScreen::~QEglFSScreen()
|
|||||||
if (m_surface)
|
if (m_surface)
|
||||||
eglDestroySurface(m_dpy, m_surface);
|
eglDestroySurface(m_dpy, m_surface);
|
||||||
|
|
||||||
if (hooks)
|
hooks->destroyNativeWindow(m_window);
|
||||||
hooks->destroyNativeWindow(m_window);
|
|
||||||
|
|
||||||
eglTerminate(m_dpy);
|
eglTerminate(m_dpy);
|
||||||
|
|
||||||
if (hooks)
|
hooks->platformDestroy();
|
||||||
hooks->platformDestroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEglFSScreen::createAndSetPlatformContext() const {
|
void QEglFSScreen::createAndSetPlatformContext() const {
|
||||||
@ -205,8 +202,7 @@ void QEglFSScreen::createAndSetPlatformContext()
|
|||||||
|
|
||||||
EGLConfig config = q_configFromGLFormat(m_dpy, platformFormat);
|
EGLConfig config = q_configFromGLFormat(m_dpy, platformFormat);
|
||||||
|
|
||||||
if (hooks)
|
m_window = hooks->createNativeWindow(hooks->screenSize());
|
||||||
m_window = hooks->createNativeWindow(hooks->screenSize());
|
|
||||||
|
|
||||||
#ifdef QEGL_EXTRA_DEBUG
|
#ifdef QEGL_EXTRA_DEBUG
|
||||||
qWarning("Configuration %d matches requirements\n", (int)config);
|
qWarning("Configuration %d matches requirements\n", (int)config);
|
||||||
|
Loading…
Reference in New Issue
Block a user