From 11aa64b1a1450e5189a8a99d58ecceb4322f7d7c Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 13 Jun 2012 18:21:35 -0700 Subject: eglfs: Pass QSurfaceFormat to createNativeWindow() hook Change-Id: Ib352d8591360a224359ef218b95cd27cdfaf81aa Reviewed-by: Girish Ramakrishnan --- src/plugins/platforms/eglfs/qeglfshooks.h | 2 +- src/plugins/platforms/eglfs/qeglfshooks_stub.cpp | 3 ++- src/plugins/platforms/eglfs/qeglfshooks_x11.cpp | 6 ++++-- src/plugins/platforms/eglfs/qeglfswindow.cpp | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/eglfs/qeglfshooks.h b/src/plugins/platforms/eglfs/qeglfshooks.h index 3e40d16f38..72cf496703 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks.h +++ b/src/plugins/platforms/eglfs/qeglfshooks.h @@ -62,7 +62,7 @@ public: virtual int screenDepth() const; virtual QImage::Format screenFormat() const; virtual QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const; - virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual EGLNativeWindowType createNativeWindow(const QSize &size, const QSurfaceFormat &format); virtual void destroyNativeWindow(EGLNativeWindowType window); virtual bool hasCapability(QPlatformIntegration::Capability cap) const; virtual QEglFSCursor *createCursor(QEglFSScreen *screen) const; diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp index fe622e1c1b..487e483b62 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp +++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp @@ -77,9 +77,10 @@ QSurfaceFormat QEglFSHooks::surfaceFormatFor(const QSurfaceFormat &inputFormat) return inputFormat; } -EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) +EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size, const QSurfaceFormat &format) { Q_UNUSED(size); + Q_UNUSED(format); return 0; } diff --git a/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp b/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp index af750a73f1..cb91858b57 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp +++ b/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp @@ -52,7 +52,7 @@ public: virtual void platformDestroy(); virtual EGLNativeDisplayType platformDisplay() const; virtual QSize screenSize() const; - virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual EGLNativeWindowType createNativeWindow(const QSize &size, const QSurfaceFormat &format); virtual void destroyNativeWindow(EGLNativeWindowType window); virtual bool hasCapability(QPlatformIntegration::Capability cap) const; }; @@ -84,8 +84,10 @@ QSize QEglFSX11Hooks::screenSize() const return QSize(env.at(0).toInt(), env.at(1).toInt()); } -EGLNativeWindowType QEglFSX11Hooks::createNativeWindow(const QSize &size) +EGLNativeWindowType QEglFSX11Hooks::createNativeWindow(const QSize &size, const QSurfaceFormat &format) { + Q_UNUSED(format); + Window root = DefaultRootWindow(display); XSetWindowAttributes swa; memset(&swa, 0, sizeof(swa)); diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index 6cb9fc6edf..36089b5ce0 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -78,7 +78,7 @@ void QEglFSWindow::create() QSurfaceFormat platformFormat = hooks->surfaceFormatFor(window()->requestedFormat()); EGLConfig config = q_configFromGLFormat(display, platformFormat); m_format = q_glFormatFromConfig(display, config); - m_window = hooks->createNativeWindow(hooks->screenSize()); + m_window = hooks->createNativeWindow(hooks->screenSize(), m_format); m_surface = eglCreateWindowSurface(display, config, m_window, NULL); if (m_surface == EGL_NO_SURFACE) { eglTerminate(display); -- cgit v1.2.3