From eacd58d4e78e7238ba5fcca90ba960aaf3ebd263 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 18 Dec 2013 14:48:22 +0100 Subject: Enabling QQuickWidget and QOpenGLWidget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable child widgets (without a native window) that render to an FBO and are composed with the raster backingstore by the platform plugin. A preliminary version of QOpenGLWidget is included as private API. Change-Id: I8f984a4d7db285069ce3d6564707942c823d890d Reviewed-by: Jørgen Lind --- src/gui/kernel/qopenglcontext.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/gui/kernel/qopenglcontext.cpp') diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 39dd2a2dfa..7fb51ddd52 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -761,8 +761,7 @@ bool QOpenGLContext::makeCurrent(QSurface *surface) if (!surface->surfaceHandle()) return false; - - if (surface->surfaceType() != QSurface::OpenGLSurface) { + if (!surface->supportsOpenGL()) { qWarning() << "QOpenGLContext::makeCurrent() called with non-opengl surface" << surface; return false; } @@ -837,9 +836,9 @@ void QOpenGLContext::swapBuffers(QSurface *surface) return; } - if (surface->surfaceType() != QSurface::OpenGLSurface) { - qWarning() << "QOpenGLContext::swapBuffers() called with non-opengl surface"; - return; + if (!surface->supportsOpenGL()) { + qWarning() << "QOpenGLContext::swapBuffers() called with non-opengl surface"; + return; } if (surface->surfaceClass() == QSurface::Window -- cgit v1.2.3