From dd699d5ea52b9c9abd1b0e7ebb0d705901117f7f Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 17 May 2012 13:51:51 -0700 Subject: eglfs: hooks can never be null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e60ca0de6015a8ee16c7be54d0d430252ef525c1 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 Reviewed-by: Samuel Rødal --- src/plugins/platforms/eglfs/qeglfsscreen.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index 0a97a932cb..3d5d4289c3 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -123,8 +123,7 @@ QEglFSScreen::QEglFSScreen() qWarning("QEglScreen %p\n", this); #endif - if (hooks) - hooks->platformInit(); + hooks->platformInit(); EGLint major, minor; @@ -165,13 +164,11 @@ QEglFSScreen::~QEglFSScreen() if (m_surface) eglDestroySurface(m_dpy, m_surface); - if (hooks) - hooks->destroyNativeWindow(m_window); + hooks->destroyNativeWindow(m_window); eglTerminate(m_dpy); - if (hooks) - hooks->platformDestroy(); + hooks->platformDestroy(); } void QEglFSScreen::createAndSetPlatformContext() const { @@ -205,8 +202,7 @@ void QEglFSScreen::createAndSetPlatformContext() 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 qWarning("Configuration %d matches requirements\n", (int)config); -- cgit v1.2.3