From bd5cea5ba8458ab3d34700999654dbd7d7174084 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 30 Dec 2013 17:09:12 +0100 Subject: Resurrect QGLWidget::renderPixmap() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function has been completely broken since Qt 5.0. Unfortunately the autotest's verification steps were somewhat faulty so returning a null pixmap from renderPixmap() did not trigger a failure. The implementation is now done with framebuffer objects and pixel readback. This is not ideal performance-wise, but is the only option. In Qt 4 pixmaps were often backed by platform dependent native pixmaps that could be used as rendering targets for OpenGL content. This is not an option anymore since pixmaps are raster backed on all the major platforms. Task-number: QTBUG-33186 Change-Id: I8f558e33bf7967ac3be439fd5a3eac07b6444be5 Reviewed-by: Jørgen Lind --- tests/auto/opengl/qgl/tst_qgl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/auto/opengl') diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp index 38c92c7610..1ec1d88802 100644 --- a/tests/auto/opengl/qgl/tst_qgl.cpp +++ b/tests/auto/opengl/qgl/tst_qgl.cpp @@ -1380,12 +1380,13 @@ void tst_QGL::glWidgetRenderPixmap() { RenderPixmapWidget *w = new RenderPixmapWidget; - QPixmap pm = w->renderPixmap(100, 100, false); + QSize pmSize = QSize(100, 100); + QPixmap pm = w->renderPixmap(pmSize.width(), pmSize.height(), false); delete w; QImage fb = pm.toImage().convertToFormat(QImage::Format_RGB32); - QImage reference(fb.size(), QImage::Format_RGB32); + QImage reference(pmSize, QImage::Format_RGB32); reference.fill(0xffff0000); QFUZZY_COMPARE_IMAGES(fb, reference); @@ -2011,6 +2012,7 @@ void tst_QGL::textureCleanup() QGLWidget w; w.resize(200,200); w.show(); + QTest::qWaitForWindowExposed(&w); w.makeCurrent(); // Test pixmaps which have been loaded via QPixmapCache are removed from the texture cache -- cgit v1.2.3