From 758b9adccffa47a321294b0d2ff94b78f2dba7d4 Mon Sep 17 00:00:00 2001 From: aavit Date: Thu, 3 Apr 2014 12:54:47 +0200 Subject: Fix lance opengl painting test Change b94493e revealed that in the lance script rendering, at the surface_end command, cleaning up the fbo stuff and enabling the ordinary painting again was done in the wrong order. Change-Id: I358dafeffe95b25303fc2a8dc1d61384b2ca64fb Reviewed-by: Gunnar Sletta --- tests/auto/other/lancelot/paintcommands.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp index 91cda9b4aa..4449b75e46 100644 --- a/tests/auto/other/lancelot/paintcommands.cpp +++ b/tests/auto/other/lancelot/paintcommands.cpp @@ -2430,11 +2430,6 @@ void PaintCommands::command_surface_end(QRegExp) if (m_type == OpenGLType || m_type == OpenGLBufferType) { #ifndef QT_NO_OPENGL QImage new_image = m_surface_glbuffer->toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); - m_default_glcontext->makeCurrent(m_default_glcontext->surface()); - m_painter->drawImage(m_surface_rect, new_image); - // Flush the pipeline: - m_painter->beginNativePainting(); - m_painter->endNativePainting(); delete m_surface_glpaintdevice; m_surface_glpaintdevice = 0; @@ -2442,6 +2437,12 @@ void PaintCommands::command_surface_end(QRegExp) m_surface_glbuffer = 0; delete m_surface_glcontext; m_surface_glcontext = 0; + + m_default_glcontext->makeCurrent(m_default_glcontext->surface()); + m_painter->drawImage(m_surface_rect, new_image); + // Flush the pipeline: + m_painter->beginNativePainting(); + m_painter->endNativePainting(); #endif #ifdef Q_WS_X11 } else if (m_type == WidgetType) { -- cgit v1.2.3