summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-08-02 09:11:52 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-08-02 09:14:22 (GMT)
commitf127fadc833f7b64977877879787d96586d0a501 (patch)
treedb57d2c7f85cceaa7b7c486ddf5da18164c10286 /tests
parent79366cdeef2a378356e2d6fdbceb68c6419ec062 (diff)
downloadQt-f127fadc833f7b64977877879787d96586d0a501.zip
Qt-f127fadc833f7b64977877879787d96586d0a501.tar.gz
Qt-f127fadc833f7b64977877879787d96586d0a501.tar.bz2
Revert "Fix the byte order in QImage::fill for 24bpp formats"
This change the behavior. (as it break tests like drawImage_task258776 and tst_QPainter::drawhelper_blend_color) The bug it fixes is not considered importent enough This reverts commit 121c5143f1002734ff7aa62785ff14e0e6612aae and d8c6ae24f94133828f4f1b536538e69c5e438202
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qimage/tst_qimage.cpp64
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp2
2 files changed, 1 insertions, 65 deletions
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index 62deb5ae..1330d96 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -103,9 +103,6 @@ private slots:
void copy();
- void fill_data();
- void fill();
-
void setPixel_data();
void setPixel();
@@ -1018,67 +1015,6 @@ void tst_QImage::copy()
}
}
-void tst_QImage::fill_data()
-{
- QTest::addColumn<int>("format");
- QTest::addColumn<uint>("input");
- QTest::addColumn<uint>("expectedResult");
-
- QTest::newRow("ARGB32") << int(QImage::Format_ARGB32) << 0x33557799u << 0x33557799u;
- QTest::newRow("RGB888") << int(QImage::Format_RGB888) << 0x335577u << 0x335577u;
- QTest::newRow("RGB16") << int(QImage::Format_RGB16) << 0x3355u << 0x3355u;
- QTest::newRow("Indexed8") << int(QImage::Format_Indexed8) << 0x55u << 0x55u;
- QTest::newRow("Mono") << int(QImage::Format_Mono) << 1u << 1u;
- QTest::newRow("Mono_LSB") << int(QImage::Format_MonoLSB) << 0u << 0u;
-}
-
-void tst_QImage::fill()
-{
- QFETCH(int, format);
- QFETCH(uint, input);
- QFETCH(uint, expectedResult);
-
- QImage img(13, 15, (QImage::Format)format);
- img.fill(input);
-
- const int bpp = img.depth();
- for (int y = 0; y < img.height(); ++y) {
- uchar *line = img.scanLine(y);
- for (int x = 0; x < img.width(); ++x) {
- uint value;
- switch (bpp) {
- case 32:
- value = *((uint*)line);
- line += 4;
- break;
- case 24:
- value = ((uint)line[0] << 16) | ((uint)line[1] << 8) | line[2];
- line += 3;
- break;
- case 16:
- value = *((quint16*)line);
- line += 2;
- break;
- case 8:
- value = *line;
- line++;
- break;
- case 1:
- if (format == QImage::Format_Mono)
- value = (*line >> (7- (x & 7))) & 1;
- else if (format == QImage::Format_MonoLSB)
- value = (*line >> (x & 7)) & 1;
-
- if (x && !(x & 7))
- ++line;
- break;
- }
-
- QCOMPARE(value, expectedResult);
- }
- }
-}
-
void tst_QImage::setPixel_data()
{
QTest::addColumn<int>("format");
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 7679545..2cbb9b2 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -3642,7 +3642,7 @@ void tst_QPainter::drawImage_task258776()
painter.end();
QImage expected(33, 33, QImage::Format_RGB32);
- expected.fill(0x0000ff);
+ expected.fill(0xff0000);
painter.begin(&expected);
painter.drawImage(QRectF(0, 0, 32, 32), src);