summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2019-02-18 13:09:58 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2019-02-27 13:00:56 +0000
commit42b42602c40ade7b057b1e169b99405e0c17b01f (patch)
tree2fd211fe7023f298569663d2dc893541a38aaace /tests/auto
parent97e78b0e1f0396cdee0319bafaf8ce1d6eb74f64 (diff)
QTextureFileReader: add support for astc format files
The standard astc encoder has its own file format. Change-Id: I9a2f7b1fa20ba344b79637bafb50ff2bd0596747 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc2
-rw-r--r--tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astcbin0 -> 2512 bytes
-rw-r--r--tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astcbin0 -> 2512 bytes
-rw-r--r--tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp70
4 files changed, 48 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
new file mode 100644
index 0000000000..39bf3f1734
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astc
Binary files differ
diff --git a/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc
new file mode 100644
index 0000000000..38e876829b
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc
Binary files differ
diff --git a/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
index 9ff4f0ccf2..9b78d18954 100644
--- a/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
+++ b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
@@ -49,33 +49,55 @@ 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);
+ 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);
}
void tst_qtexturefilereader::checkHandlers()