summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfswindow.cpp
diff options
context:
space:
mode:
authorGirish Ramakrishnan <girish.1.ramakrishnan@nokia.com>2012-06-13 16:38:27 -0700
committerQt by Nokia <qt-info@nokia.com>2012-06-14 16:12:19 +0200
commitf2d04d9b8cb323826c5af180dd2c22fe584a5e26 (patch)
tree56ab10855809bd051ae85ebdb0f97e7d8b068c85 /src/plugins/platforms/eglfs/qeglfswindow.cpp
parented776e367099754af6436f07d72352e6b73124da (diff)
eglfs: Make QEglFSWindow respect the window format
Prior to this change, eglfs code used to override the window format with it's own format. With this change, eglfs will respect the window format. This is useful when the application requires a surface with alpha (for example, so that the video layer below is visible) QEglFSHooks::surfaceFormatFor() allows the hook author to override the context and window surface format. Change-Id: I97f03a8b0871dfebfca73004fa0188b33d0d0367 Reviewed-by: Johannes Zellner <johannes.zellner@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfswindow.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index 5e6d09a637..6cb9fc6edf 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -61,6 +61,8 @@ QEglFSWindow::QEglFSWindow(QWindow *w)
#endif
setWindowState(Qt::WindowFullScreen);
+
+ create();
}
QEglFSWindow::~QEglFSWindow()
@@ -70,19 +72,17 @@ QEglFSWindow::~QEglFSWindow()
void QEglFSWindow::create()
{
- if (m_window) {
- return;
- }
+ Q_ASSERT(!m_window);
EGLDisplay display = (static_cast<QEglFSScreen *>(window()->screen()->handle()))->display();
- QSurfaceFormat platformFormat = hooks->defaultSurfaceFormat();
+ 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_surface = eglCreateWindowSurface(display, config, m_window, NULL);
if (m_surface == EGL_NO_SURFACE) {
- qWarning("Could not create the egl surface: error = 0x%x\n", eglGetError());
eglTerminate(display);
- qFatal("EGL error");
+ qFatal("EGL Error : Could not create the egl surface: error = 0x%x\n", eglGetError());
}
}
@@ -122,7 +122,7 @@ WId QEglFSWindow::winId() const
QSurfaceFormat QEglFSWindow::format() const
{
- return hooks->defaultSurfaceFormat();
+ return m_format;
}
QT_END_NAMESPACE