Improve surface format request for baseline test of GL painter
Different platforms and drivers hae different defaults, so make sure to request what we need. Change-Id: I54ae6e0770fea53fbf59c86d7e55aa5897292b67 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 0ff7328f376a9a1f1d560e1a2bd9f818ae47f8ae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f01b63af89
commit
5b1dec994f
@ -66,7 +66,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void setupTestSuite(const QStringList& blacklist = QStringList());
|
void setupTestSuite(const QStringList& blacklist = QStringList());
|
||||||
void runTestSuite(GraphicsEngine engine, QImage::Format format, const QSurfaceFormat &contextFormat = QSurfaceFormat());
|
void runTestSuite(GraphicsEngine engine, QImage::Format format,
|
||||||
|
const QSurfaceFormat &contextFormat = QSurfaceFormat::defaultFormat());
|
||||||
void paint(QPaintDevice *device, GraphicsEngine engine, QImage::Format format, const QStringList &script, const QString &filePath);
|
void paint(QPaintDevice *device, GraphicsEngine engine, QImage::Format format, const QStringList &script, const QString &filePath);
|
||||||
|
|
||||||
QStringList qpsFiles;
|
QStringList qpsFiles;
|
||||||
@ -112,6 +113,7 @@ private slots:
|
|||||||
void testCoreOpenGL_data();
|
void testCoreOpenGL_data();
|
||||||
void testCoreOpenGL();
|
void testCoreOpenGL();
|
||||||
private:
|
private:
|
||||||
|
void initOpenGL();
|
||||||
bool checkSystemGLSupport();
|
bool checkSystemGLSupport();
|
||||||
bool checkSystemCoreGLSupport();
|
bool checkSystemCoreGLSupport();
|
||||||
#endif
|
#endif
|
||||||
@ -148,6 +150,10 @@ void tst_Lancelot::initTestCase()
|
|||||||
scripts.insert(fileName, QString::fromUtf8(cont).split(QLatin1Char('\n'), Qt::SkipEmptyParts));
|
scripts.insert(fileName, QString::fromUtf8(cont).split(QLatin1Char('\n'), Qt::SkipEmptyParts));
|
||||||
scriptChecksums.insert(fileName, qChecksum(cont));
|
scriptChecksums.insert(fileName, qChecksum(cont));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_OPENGL
|
||||||
|
initOpenGL();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -292,6 +298,14 @@ void tst_Lancelot::testPdf()
|
|||||||
|
|
||||||
|
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
|
void tst_Lancelot::initOpenGL()
|
||||||
|
{
|
||||||
|
// Stencil buffer is needed for clipping
|
||||||
|
QSurfaceFormat glFormat;
|
||||||
|
glFormat.setStencilBufferSize(8);
|
||||||
|
QSurfaceFormat::setDefaultFormat(glFormat);
|
||||||
|
}
|
||||||
|
|
||||||
bool tst_Lancelot::checkSystemGLSupport()
|
bool tst_Lancelot::checkSystemGLSupport()
|
||||||
{
|
{
|
||||||
QWindow win;
|
QWindow win;
|
||||||
@ -315,7 +329,7 @@ bool tst_Lancelot::checkSystemCoreGLSupport()
|
|||||||
if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL)
|
if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QSurfaceFormat coreFormat;
|
QSurfaceFormat coreFormat(QSurfaceFormat::defaultFormat());
|
||||||
coreFormat.setVersion(3, 2);
|
coreFormat.setVersion(3, 2);
|
||||||
coreFormat.setProfile(QSurfaceFormat::CoreProfile);
|
coreFormat.setProfile(QSurfaceFormat::CoreProfile);
|
||||||
QWindow win;
|
QWindow win;
|
||||||
@ -370,7 +384,7 @@ void tst_Lancelot::testCoreOpenGL_data()
|
|||||||
|
|
||||||
void tst_Lancelot::testCoreOpenGL()
|
void tst_Lancelot::testCoreOpenGL()
|
||||||
{
|
{
|
||||||
QSurfaceFormat coreFormat;
|
QSurfaceFormat coreFormat(QSurfaceFormat::defaultFormat());
|
||||||
coreFormat.setVersion(3, 2);
|
coreFormat.setVersion(3, 2);
|
||||||
coreFormat.setProfile(QSurfaceFormat::CoreProfile);
|
coreFormat.setProfile(QSurfaceFormat::CoreProfile);
|
||||||
runTestSuite(OpenGL, QImage::Format_RGB32, coreFormat);
|
runTestSuite(OpenGL, QImage::Format_RGB32, coreFormat);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user