Fix QVideoSurfaceArbFpPainter mistakenly failing to start in some cases.

If an OpenGL error occurred before starting the video painter, it would
fail to do so. This patch simply makes sure the OpenGL error flag is
cleared before checking for GL errors that would occur in
QVideoSurfaceArbFpPainter's code.

Change-Id: I2eacf6db03cb290adf00a9faf11145c7a6ade565
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
Yoann Lopes
2013-09-17 17:00:28 +02:00
committed by The Qt Project
parent 3111178ee6
commit 875de90ff8

View File

@@ -773,6 +773,8 @@ QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::start(const QVideoSurfac
if (!program) {
error = QAbstractVideoSurface::UnsupportedFormatError;
} else {
while (glGetError() != GL_NO_ERROR) { } // clear previous unrelated errors
glGenProgramsARB(1, &m_programId);
GLenum glError = glGetError();