diff options
Diffstat (limited to 'src/gui/kernel/qopenglcontext.cpp')
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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 |