summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/opengl/qopenglpaintdevice.cpp11
-rw-r--r--src/gui/opengl/qopenglpaintdevice.h2
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp2
3 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp
index 60f5e3192a..e070ee6c58 100644
--- a/src/gui/opengl/qopenglpaintdevice.cpp
+++ b/src/gui/opengl/qopenglpaintdevice.cpp
@@ -244,4 +244,15 @@ bool QOpenGLPaintDevice::paintFlipped() const
return d_ptr->flipped;
}
+/*!
+ This virtual method is provided as a callback to allow re-binding a
+ target frame buffer object when different QOpenGLPaintDevice instances
+ are issuing draw calls alternately on the same OpenGL context.
+
+ QPainter::beginNativePainting will also trigger this method.
+*/
+void QOpenGLPaintDevice::ensureActiveTarget()
+{
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/opengl/qopenglpaintdevice.h b/src/gui/opengl/qopenglpaintdevice.h
index a07d11062f..44acbab031 100644
--- a/src/gui/opengl/qopenglpaintdevice.h
+++ b/src/gui/opengl/qopenglpaintdevice.h
@@ -80,6 +80,8 @@ public:
void setPaintFlipped(bool flipped);
bool paintFlipped() const;
+ virtual void ensureActiveTarget();
+
protected:
int metric(QPaintDevice::PaintDeviceMetric metric) const;
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
index 2f84a0f295..bbe5854031 100644
--- a/src/gui/opengl/qopenglpaintengine.cpp
+++ b/src/gui/opengl/qopenglpaintengine.cpp
@@ -2013,6 +2013,8 @@ void QOpenGL2PaintEngineEx::ensureActive()
}
if (d->needsSync) {
+ d->device->ensureActiveTarget();
+
d->transferMode(BrushDrawingMode);
glViewport(0, 0, d->width, d->height);
d->needsSync = false;