diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-02-18 13:09:58 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2019-08-15 09:26:11 +0200 |
commit | a547404c12b50b8c9ab6a078fce5ce9a7300586f (patch) | |
tree | d34abf995daa99800cd234ca74810c4e26644633 /tests | |
parent | 31e0d171d605159a83dbee3379a38e4dcd1f4b19 (diff) |
QTextureFileReader: backport ASTC support
Add support for astc format files as an experimental feature.
To enable, configure with "-feature-texture_format_astc_experimental"
(Backported from commit 5a4db421bd94acd12a4ac1f77031996b95f85dbf)
Change-Id: I9a2f7b1fa20ba344b79637bafb50ff2bd0596747
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc | 2 | ||||
-rw-r--r-- | tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astc | bin | 0 -> 2512 bytes | |||
-rw-r--r-- | tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc | bin | 0 -> 2512 bytes | |||
-rw-r--r-- | tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp | 73 |
4 files changed, 51 insertions, 24 deletions
diff --git a/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc b/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc index ab882b5db2..8aab86e1ff 100644 --- a/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc +++ b/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc @@ -3,5 +3,7 @@ <file>texturefiles/car.ktx</file> <file>texturefiles/pattern.pkm</file> <file>texturefiles/car_mips.ktx</file> + <file>texturefiles/newlogo_srgb.astc</file> + <file>texturefiles/newlogo.astc</file> </qresource> </RCC> diff --git a/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astc b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astc Binary files differnew file mode 100644 index 0000000000..39bf3f1734 --- /dev/null +++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astc diff --git a/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc Binary files differnew file mode 100644 index 0000000000..38e876829b --- /dev/null +++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc diff --git a/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp index 9ff4f0ccf2..7939b688af 100644 --- a/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp +++ b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp @@ -27,6 +27,7 @@ ****************************************************************************/ #include <private/qtexturefilereader_p.h> +#include <private/qtguiglobal_p.h> #include <QtTest> class tst_qtexturefilereader : public QObject @@ -49,33 +50,57 @@ void tst_qtexturefilereader::checkHandlers_data() QTest::addColumn<QList<int>>("dataOffsets"); QTest::addColumn<QList<int>>("dataLengths"); - QTest::addRow("pattern.pkm") << QStringLiteral(":/texturefiles/pattern.pkm") - << QSize(64, 64) - << quint32(0x0) - << quint32(0x8d64) - << quint32(0x0) - << 1 - << (QList<int>() << 16) - << (QList<int>() << 2048); + QTest::addRow("pattern.pkm") + << QStringLiteral(":/texturefiles/pattern.pkm") + << QSize(64, 64) + << quint32(0x0) + << quint32(0x8d64) + << quint32(0x0) + << 1 + << (QList<int>() << 16) + << (QList<int>() << 2048); - QTest::addRow("car.ktx") << QStringLiteral(":/texturefiles/car.ktx") - << QSize(146, 80) - << quint32(0x0) - << quint32(0x9278) - << quint32(0x1908) - << 1 - << (QList<int>() << 68) - << (QList<int>() << 11840); + QTest::addRow("car.ktx") + << QStringLiteral(":/texturefiles/car.ktx") + << QSize(146, 80) + << quint32(0x0) + << quint32(0x9278) + << quint32(0x1908) + << 1 + << (QList<int>() << 68) + << (QList<int>() << 11840); - QTest::addRow("car_mips.ktx") << QStringLiteral(":/texturefiles/car_mips.ktx") - << QSize(146, 80) - << quint32(0x0) - << quint32(0x9274) - << quint32(0x1907) - << 8 - << (QList<int>() << 68 << 5992 << 7516 << 7880 << 8004 << 8056 << 8068 << 8080) - << (QList<int>() << 5920 << 1520 << 360 << 120 << 48 << 8 << 8 << 8); + QTest::addRow("car_mips.ktx") + << QStringLiteral(":/texturefiles/car_mips.ktx") + << QSize(146, 80) + << quint32(0x0) + << quint32(0x9274) + << quint32(0x1907) + << 8 + << (QList<int>() << 68 << 5992 << 7516 << 7880 << 8004 << 8056 << 8068 << 8080) + << (QList<int>() << 5920 << 1520 << 360 << 120 << 48 << 8 << 8 << 8); +#if QT_CONFIG(texture_format_astc_experimental) + QTest::addRow("newlogo.astc") + << QStringLiteral(":/texturefiles/newlogo.astc") + << QSize(111, 78) + << quint32(0x0) + << quint32(0x93b9) + << quint32(0x0) + << 1 + << (QList<int>() << 16) + << (QList<int>() << 2496); + + QTest::addRow("newlogo_srgb.astc") + << QStringLiteral(":/texturefiles/newlogo_srgb.astc") + << QSize(111, 78) + << quint32(0x0) + << quint32(0x93d9) + << quint32(0x0) + << 1 + << (QList<int>() << 16) + << (QList<int>() << 2496); +#endif // QT_CONFIG(texture_format_astc_experimental) } void tst_qtexturefilereader::checkHandlers() |