diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-17 23:13:37 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-17 23:13:37 (GMT) |
commit | 1dd510f486937974bf342dcbd6ce7cb7bb331375 (patch) | |
tree | 08020d0a10b554abdf108cfa40c37d2d9e4f6d6c | |
parent | f412a9cb0bd1438d1518cf6a8eda3fda5fbf64f5 (diff) | |
parent | a65f53a09c2a5950bd8b98fd791dc413bb11f9bf (diff) | |
download | Qt-1dd510f486937974bf342dcbd6ce7cb7bb331375.zip Qt-1dd510f486937974bf342dcbd6ce7cb7bb331375.tar.gz Qt-1dd510f486937974bf342dcbd6ce7cb7bb331375.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fixed compilation of MeeGo graphics system without eglext.h
Fixed memory corruption issue in qt_blurImage for Indexed8 images.
-rw-r--r-- | src/gui/image/qpixmapfilter.cpp | 15 | ||||
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegoextensions.h | 1 | ||||
-rw-r--r-- | tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp | 20 |
3 files changed, 31 insertions, 5 deletions
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index 70770c4..26bffcc 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -764,10 +764,17 @@ void expblur(QImage &img, qreal radius, bool improvedQuality = false, int transp } if (transposed == 0) { - qt_memrotate90(reinterpret_cast<const quint32*>(temp.bits()), - temp.width(), temp.height(), temp.bytesPerLine(), - reinterpret_cast<quint32*>(img.bits()), - img.bytesPerLine()); + if (img.depth() == 8) { + qt_memrotate90(reinterpret_cast<const quint8*>(temp.bits()), + temp.width(), temp.height(), temp.bytesPerLine(), + reinterpret_cast<quint8*>(img.bits()), + img.bytesPerLine()); + } else { + qt_memrotate90(reinterpret_cast<const quint32*>(temp.bits()), + temp.width(), temp.height(), temp.bytesPerLine(), + reinterpret_cast<quint32*>(img.bits()), + img.bytesPerLine()); + } } else { img = temp; } diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.h b/src/plugins/graphicssystems/meego/qmeegoextensions.h index 7f219de..f1a74f5 100644 --- a/src/plugins/graphicssystems/meego/qmeegoextensions.h +++ b/src/plugins/graphicssystems/meego/qmeegoextensions.h @@ -43,7 +43,6 @@ #define MEXTENSIONS_H #include <EGL/egl.h> -#include <EGL/eglext.h> #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <private/qgl_p.h> diff --git a/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp b/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp index f0f087d..1f51d51 100644 --- a/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp +++ b/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp @@ -72,6 +72,7 @@ private slots: void convolutionBoundingRectFor(); void convolutionDrawSubRect(); void dropShadowBoundingRectFor(); + void blurIndexed8(); void testDefaultImplementations(); }; @@ -423,6 +424,25 @@ void tst_QPixmapFilter::dropShadowBoundingRectFor() QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-delta - 10, -delta - 10, 0, 0)); } +void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); + +void tst_QPixmapFilter::blurIndexed8() +{ + QImage img(16, 32, QImage::Format_Indexed8); + img.setColorCount(256); + for (int i = 0; i < 256; ++i) + img.setColor(i, qRgb(i, i, i)); + + img.fill(255); + + QImage original = img; + qt_blurImage(img, 10, true, false); + QCOMPARE(original.size(), img.size()); + + original = img; + qt_blurImage(img, 10, true, true); + QCOMPARE(original.size(), QSize(img.height(), img.width())); +} QTEST_MAIN(tst_QPixmapFilter) #include "tst_qpixmapfilter.moc" |