diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-05 14:22:45 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-05 14:22:45 +0200 |
commit | f2856875843efce9a00e90dad05bde358ab82197 (patch) | |
tree | 93346c38504ce04f0bf02dfe4a21299feb1be8ed /tests/auto/gui/image | |
parent | a7b04275082d065f392e7f18c54ea9b41507ae40 (diff) | |
parent | a2970719c26c946fd6fea7d902aad6706a4ca6ea (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
examples/corelib/ipc/ipc.pro
src/plugins/platforms/xcb/qxcbbackingstore.cpp
tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
Change-Id: Ia006e10ff1732fe78f90138c41f05b59b49486cf
Diffstat (limited to 'tests/auto/gui/image')
-rw-r--r-- | tests/auto/gui/image/qimage/qimage.pro | 2 | ||||
-rw-r--r-- | tests/auto/gui/image/qimage/tst_qimage.cpp | 29 | ||||
-rw-r--r-- | tests/auto/gui/image/qimagereader/qimagereader.pro | 2 | ||||
-rw-r--r-- | tests/auto/gui/image/qimagewriter/qimagewriter.pro | 2 | ||||
-rw-r--r-- | tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_16x16.png | bin | 1454 -> 1335 bytes | |||
-rw-r--r-- | tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_32x32.png | bin | 1721 -> 1577 bytes | |||
-rw-r--r-- | tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_48x48.png | bin | 1967 -> 1778 bytes | |||
-rw-r--r-- | tests/auto/gui/image/qpixmap/loadFromData/designer_argb32.png | bin | 4189 -> 2874 bytes | |||
-rw-r--r-- | tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_no_alpha.png | bin | 2431 -> 2365 bytes | |||
-rw-r--r-- | tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_with_alpha.png | bin | 1405 -> 1339 bytes |
10 files changed, 32 insertions, 3 deletions
diff --git a/tests/auto/gui/image/qimage/qimage.pro b/tests/auto/gui/image/qimage/qimage.pro index d32e84c0d7..36d64a275f 100644 --- a/tests/auto/gui/image/qimage/qimage.pro +++ b/tests/auto/gui/image/qimage/qimage.pro @@ -5,6 +5,6 @@ SOURCES += tst_qimage.cpp QT += core-private gui-private testlib contains(QT_CONFIG, c++11): CONFIG += c++11 -android:!android-no-sdk:RESOURCES+=qimage.qrc +android: RESOURCES+=qimage.qrc TESTDATA += images/* diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index dd10ba2e82..cc75846fdd 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -193,6 +193,7 @@ private slots: void metadataPassthrough(); void pixelColor(); + void pixel(); private: const QString m_prefix; @@ -3077,5 +3078,33 @@ void tst_QImage::pixelColor() QCOMPARE(t.pixel(0,0), argb32pm.pixel(0,0)); } +void tst_QImage::pixel() +{ + { + QImage mono(1, 1, QImage::Format_Mono); + QImage monolsb(1, 1, QImage::Format_MonoLSB); + QImage indexed(1, 1, QImage::Format_Indexed8); + + mono.fill(0); + monolsb.fill(0); + indexed.fill(0); + + QCOMPARE(QColor(mono.pixel(0, 0)), QColor(Qt::black)); + QCOMPARE(QColor(monolsb.pixel(0, 0)), QColor(Qt::black)); + indexed.pixel(0, 0); // Don't crash + } + + { + uchar a = 0; + QImage mono(&a, 1, 1, QImage::Format_Mono); + QImage monolsb(&a, 1, 1, QImage::Format_MonoLSB); + QImage indexed(&a, 1, 1, QImage::Format_Indexed8); + + QCOMPARE(QColor(mono.pixel(0, 0)), QColor(Qt::black)); + QCOMPARE(QColor(monolsb.pixel(0, 0)), QColor(Qt::black)); + indexed.pixel(0, 0); // Don't crash + } +} + QTEST_GUILESS_MAIN(tst_QImage) #include "tst_qimage.moc" diff --git a/tests/auto/gui/image/qimagereader/qimagereader.pro b/tests/auto/gui/image/qimagereader/qimagereader.pro index 2ab06abe83..3d35bf59da 100644 --- a/tests/auto/gui/image/qimagereader/qimagereader.pro +++ b/tests/auto/gui/image/qimagereader/qimagereader.pro @@ -5,7 +5,7 @@ MOC_DIR=tmp QT += core-private gui-private network testlib RESOURCES += qimagereader.qrc -android: !android-no-sdk { +android { RESOURCES += android_testdata.qrc } diff --git a/tests/auto/gui/image/qimagewriter/qimagewriter.pro b/tests/auto/gui/image/qimagewriter/qimagewriter.pro index 31184bffdb..34adedd187 100644 --- a/tests/auto/gui/image/qimagewriter/qimagewriter.pro +++ b/tests/auto/gui/image/qimagewriter/qimagewriter.pro @@ -3,5 +3,5 @@ TARGET = tst_qimagewriter QT += testlib SOURCES += tst_qimagewriter.cpp MOC_DIR=tmp -android:!android-no-sdk:RESOURCES+= qimagewriter.qrc +android: RESOURCES+= qimagewriter.qrc TESTDATA += images/* diff --git a/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_16x16.png b/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_16x16.png Binary files differindex e9a995e19e..03b1a65f70 100644 --- a/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_16x16.png +++ b/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_16x16.png diff --git a/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_32x32.png b/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_32x32.png Binary files differindex 41ef57f94d..0ef47c556d 100644 --- a/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_32x32.png +++ b/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_32x32.png diff --git a/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_48x48.png b/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_48x48.png Binary files differindex 35d60d138b..2060854802 100644 --- a/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_48x48.png +++ b/tests/auto/gui/image/qpixmap/convertFromToHICON/icon_8bpp_48x48.png diff --git a/tests/auto/gui/image/qpixmap/loadFromData/designer_argb32.png b/tests/auto/gui/image/qpixmap/loadFromData/designer_argb32.png Binary files differindex 55d8247cfc..a35316b9c9 100644 --- a/tests/auto/gui/image/qpixmap/loadFromData/designer_argb32.png +++ b/tests/auto/gui/image/qpixmap/loadFromData/designer_argb32.png diff --git a/tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_no_alpha.png b/tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_no_alpha.png Binary files differindex 28cd2f06d1..3dd2115df1 100644 --- a/tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_no_alpha.png +++ b/tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_no_alpha.png diff --git a/tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_with_alpha.png b/tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_with_alpha.png Binary files differindex 09735a9752..99cbf4f13a 100644 --- a/tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_with_alpha.png +++ b/tests/auto/gui/image/qpixmap/loadFromData/designer_indexed8_with_alpha.png |