diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-03-05 13:15:29 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-06 12:47:53 +0100 |
commit | 5c605d363e2fc42f5ec80413d093b69614027da4 (patch) | |
tree | 279f1b337b63ad469c5bef4dd79fd1d8a6d42bee | |
parent | d30758c987ff7899872dd0021a740e67f0f470e6 (diff) | |
download | qtwayland-5c605d363e2fc42f5ec80413d093b69614027da4.tar.gz qtwayland-5c605d363e2fc42f5ec80413d093b69614027da4.tar.bz2 qtwayland-5c605d363e2fc42f5ec80413d093b69614027da4.zip |
Create the egl windows and context with the right config
The egl config should be calculated when creating the window, and
the format of it should be set accordingly. The format of the window
and the one of the context will then match if using the same format
as input.
Change-Id: Ie93735171d8945111a450263089e192919249b68
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp | 10 | ||||
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index dc5bbc3b..30f64926 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -59,12 +59,15 @@ QWaylandEglWindow::QWaylandEglWindow(QWindow *window) , m_clientBufferIntegration(static_cast<QWaylandEglClientBufferIntegration *>(mDisplay->clientBufferIntegration())) , m_waylandEglWindow(0) , m_eglSurface(0) - , m_eglConfig(0) + , m_eglConfig(q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), window->requestedFormat(), true)) , m_contentFBO(0) , m_resize(false) - , m_format(window->requestedFormat()) + , m_format(q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(), m_eglConfig)) { setGeometry(window->geometry()); + + EGLNativeWindowType eglw = (EGLNativeWindowType) m_waylandEglWindow; + m_eglSurface = eglCreateWindowSurface(m_clientBufferIntegration->eglDisplay(), m_eglConfig, eglw, 0); } QWaylandEglWindow::~QWaylandEglWindow() @@ -129,9 +132,6 @@ EGLSurface QWaylandEglWindow::eglSurface() const } if (!m_eglSurface) { - m_eglConfig = q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), window()->format(), true); - const_cast<QWaylandEglWindow *>(this)->m_format = q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(),m_eglConfig); - EGLNativeWindowType window = (EGLNativeWindowType) m_waylandEglWindow; m_eglSurface = eglCreateWindowSurface(m_clientBufferIntegration->eglDisplay(), m_eglConfig, window, 0); } diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h index 9f08559d..d6708a34 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h @@ -76,7 +76,7 @@ private: const QWaylandWindow *m_parentWindow; mutable EGLSurface m_eglSurface; - mutable EGLConfig m_eglConfig; + EGLConfig m_eglConfig; mutable QOpenGLFramebufferObject *m_contentFBO; mutable bool m_resize; |