summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qopenglcontext.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2013-12-18 14:48:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-12 20:12:17 +0100
commiteacd58d4e78e7238ba5fcca90ba960aaf3ebd263 (patch)
tree779bf1735aecb7985bc3136264b9147eb23d5374 /src/gui/kernel/qopenglcontext.cpp
parent5ae5bebb93ec38e17c0dcb9bec47e0ebfbce4937 (diff)
Enabling QQuickWidget and QOpenGLWidget
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 <jorgen.lind@digia.com>
Diffstat (limited to 'src/gui/kernel/qopenglcontext.cpp')
-rw-r--r--src/gui/kernel/qopenglcontext.cpp9
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