summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qopenglwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qopenglwidget.cpp')
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index c6c5e5bc80..d4d23604a3 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -46,6 +46,7 @@
#include <QtGui/private/qopenglextensions_p.h>
#include <QtGui/private/qfont_p.h>
#include <QtGui/private/qopenglpaintdevice_p.h>
+#include <QtGui/private/qopenglcontext_p.h>
#include <QtWidgets/private/qwidget_p.h>
QT_BEGIN_NAMESPACE
@@ -792,11 +793,18 @@ void QOpenGLWidgetPrivate::resolveSamples()
void QOpenGLWidgetPrivate::invokeUserPaint()
{
Q_Q(QOpenGLWidget);
- QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
+
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ Q_ASSERT(ctx && fbo);
+
+ QOpenGLFunctions *f = ctx->functions();
+ QOpenGLContextPrivate::get(ctx)->defaultFboRedirect = fbo->handle();
f->glViewport(0, 0, q->width() * q->devicePixelRatio(), q->height() * q->devicePixelRatio());
q->paintGL();
flushPending = true;
+
+ QOpenGLContextPrivate::get(ctx)->defaultFboRedirect = 0;
}
void QOpenGLWidgetPrivate::render()