From 5c605d363e2fc42f5ec80413d093b69614027da4 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Wed, 5 Mar 2014 13:15:29 +0200 Subject: 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 --- .../client/wayland-egl/qwaylandeglwindow.cpp | 10 +++++----- 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(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(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; -- cgit v1.2.3