summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetbackingstore.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-11-18 15:20:14 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-11-24 19:28:32 +0000
commit5c7f000cd4c9e3769e8cd4085cf0beee104f9886 (patch)
tree5e704e7e92dd7653bcaa52773f643c36d082e959 /src/widgets/kernel/qwidgetbackingstore.cpp
parenta69c0bb38e8edb985417c10793350e40e401fed3 (diff)
Reduce the number of paint events for QOpenGLWidget
Changes to other widgets in the window, especially special cases like moving dock widgets around, trigger an unfortunately high number of paint events and calls to paintGL(). Let's try to avoid this. There is no need to send out a paint event to a texture-backed widget when it was not explicitly dirtied. Overlaps won't matter since such widgets are not part of the backingstore. Everything else has to work like ordinary widgets, though, it is only the QPaintEvent sending we can optimize away, nothing else. Task-number: QTBUG-49466 Change-Id: I8ef294ba0a6c305d0002a80e85c06db2c2501cf8 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/widgets/kernel/qwidgetbackingstore.cpp')
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 9036c28b9a..6d43adc33b 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -1230,6 +1230,9 @@ void QWidgetBackingStore::doSync()
QWidget *w = static_cast<QWidget *>(tl->source(i));
if (dirtyRenderToTextureWidgets.contains(w)) {
const QRect rect = tl->geometry(i); // mapped to the tlw already
+ // Set a flag to indicate that the paint event for this
+ // render-to-texture widget must not to be optimized away.
+ w->d_func()->renderToTextureReallyDirty = 1;
dirty += rect;
toClean += rect;
}