diff options
author | Johannes Zellner <johannes.zellner@nokia.com> | 2012-06-13 18:21:35 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-14 16:12:31 +0200 |
commit | 11aa64b1a1450e5189a8a99d58ecceb4322f7d7c (patch) | |
tree | 17298532616841e62be12850341a372d7a638d3d | |
parent | f2d04d9b8cb323826c5af180dd2c22fe584a5e26 (diff) |
eglfs: Pass QSurfaceFormat to createNativeWindow() hook
Change-Id: Ib352d8591360a224359ef218b95cd27cdfaf81aa
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
6 files changed, 15 insertions, 10 deletions
diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp index 9fa05a4bf4..60370544c2 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp @@ -54,7 +54,7 @@ class QEglFS8726MHooks : public QEglFSHooks { public: virtual QSize screenSize() const; - virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual EGLNativeWindowType createNativeWindow(const QSize &size, const QSurfaceFormat &format); virtual void destroyNativeWindow(EGLNativeWindowType window); }; @@ -75,8 +75,10 @@ QSize QEglFS8726MHooks::screenSize() const return QSize(vinfo.xres, vinfo.yres); } -EGLNativeWindowType QEglFS8726MHooks::createNativeWindow(const QSize &size) +EGLNativeWindowType QEglFS8726MHooks::createNativeWindow(const QSize &size, const QSurfaceFormat &format) { + Q_UNUSED(format); + fbdev_window *window = new fbdev_window; window->width = size.width(); window->height = size.height(); diff --git a/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp index 62efa73d7f..599b696155 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp +++ b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp @@ -241,7 +241,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; @@ -293,9 +293,9 @@ QSize QEglFSPiHooks::screenSize() const #endif } -EGLNativeWindowType QEglFSPiHooks::createNativeWindow(const QSize &size) +EGLNativeWindowType QEglFSPiHooks::createNativeWindow(const QSize &size, const QSurfaceFormat &format) { - return createDispmanxLayer(QPoint(0, 0), size, 1, DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS); + return createDispmanxLayer(QPoint(0, 0), size, 1, format.hasAlpha() ? DISPMANX_FLAGS_ALPHA_FROM_SOURCE : DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS); } void QEglFSPiHooks::destroyNativeWindow(EGLNativeWindowType window) 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); |