diff options
Diffstat (limited to 'tests/auto/unit')
-rw-r--r-- | tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp | 86 |
1 files changed, 45 insertions, 41 deletions
diff --git a/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp b/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp index 0bc3148d2..43dc52022 100644 --- a/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp +++ b/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp @@ -74,6 +74,8 @@ private slots: void shaderPresentGLFrame_data(); void shaderPresentGLFrame(); #endif +private: + bool m_libGL = QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL; }; Q_DECLARE_METATYPE(const uchar *) @@ -212,9 +214,9 @@ void tst_QPainterVideoSurface::supportedFormat_data() << QAbstractVideoBuffer::NoHandle << QVideoFrame::Format_RGB24 << QSize(1024, 768) -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) - << true - << true; +#if !defined(QT_OPENGL_ES) + << m_libGL + << m_libGL; #else << false << false; @@ -223,8 +225,8 @@ void tst_QPainterVideoSurface::supportedFormat_data() << QAbstractVideoBuffer::NoHandle << QVideoFrame::Format_RGB24 << QSize(-1024, -768) -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) - << true +#if !defined(QT_OPENGL_ES) + << m_libGL #else << false #endif @@ -374,18 +376,19 @@ void tst_QPainterVideoSurface::present_data() << int(sizeof(argb32ImageData)) << 8; -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) - QTest::newRow("rgb32 -> rgb24") - << QVideoFrame::Format_RGB32 - << QSize(2, 2) - << static_cast<const uchar *>(rgb32ImageData) - << int(sizeof(rgb32ImageData)) - << 8 - << QVideoFrame::Format_RGB24 - << QSize(2, 2) - << static_cast<const uchar *>(rgb24ImageData) - << int(sizeof(rgb24ImageData)) - << 8; +#if !defined(QT_OPENGL_ES) + if (m_libGL) + QTest::newRow("rgb32 -> rgb24") + << QVideoFrame::Format_RGB32 + << QSize(2, 2) + << static_cast<const uchar *>(rgb32ImageData) + << int(sizeof(rgb32ImageData)) + << 8 + << QVideoFrame::Format_RGB24 + << QSize(2, 2) + << static_cast<const uchar *>(rgb24ImageData) + << int(sizeof(rgb24ImageData)) + << 8; #endif QTest::newRow("rgb32 -> rgb565") @@ -400,18 +403,19 @@ void tst_QPainterVideoSurface::present_data() << int(sizeof(rgb565ImageData)) << 4; -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) - QTest::newRow("rgb24 -> rgb565") - << QVideoFrame::Format_RGB24 - << QSize(2, 2) - << static_cast<const uchar *>(rgb24ImageData) - << int(sizeof(rgb24ImageData)) - << 8 - << QVideoFrame::Format_RGB565 - << QSize(2, 2) - << static_cast<const uchar *>(rgb565ImageData) - << int(sizeof(rgb565ImageData)) - << 4; +#if !defined(QT_OPENGL_ES) + if (m_libGL) + QTest::newRow("rgb24 -> rgb565") + << QVideoFrame::Format_RGB24 + << QSize(2, 2) + << static_cast<const uchar *>(rgb24ImageData) + << int(sizeof(rgb24ImageData)) + << 8 + << QVideoFrame::Format_RGB565 + << QSize(2, 2) + << static_cast<const uchar *>(rgb565ImageData) + << int(sizeof(rgb565ImageData)) + << 4; #endif } @@ -580,7 +584,7 @@ void tst_QPainterVideoSurface::shaderType() QCOMPARE(spy.count(), 0); } -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_OPENGL_ES) if (surface.supportedShaderTypes() & QPainterVideoSurface::FragmentProgramShader) { QSignalSpy spy(&surface, SIGNAL(supportedFormatsChanged())); @@ -625,7 +629,7 @@ void tst_QPainterVideoSurface::shaderType() QCOMPARE(surface.shaderType(), QPainterVideoSurface::NoShaders); QCOMPARE(spy.count(), 0); -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_OPENGL_ES) surface.setShaderType(QPainterVideoSurface::FragmentProgramShader); QCOMPARE(surface.shaderType(), QPainterVideoSurface::NoShaders); QCOMPARE(spy.count(), 0); @@ -641,7 +645,7 @@ void tst_QPainterVideoSurface::shaderTypeStarted_data() { QTest::addColumn<QPainterVideoSurface::ShaderType>("shaderType"); -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_OPENGL_ES) QTest::newRow("ARBfp") << QPainterVideoSurface::FragmentProgramShader; #endif @@ -729,7 +733,7 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data() QList<QPair<QPainterVideoSurface::ShaderType, QByteArray> > types; -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_OPENGL_ES) types << qMakePair(QPainterVideoSurface::FragmentProgramShader, QByteArray("ARBfp: ")); #endif types << qMakePair(QPainterVideoSurface::GlslShader, QByteArray("GLSL: ")); @@ -776,9 +780,9 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data() << QAbstractVideoBuffer::NoHandle << QVideoFrame::Format_RGB24 << QSize(1024, 768) -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) - << true - << true; +#if !defined(QT_OPENGL_ES) + << m_libGL + << m_libGL; #else << false << false; @@ -788,8 +792,8 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data() << QAbstractVideoBuffer::NoHandle << QVideoFrame::Format_RGB24 << QSize(-1024, -768) -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) - << true +#if !defined(QT_OPENGL_ES) + << m_libGL #else << false #endif @@ -949,7 +953,7 @@ void tst_QPainterVideoSurface::shaderPresent_data() QTest::addColumn<int>("bytesPerLineB"); QList<QPair<QPainterVideoSurface::ShaderType, QByteArray> > types; -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_OPENGL_ES) types << qMakePair(QPainterVideoSurface::FragmentProgramShader, QByteArray("ARBfp: ")); #endif types << qMakePair(QPainterVideoSurface::GlslShader, QByteArray("GLSL: ")); @@ -1149,7 +1153,7 @@ void tst_QPainterVideoSurface::shaderPresentOpaqueFrame_data() { QTest::addColumn<QPainterVideoSurface::ShaderType>("shaderType"); -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_OPENGL_ES) QTest::newRow("ARBfp") << QPainterVideoSurface::FragmentProgramShader; #endif @@ -1203,7 +1207,7 @@ void tst_QPainterVideoSurface::shaderPresentGLFrame_data() { QTest::addColumn<QPainterVideoSurface::ShaderType>("shaderType"); -#if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_OPENGL_ES) QTest::newRow("ARBfp") << QPainterVideoSurface::FragmentProgramShader; #endif |