summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qopenglwidget.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-09-08 10:10:07 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-09-08 21:47:28 +0200
commit935186d76e055083eda75b91488c9affec1fd110 (patch)
tree18f5529ad9172040e20f595a638b8823df9794ba /src/widgets/kernel/qopenglwidget.cpp
parentdf5db1dfb2409c1bd83dbb108a8eec5a00712176 (diff)
Improve QOpenGLWidget docs regarding fb preservation
QOpenGLWindow already has some notes regarding this. It must be mentioned in QOpenGLWidget too. Change-Id: I0af90c9410a1c44cb9dd9ce58aa0371a58c57f65 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/widgets/kernel/qopenglwidget.cpp')
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index d8f31bfcc8..757cac8cea 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -228,6 +228,22 @@ QT_BEGIN_NAMESPACE
regarding stacking orders for example. QOpenGLWidget avoids this by not
creating a separate native window.
+ Due to being backed by a framebuffer object, the behavior of QOpenGLWidget is
+ very similar to QOpenGLWindow with the update behavior set to \c
+ PartialUpdateBlit or \c PartialUpdateBlend. This means that the contents are
+ preserved between paintGL() calls so that incremental rendering is
+ possible. With QGLWidget (and naturally QOpenGLWindow with the default update
+ behavior) this is usually not the case because swapping the buffers leaves the
+ back buffer with undefined contents.
+
+ \note Most applications do not need incremental rendering because they will
+ render everything in the view on every paint call. In this case it is
+ important to call glClear() as early as possible in paintGL(). This helps
+ mobile GPUs that use a tile-based architecture to recognize that the tile
+ buffer does not need to be reloaded with the framebuffer's previous
+ contents. Omitting the clear call can lead to significant performance drops on
+ such systems.
+
\section1 Multisampling
To enable multisampling, set the number of requested samples on the
@@ -372,7 +388,7 @@ QT_BEGIN_NAMESPACE
\e{OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other
countries.}
- \sa QOpenGLFunctions
+ \sa QOpenGLFunctions, QOpenGLWindow
*/
/*!