Amends 8cc8bbb466.
With the referenced patch framebuffer invalidation is preferred
over clearing with a wider range of OpenGL implementations.
This is good and is in line with the documentation. If an existing
application does not do glClear() in their reimplemented paintGL(),
that we cannot fix, and the docs never actually promised that a
glClear() is done automatically.
However, there is a special case: when one does not reimplement
paintGL(). A QOpenGLWidget is expected to be usable without
reimplementing any of its virtuals (i.e., QOpenGLWidget is
constructible as-is without subclassing). It is then ideal
if this does not lead to showing rendering artifacts due to
having potentially random content in the (invalidated,
not cleared) color buffer. This problem was never encountered
before due to hitting the invalidate-instead-of-clear code path
on a limited set of platforms (like with OpenGL ES) only.
Do a glClear() in paintGL(). This won't effect the vast majority
of applications, that reimplement this function, but plays nice
for when it is not.
It is in fact also in line with Qt 4's QGLWidget: that also used to
do a glClear() in the default paintGL() implementation.
Change-Id: I117ce1d3340f6d4d82cde1f52769a3b13ce367fb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>