diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-05-30 15:51:32 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-06-06 10:48:36 +0000 |
commit | 8c33b798237b95d37fe4d60ae36f0d8067504429 (patch) | |
tree | dbe16fe8ad0679791c13479ffc70e723f2f6de41 /tests/auto/other | |
parent | afdb675ada5b21216dd1bf017a6054cf508be0b9 (diff) |
Fix HDR format in QOpenGLFramebufferObject::toImage()
If the fbo had samples > 0 set, it would use a temporary fbo with
a default configuration losing the HDR precision.
Change-Id: I7e9966165b3100f148c4ad24738f3ee71273f29a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'tests/auto/other')
-rw-r--r-- | tests/auto/other/lancelot/tst_lancelot.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/other/lancelot/tst_lancelot.cpp b/tests/auto/other/lancelot/tst_lancelot.cpp index 79d0f7c6cf..15267d256e 100644 --- a/tests/auto/other/lancelot/tst_lancelot.cpp +++ b/tests/auto/other/lancelot/tst_lancelot.cpp @@ -39,6 +39,10 @@ #include <algorithm> +#ifndef GL_RGB10 +#define GL_RGB10 0x8052 +#endif + class tst_Lancelot : public QObject { Q_OBJECT @@ -85,6 +89,8 @@ private slots: #ifndef QT_NO_OPENGL void testOpenGL_data(); void testOpenGL(); + void testOpenGLBGR30_data(); + void testOpenGLBGR30(); void testCoreOpenGL_data(); void testCoreOpenGL(); private: @@ -279,6 +285,16 @@ void tst_Lancelot::testOpenGL() runTestSuite(OpenGL, QImage::Format_RGB32); } +void tst_Lancelot::testOpenGLBGR30_data() +{ + tst_Lancelot::testOpenGL_data(); +} + +void tst_Lancelot::testOpenGLBGR30() +{ + runTestSuite(OpenGL, QImage::Format_BGR30); +} + void tst_Lancelot::testCoreOpenGL_data() { if (!checkSystemCoreGLSupport()) @@ -329,6 +345,8 @@ void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format, co QOpenGLFramebufferObjectFormat fmt; fmt.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); fmt.setSamples(4); + if (format == QImage::Format_BGR30) + fmt.setInternalTextureFormat(GL_RGB10); QOpenGLContext ctx; ctx.setFormat(contextFormat); QVERIFY(ctx.create()); |