From 4da1a3b63445c04d4ca4acae448e9b6b046938c3 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 19 Jul 2010 17:04:06 +0200 Subject: moc: Slot with complex template default value does not compile The way we detect the end of a default argument does not take in account template parametter. It is unfortunatelly not trivial to do it properly without semantic information So we will use heuristics and if the number of < matches the number of > we consider it is a template. Or if we have a '=' we consider it is not a template. Task-number: QTBUG-12260 Reviewed-by: Roberto Raggi --- src/tools/moc/moc.cpp | 22 +++++++++++++++++++++- tests/auto/moc/tst_moc.cpp | 15 +++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 10a80f3..84d1567 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -1208,6 +1208,12 @@ bool Moc::until(Token target) { default: break; } } + + //when searching commas within the default argument, we should take care of template depth (anglecount) + // unfortunatelly, we do not have enough semantic information to know if '<' is the operator< or + // the begining of a template type. so we just use heuristics. + int possible = -1; + while (index < symbols.size()) { Token t = symbols.at(index++).token; switch (t) { @@ -1226,8 +1232,16 @@ bool Moc::until(Token target) { && braceCount <= 0 && brackCount <= 0 && parenCount <= 0 - && (target != RANGLE || angleCount <= 0)) + && (target != RANGLE || angleCount <= 0)) { + if (target != COMMA || angleCount <= 0) + return true; + possible = index; + } + + if (target == COMMA && t == EQ && possible != -1) { + index = possible; return true; + } if (braceCount < 0 || brackCount < 0 || parenCount < 0 || (target == RANGLE && angleCount < 0)) { @@ -1235,6 +1249,12 @@ bool Moc::until(Token target) { break; } } + + if(target == COMMA && angleCount != 0 && possible != -1) { + index = possible; + return true; + } + return false; } diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp index 19f3677..4fcc7bd 100644 --- a/tests/auto/moc/tst_moc.cpp +++ b/tests/auto/moc/tst_moc.cpp @@ -491,6 +491,7 @@ private slots: void typenameWithUnsigned(); void warnOnVirtualSignal(); void QTBUG5590_dummyProperty(); + void QTBUG12260_defaultTemplate(); signals: void sigWithUnsignedArg(unsigned foo); void sigWithSignedArg(signed foo); @@ -1340,6 +1341,20 @@ signals: void testSignal(TestTemplate2); }; +class QTBUG12260_defaultTemplate_Object : public QObject +{ Q_OBJECT +public slots: + void doSomething(QHash values = QHash()) { Q_UNUSED(values); } + void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); } +}; + + +void tst_Moc::QTBUG12260_defaultTemplate() +{ + QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash)") != -1); + QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1); +} + QTEST_APPLESS_MAIN(tst_Moc) #include "tst_moc.moc" -- cgit v0.12 From 4df9c96e2c213c39924e22e02621b0c61e83f8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 20 Jul 2010 10:32:59 +0200 Subject: QGraphicsItem: Animation leaves drawing artifacts when clipping is used. This only happens when the ItemHasNoContents and ItemClipsChildrenToShape flags are set. Problem is that items with no content are threated as 'dummy' items, which means they are never drawn or 'processed' otherwise, so the cached bounding rect is not reliable/usable. This means that in case of changing the geometry of such items, its children always have to take care of invalidating the occupied areas and the update can not be clipped to the item's bounding rect. Regression after commit: c1c7dbf2 Auto test included. Task-number: QTBUG-11504 Reviewed-by: yoann --- src/gui/graphicsview/qgraphicsscene.cpp | 7 ++- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 73 ++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 4bc7f4c..48a0093 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5178,7 +5178,12 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool // Process children. if (itemHasChildren && item->d_ptr->dirtyChildren) { const bool itemClipsChildrenToShape = item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape; - if (itemClipsChildrenToShape) { + // Items with no content are threated as 'dummy' items which means they are never drawn and + // 'processed', so the painted view bounding rect is never up-to-date. This means that whenever + // such an item changes geometry, its children have to take care of the update regardless + // of whether the item clips children to shape or not. + const bool bypassUpdateClip = !itemHasContents && wasDirtyParentViewBoundingRects; + if (itemClipsChildrenToShape && !bypassUpdateClip) { // Make sure child updates are clipped to the item's bounding rect. for (int i = 0; i < views.size(); ++i) views.at(i)->d_func()->setUpdateClip(item); diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index b8df7f6..1cce687 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -219,6 +219,7 @@ private slots: void update2_data(); void update2(); void update_ancestorClipsChildrenToShape(); + void update_ancestorClipsChildrenToShape2(); void inputMethodSensitivity(); void inputContextReset(); void indirectPainting(); @@ -3815,6 +3816,78 @@ void tst_QGraphicsView::update_ancestorClipsChildrenToShape() #endif } +void tst_QGraphicsView::update_ancestorClipsChildrenToShape2() +{ + QGraphicsScene scene(-150, -150, 300, 300); + + /* + Add two rects: + + +------------------+ + | child | + | +--------------+ | + | | parent | | + | | | | + | | | | + | | | | + | +--------------+ | + +------------------+ + + ... where the parent has no contents and clips the child to shape. + */ + QApplication::processEvents(); // Get rid of pending update. + + QGraphicsRectItem *parent = static_cast(scene.addRect(-50, -50, 100, 100)); + parent->setBrush(QColor(0, 0, 255, 125)); + parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape); + parent->setFlag(QGraphicsItem::ItemHasNoContents); + + QGraphicsRectItem *child = static_cast(scene.addRect(-100, -100, 200, 200)); + child->setBrush(QColor(255, 0, 0, 125)); + child->setParentItem(parent); + + CustomView view(&scene); + view.show(); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(view.painted); + + view.lastUpdateRegions.clear(); + view.painted = false; + + // Call child->update() and make sure the updated area is within its parent's clip. + QRectF expected = child->deviceTransform(view.viewportTransform()).mapRect(child->boundingRect()); + expected &= parent->deviceTransform(view.viewportTransform()).mapRect(parent->boundingRect()); + + child->update(); + QTRY_VERIFY(view.painted); + +#ifndef QT_MAC_USE_COCOA //cocoa doesn't support drawing regions + QTRY_VERIFY(view.painted); + QCOMPARE(view.lastUpdateRegions.size(), 1); + QCOMPARE(view.lastUpdateRegions.at(0), QRegion(expected.toAlignedRect())); +#endif + + QTest::qWait(50); + + view.lastUpdateRegions.clear(); + view.painted = false; + + // Invalidate the parent's geometry and trigger an update. + // The update area should be clipped to the parent's bounding rect for 'normal' items, + // but in this case the item has no contents (ItemHasNoContents) and its geometry + // is invalidated, which means we cannot clip the child update. So, the expected + // area is exactly the same as the child's bounding rect (adjusted for antialiasing). + parent->setRect(parent->rect().adjusted(-10, -10, -10, -10)); + expected = child->deviceTransform(view.viewportTransform()).mapRect(child->boundingRect()); + expected.adjust(-2, -2, 2, 2); // Antialiasing + +#ifndef QT_MAC_USE_COCOA //cocoa doesn't support drawing regions + QTRY_VERIFY(view.painted); + QCOMPARE(view.lastUpdateRegions.size(), 1); + QCOMPARE(view.lastUpdateRegions.at(0), QRegion(expected.toAlignedRect())); +#endif +} + class FocusItem : public QGraphicsRectItem { public: -- cgit v0.12 From 04bc2b1f37750a2afbb88521001758249a8df383 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 20 Jul 2010 12:29:19 +0200 Subject: doc: Fix qdoc errors for text related files QTextBlock::layoutDirection() doesn't exist, and the QStaticText constructor no longer takes a size argument. Task-number: QTBUG-12072 Reviewed-by: Fabien Freling --- src/gui/text/qstatictext.cpp | 4 +--- src/gui/text/qtextobject.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index ab518d0..f6daed8 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -148,9 +148,7 @@ QStaticText::QStaticText() } /*! - Constructs a QStaticText object with the given \a text and bounded by the given \a size. - - If an invalid size is passed for \a size the text will be unbounded. + Constructs a QStaticText object with the given \a text. */ QStaticText::QStaticText(const QString &text) : data(new QStaticTextPrivate) diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index f386871..5fb3384 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -1148,7 +1148,7 @@ int QTextBlock::charFormatIndex() const direction from the blocks content. Returns either Qt::LeftToRight or Qt::RightToLeft. - \sa QTextBlock::layoutDirection(), QString::isRightToLeft(), Qt::LayoutDirection + \sa QTextFormat::layoutDirection(), QString::isRightToLeft(), Qt::LayoutDirection */ Qt::LayoutDirection QTextBlock::textDirection() const { -- cgit v0.12 From 64b9e63f4f9162c1af299b1355e84b0e616ad768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 20 Jul 2010 11:40:48 +0200 Subject: Do not crash due to a infinite recursion when using voiceover on MacOS The reason for the infinite recursion was that QAccessibleTitleBar::object() returned the titlebar's dockwidget. This could lead to a problem when the AT client tried to traverse the accessibility hierarchy: As a response to QAXChildrenAttribute (retrieve children) on a dock widget node, it would register it's children in the hierarchy manager. In this case, the object registered for the titlebar interface was the QDockWidget. In order to do further traversal, the bridge could call queryAccessibleInterface on the list of retrieved children to get the QAccessibleInterface for those objects, however, that would return the QAccessibleDockWidget interface that we just had traversed,.... Task-number: QTBUG-6843 Reviewed-by: Carlos Manuel Duclos Vergara --- src/plugins/accessible/widgets/qaccessiblewidgets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp index 499eb1d..662663d 100644 --- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp +++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp @@ -984,7 +984,7 @@ int QAccessibleDockWidget::childCount() const int QAccessibleDockWidget::indexOfChild(const QAccessibleInterface *child) const { if (child) { - if (qobject_cast(child->object()) == dockWidget() && child->role(0) == TitleBar) { + if (child->role(0) == TitleBar) { return 1; } else { return 2; //### @@ -1214,7 +1214,7 @@ int QAccessibleTitleBar::childAt(int x, int y) const QObject *QAccessibleTitleBar::object() const { - return m_dockWidget; + return 0; } QDockWidgetLayout *QAccessibleTitleBar::dockWidgetLayout() const -- cgit v0.12 From 5cfad3a7b24abbde6c01bba0fbf8446b3a5137f7 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 20 Jul 2010 14:37:35 +0200 Subject: Workaround gcc bug, disable test with old version of gcc --- tests/auto/moc/tst_moc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp index 4fcc7bd..d871540 100644 --- a/tests/auto/moc/tst_moc.cpp +++ b/tests/auto/moc/tst_moc.cpp @@ -1344,14 +1344,18 @@ signals: class QTBUG12260_defaultTemplate_Object : public QObject { Q_OBJECT public slots: +#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) //gcc bug, this does not compile void doSomething(QHash values = QHash()) { Q_UNUSED(values); } +#endif void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); } }; void tst_Moc::QTBUG12260_defaultTemplate() { +#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash)") != -1); +#endif QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1); } -- cgit v0.12 From 42267701edd266463c90cec82d45022446a2606a Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Tue, 20 Jul 2010 13:28:55 +0200 Subject: Add support for more vector instructions on x86 Add the configuration, autodetection, and the #define for vector instructions on x86. The configuration has been extended with SSE3, SSSE3, SSE4.1, SSE4.2 and AVX. Reviewed-by: Andreas Kling --- config.tests/unix/avx/avx.cpp | 51 ++++++++++++++++++ config.tests/unix/avx/avx.pro | 3 ++ config.tests/unix/sse3/sse3.cpp | 51 ++++++++++++++++++ config.tests/unix/sse3/sse3.pro | 3 ++ config.tests/unix/sse4_1/sse4_1.cpp | 51 ++++++++++++++++++ config.tests/unix/sse4_1/sse4_1.pro | 3 ++ config.tests/unix/sse4_2/sse4_2.cpp | 51 ++++++++++++++++++ config.tests/unix/ssse3/ssse3.cpp | 51 ++++++++++++++++++ config.tests/unix/ssse3/ssse3.pro | 3 ++ configure | 100 +++++++++++++++++++++++++++++++++++- src/corelib/corelib.pro | 15 ++++++ src/gui/gui.pro | 5 ++ 12 files changed, 386 insertions(+), 1 deletion(-) create mode 100644 config.tests/unix/avx/avx.cpp create mode 100644 config.tests/unix/avx/avx.pro create mode 100644 config.tests/unix/sse3/sse3.cpp create mode 100644 config.tests/unix/sse3/sse3.pro create mode 100644 config.tests/unix/sse4_1/sse4_1.cpp create mode 100644 config.tests/unix/sse4_1/sse4_1.pro create mode 100644 config.tests/unix/sse4_2/sse4_2.cpp create mode 100644 config.tests/unix/ssse3/ssse3.cpp create mode 100644 config.tests/unix/ssse3/ssse3.pro diff --git a/config.tests/unix/avx/avx.cpp b/config.tests/unix/avx/avx.cpp new file mode 100644 index 0000000..65a0eb8 --- /dev/null +++ b/config.tests/unix/avx/avx.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char**) +{ + volatile __m256d a = _mm256_setzero_pd(); + volatile __m256d b = _mm256_set1_pd(42.42); + volatile __m256d result = _mm256_add_pd(a, b); + (void)result; + return 0; +} diff --git a/config.tests/unix/avx/avx.pro b/config.tests/unix/avx/avx.pro new file mode 100644 index 0000000..00a0550 --- /dev/null +++ b/config.tests/unix/avx/avx.pro @@ -0,0 +1,3 @@ +SOURCES = avx.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/sse3/sse3.cpp b/config.tests/unix/sse3/sse3.cpp new file mode 100644 index 0000000..b159acf --- /dev/null +++ b/config.tests/unix/sse3/sse3.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char**) +{ + volatile __m128d a = _mm_set1_pd(6.28); + volatile __m128d b = _mm_set1_pd(3.14); + volatile __m128d result = _mm_addsub_pd(a, b); + result = _mm_movedup_pd(result); + return 0; +} diff --git a/config.tests/unix/sse3/sse3.pro b/config.tests/unix/sse3/sse3.pro new file mode 100644 index 0000000..009fea2 --- /dev/null +++ b/config.tests/unix/sse3/sse3.pro @@ -0,0 +1,3 @@ +SOURCES = sse3.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/sse4_1/sse4_1.cpp b/config.tests/unix/sse4_1/sse4_1.cpp new file mode 100644 index 0000000..e9bec9e --- /dev/null +++ b/config.tests/unix/sse4_1/sse4_1.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char**) +{ + volatile __m128 a = _mm_setzero_ps(); + _mm_ceil_ps(a); + volatile __m128i result = _mm_mullo_epi32(_mm_set1_epi32(42), _mm_set1_epi32(64)); + (void)result; + return 0; +} diff --git a/config.tests/unix/sse4_1/sse4_1.pro b/config.tests/unix/sse4_1/sse4_1.pro new file mode 100644 index 0000000..c6c4746 --- /dev/null +++ b/config.tests/unix/sse4_1/sse4_1.pro @@ -0,0 +1,3 @@ +SOURCES = sse4_1.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/sse4_2/sse4_2.cpp b/config.tests/unix/sse4_2/sse4_2.cpp new file mode 100644 index 0000000..005b2c5 --- /dev/null +++ b/config.tests/unix/sse4_2/sse4_2.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char**) +{ + volatile __m128i a = _mm_setzero_si128(); + volatile __m128i b = _mm_set1_epi32(42); + volatile __m128i result = _mm_cmpestrm(a, 16, b, 16, 0); + (void)result; + return 0; +} diff --git a/config.tests/unix/ssse3/ssse3.cpp b/config.tests/unix/ssse3/ssse3.cpp new file mode 100644 index 0000000..37fd479 --- /dev/null +++ b/config.tests/unix/ssse3/ssse3.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char**) +{ + volatile __m128i a = _mm_set1_epi32(42); + _mm_abs_epi8(a); + volatile __m128i result = _mm_sign_epi16(a, _mm_set1_epi32(64)); + (void)result; + return 0; +} diff --git a/config.tests/unix/ssse3/ssse3.pro b/config.tests/unix/ssse3/ssse3.pro new file mode 100644 index 0000000..4864267 --- /dev/null +++ b/config.tests/unix/ssse3/ssse3.pro @@ -0,0 +1,3 @@ +SOURCES = ssse3.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle diff --git a/configure b/configure index 11496c4..1122c7e 100755 --- a/configure +++ b/configure @@ -740,6 +740,11 @@ CFG_MMX=auto CFG_3DNOW=auto CFG_SSE=auto CFG_SSE2=auto +CFG_SSE3=auto +CFG_SSSE3=auto +CFG_SSE4_1=auto +CFG_SSE4_2=auto +CFG_AVX=auto CFG_REDUCE_RELOCATIONS=no CFG_IPV6=auto CFG_NAS=no @@ -1642,6 +1647,41 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + sse3) + if [ "$VAL" = "no" ]; then + CFG_SSE3="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; + ssse3) + if [ "$VAL" = "no" ]; then + CFG_SSSE3="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; + sse4.1) + if [ "$VAL" = "no" ]; then + CFG_SSE4_1="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; + sse4.2) + if [ "$VAL" = "no" ]; then + CFG_SSE4_2="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; + avx) + if [ "$VAL" = "no" ]; then + CFG_AVX="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; iwmmxt) CFG_IWMMXT="yes" ;; @@ -3427,6 +3467,7 @@ Usage: $relconf [-h] [-prefix ] [-prefix-install] [-bindir ] [-libdir [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv] [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-gui] [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2] + [-no-sse3] [-no-ssse3] [-no-sse4.1] [-no-sse4.2] [-no-avx] [-qtnamespace ] [-qtlibinfix ] [-separate-debug-info] [-armfpa] [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns] [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend] @@ -3618,6 +3659,11 @@ cat << EOF -no-3dnow .......... Do not compile with use of 3DNOW instructions. -no-sse ............ Do not compile with use of SSE instructions. -no-sse2 ........... Do not compile with use of SSE2 instructions. + -no-sse3 ........... Do not compile with use of SSE3 instructions. + -no-ssse3 .......... Do not compile with use of SSSE3 instructions. + -no-sse4.1.......... Do not compile with use of SSE4.1 instructions. + -no-sse4.2.......... Do not compile with use of SSE4.2 instructions. + -no-avx ............ Do not compile with use of AVX instructions. -qtnamespace Wraps all Qt library code in 'namespace {...}'. -qtlibinfix Renames all libQt*.so to libQt*.so. @@ -4667,6 +4713,51 @@ if [ "${CFG_SSE2}" = "auto" ]; then fi fi +# detect sse3 support +if [ "${CFG_SSE3}" = "auto" ]; then + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse3 "sse3" $L_FLAGS $I_FLAGS $l_FLAGS "-msse3"; then + CFG_SSE3=yes + else + CFG_SSE3=no + fi +fi + +# detect ssse3 support +if [ "${CFG_SSSE3}" = "auto" ]; then + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ssse3 "ssse3" $L_FLAGS $I_FLAGS $l_FLAGS "-mssse3"; then + CFG_SSSE3=yes + else + CFG_SSSE3=no + fi +fi + +# detect sse4.1 support +if [ "${CFG_SSE4_1}" = "auto" ]; then + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse4_1 "sse4_1" $L_FLAGS $I_FLAGS $l_FLAGS "-msse4.1"; then + CFG_SSE4_1=yes + else + CFG_SSE4_1=no + fi +fi + +# detect sse4.2 support +if [ "${CFG_SSE4_2}" = "auto" ]; then + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse4_2 "sse4_2" $L_FLAGS $I_FLAGS $l_FLAGS "-msse4.2"; then + CFG_SSE4_2=yes + else + CFG_SSE4_2=no + fi +fi + +# detect avx support +if [ "${CFG_AVX}" = "auto" ]; then + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/avx "avx" $L_FLAGS $I_FLAGS $l_FLAGS "-mavx"; then + CFG_AVX=yes + else + CFG_AVX=no + fi +fi + # check iWMMXt support if [ "$CFG_IWMMXT" = "yes" ]; then "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $l_FLAGS "-mcpu=iwmmxt" @@ -6558,6 +6649,11 @@ fi [ "$CFG_3DNOW" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG 3dnow" [ "$CFG_SSE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse" [ "$CFG_SSE2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse2" +[ "$CFG_SSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse3" +[ "$CFG_SSSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG ssse3" +[ "$CFG_SSE4_1" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_1" +[ "$CFG_SSE4_2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_2" +[ "$CFG_AVX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx" [ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt" [ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon" [ "$PLATFORM_MAC" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG $CFG_MAC_ARCHS" @@ -7959,7 +8055,9 @@ echo "Support for S60 ........ $CFG_S60" echo "Symbian DEF files ...... $CFG_SYMBIAN_DEFFILES" echo "STL support ............ $CFG_STL" echo "PCH support ............ $CFG_PRECOMPILE" -echo "MMX/3DNOW/SSE/SSE2...... ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}" +echo "MMX/3DNOW/SSE/SSE2/SSE3. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}/${CFG_SSE3}" +echo "SSSE3/SSE4.1/SSE4.2..... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}" +echo "AVX..................... ${CFG_AVX}" if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then echo "iWMMXt support ......... ${CFG_IWMMXT}" echo "NEON support ........... ${CFG_NEON}" diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index dba2a42..bbf445f 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -66,6 +66,21 @@ sse { sse2 { DEFINES += QT_HAVE_SSE2 } +sse3 { + DEFINES += QT_HAVE_SSE3 +} +ssse3 { + DEFINES += QT_HAVE_SSSE3 +} +sse4_1 { + DEFINES += QT_HAVE_SSE4_1 +} +sse4_2 { + DEFINES += QT_HAVE_SSE4_2 +} +avx { + DEFINES += QT_HAVE_AVX +} iwmmxt { DEFINES += QT_HAVE_IWMMXT } diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 41f1904..3aee078 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -84,6 +84,11 @@ contains(QMAKE_MAC_XARCH, no) { 3dnow:DEFINES += QT_HAVE_3DNOW sse:DEFINES += QT_HAVE_SSE QT_HAVE_MMXEXT sse2:DEFINES += QT_HAVE_SSE2 + sse3:DEFINES += QT_HAVE_SSE3 + ssse3:DEFINES += QT_HAVE_SSSE3 + sse4_1:DEFINES += QT_HAVE_SSE4_1 + sse4_2:DEFINES += QT_HAVE_SSE4_2 + avx:DEFINES += QT_HAVE_AVX iwmmxt:DEFINES += QT_HAVE_IWMMXT win32-g++*|!win32:!*-icc* { -- cgit v0.12 From 5a8a64821da7dae1ff5351b898899a5974c6d569 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Tue, 20 Jul 2010 14:48:38 +0200 Subject: Remove the masking when computing qAlpha() After a bit shift of 24, only the alpha value should remain, so it is not necessary to mask the result. The documentation state QRgb works on a ARGB quadruplet, so the upper bits can be assumed to be zero in the cases when QRgb is 64 bits. This saves some time because qAlpha() is used for each pixel in the generic blend functions. Reviewed-by: Andreas Kling Reviewed-by: Kim --- src/gui/painting/qrgb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qrgb.h b/src/gui/painting/qrgb.h index 8e635a8..ea5f353 100644 --- a/src/gui/painting/qrgb.h +++ b/src/gui/painting/qrgb.h @@ -64,7 +64,7 @@ Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb) // get blue part of RGB { return (rgb & 0xff); } Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb) // get alpha part of RGBA -{ return ((rgb >> 24) & 0xff); } +{ return rgb >> 24; } Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)// set RGB value { return (0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); } -- cgit v0.12 From ca7b451c42fc7bc9957dc1fe48f5aaf2fd937eaa Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Tue, 20 Jul 2010 19:41:33 +0200 Subject: Add a missing file in the config.test for SSE 4.2 The pro file was accidently missing of 42267701edd266463c90cec82d45022446a2606a --- config.tests/unix/sse4_2/sse4_2.pro | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 config.tests/unix/sse4_2/sse4_2.pro diff --git a/config.tests/unix/sse4_2/sse4_2.pro b/config.tests/unix/sse4_2/sse4_2.pro new file mode 100644 index 0000000..cab1711 --- /dev/null +++ b/config.tests/unix/sse4_2/sse4_2.pro @@ -0,0 +1,3 @@ +SOURCES = sse4_2.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle -- cgit v0.12 From f8f255553f3640355d3e196e100778256741701c Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Fri, 16 Jul 2010 11:15:06 +1000 Subject: Fixes the Oracle nchar bug when NLS_CHARSET is different with NLS_NCHAR_CHARSET. If Oracle national char types use different charset(NLS_NCHAR_CHARSET) with the database charset (NLS_CHARSET), the oci client need to set OCI_ATTR_CHARSET_FORM to SQLCS_NCHAR instead of SQLCS_IMPLICIT. Task-number: QTBUG-10919 Reviewed-by: Michael Goddard --- src/sql/drivers/oci/qsql_oci.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp index c56b995..e11cf75 100644 --- a/src/sql/drivers/oci/qsql_oci.cpp +++ b/src/sql/drivers/oci/qsql_oci.cpp @@ -93,8 +93,17 @@ enum { QOCIEncoding = 2002 }; // AL16UTF16LE enum { QOCIEncoding = 2000 }; // AL16UTF16 #endif -static const ub1 CSID_NCHAR = SQLCS_NCHAR; +// Always set the OCI_ATTR_CHARSET_FORM to SQLCS_NCHAR is safe +// because Oracle server will deal with the implicit Conversion +// Between CHAR and NCHAR. +// see: http://download.oracle.com/docs/cd/A91202_01/901_doc/appdev.901/a89857/oci05bnd.htm#422705 +static const ub1 qOraCharsetForm = SQLCS_NCHAR; + +#if defined (OCI_UTF16ID) +static const ub2 qOraCharset = OCI_UTF16ID; +#else static const ub2 qOraCharset = OCI_UCS2ID; +#endif typedef QVarLengthArray IndicatorArray; typedef QVarLengthArray SizeArray; @@ -209,12 +218,24 @@ void QOCIResultPrivate::setCharset(OCIBind* hbnd) OCI_HTYPE_BIND, // this const cast is safe since OCI doesn't touch // the charset. + const_cast(static_cast(&qOraCharsetForm)), + 0, + OCI_ATTR_CHARSET_FORM, + err); + if (r != 0) + qOraWarning("QOCIResultPrivate::setCharset: Couldn't set OCI_ATTR_CHARSET_FORM: ", err); + + r = OCIAttrSet(hbnd, + OCI_HTYPE_BIND, + // this const cast is safe since OCI doesn't touch + // the charset. const_cast(static_cast(&qOraCharset)), 0, OCI_ATTR_CHARSET_ID, err); if (r != 0) qOraWarning("QOCIResultPrivate::setCharset: Couldn't set OCI_ATTR_CHARSET_ID: ", err); + } int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, int pos, @@ -939,6 +960,17 @@ void QOCICols::setCharset(OCIDefine* dfn) OCI_HTYPE_DEFINE, // this const cast is safe since OCI doesn't touch // the charset. + const_cast(static_cast(&qOraCharsetForm)), + 0, + OCI_ATTR_CHARSET_FORM, + d->err); + if (r != 0) + qOraWarning("QOCIResultPrivate::setCharset: Couldn't set OCI_ATTR_CHARSET_FORM: ", d->err); + + r = OCIAttrSet(dfn, + OCI_HTYPE_DEFINE, + // this const cast is safe since OCI doesn't touch + // the charset. const_cast(static_cast(&qOraCharset)), 0, OCI_ATTR_CHARSET_ID, -- cgit v0.12 From 947b30973c53c3dc336aafc5352c13a2a660e32e Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Wed, 21 Jul 2010 10:54:22 +1000 Subject: Updates changes-4.7.0 --- dist/changes-4.7.0 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index 49c17ee..e195488 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -249,7 +249,13 @@ Qt Plugins **************************************************************************** * Database Drivers * **************************************************************************** - + - Sqlite + * [QTBUG-11904] Pointer aliasing problem in sqlite + - OCI + * [QTBUG-10919] Unable to insert unicode chars with codepoint > 255 + in nvarchar2 column on oracle + * [QTBUG-8210] Oracle - DATE in db with a year greater or equal to 2800 + returns an invalid date **************************************************************************** * Platform Specific Changes * -- cgit v0.12 From 17ae405bd4ff4a96c2e431d76e6bfabf5c1058e6 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Wed, 21 Jul 2010 10:02:37 +0200 Subject: Fix compilation with QT_NO_GRAPHICSVIEW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 751 Reviewed-by: Bjørn Erik Nilsen --- src/gui/kernel/qstandardgestures.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp index e05f8cc..127e150 100644 --- a/src/gui/kernel/qstandardgestures.cpp +++ b/src/gui/kernel/qstandardgestures.cpp @@ -515,11 +515,14 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object, const QTouchEvent *ev = static_cast(event); const QMouseEvent *me = static_cast(event); +#ifndef QT_NO_GRAPHICSVIEW const QGraphicsSceneMouseEvent *gsme = static_cast(event); +#endif enum { TapRadius = 40 }; switch (event->type()) { +#ifndef QT_NO_GRAPHICSVIEW case QEvent::GraphicsSceneMousePress: d->position = gsme->screenPos(); q->setHotSpot(d->position); @@ -527,6 +530,7 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object, q->killTimer(d->timerId); d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout); return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout +#endif case QEvent::MouseButtonPress: d->position = me->globalPos(); q->setHotSpot(d->position); @@ -541,7 +545,9 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object, q->killTimer(d->timerId); d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout); return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout +#ifndef QT_NO_GRAPHICSVIEW case QEvent::GraphicsSceneMouseRelease: +#endif case QEvent::MouseButtonRelease: case QEvent::TouchEnd: return QGestureRecognizer::CancelGesture; // get out of the MayBeGesture state @@ -559,12 +565,14 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object, return QGestureRecognizer::MayBeGesture; return QGestureRecognizer::CancelGesture; } +#ifndef QT_NO_GRAPHICSVIEW case QEvent::GraphicsSceneMouseMove: { QPoint delta = gsme->screenPos() - d->position.toPoint(); if (d->timerId && delta.manhattanLength() <= TapRadius) return QGestureRecognizer::MayBeGesture; return QGestureRecognizer::CancelGesture; } +#endif default: return QGestureRecognizer::Ignore; } -- cgit v0.12 From 2e63bd12bfe0a34f8708f99a0a97fc55d53cc229 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 21 Jul 2010 10:03:21 +0200 Subject: Some more change to the changelog --- dist/changes-4.7.0 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index e195488..09ae57b 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -65,6 +65,8 @@ QtCore - QMetaType * Significantly improved performance of the type() function * [QTBUG-8235] Support QEasingCurve as a built in metatype. + * Added possibility to register several name for the same type with + qRegisterMetaType<>() (ie. for typedef) - QState * [QTBUG-7741] Added a function to get the out-going transitions - QXmlStreamReader @@ -74,6 +76,8 @@ QtCore - QAbstractAnimation * [QTBUG-10654] Avoids animation with loopCount == 0 to change state to running and stopped. + - QVarLenghtArray + * Added some API to be more consistant with other containers QtGui ----- @@ -187,6 +191,9 @@ QtOpenGL - [QTBUG-9706] Improved appearance of text antialiasing. + - QTreeView + * Optimized + QtNetwork --------- - QHostInfo: Added a small 60 second DNS cache @@ -368,7 +375,7 @@ Qt for Windows CE - moc - + * Fixed several parsing bugs. Including changes in the normalized signature. - uic -- cgit v0.12 From 22e0ebd883256379d950ee94de9ba9c92ecf0113 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 21 Jul 2010 10:15:25 +0200 Subject: tst_moc: workaround gcc bug. The gcc bug was already work arounded, but moc did not understand the defines and generated the slot anyway why it would not exist with gcc < 4.4 --- tests/auto/moc/tst_moc.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp index d871540..d3a7e03 100644 --- a/tests/auto/moc/tst_moc.cpp +++ b/tests/auto/moc/tst_moc.cpp @@ -1344,18 +1344,21 @@ signals: class QTBUG12260_defaultTemplate_Object : public QObject { Q_OBJECT public slots: -#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) //gcc bug, this does not compile - void doSomething(QHash values = QHash()) { Q_UNUSED(values); } +#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) || defined(Q_MOC_RUN) + void doSomething(QHash values = QHash() ) { Q_UNUSED(values); } +#else + // we want to test the previous function, but gcc < 4.4 seemed to have a bug similar to the one moc has. + typedef QHash WorkaroundGCCBug; + void doSomething(QHash values = WorkaroundGCCBug() ) { Q_UNUSED(values); } #endif + void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); } }; void tst_Moc::QTBUG12260_defaultTemplate() { -#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash)") != -1); -#endif QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1); } -- cgit v0.12 From d00d1bd5423d0bbfea7c85a0411d2b22d97fbe0f Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 21 Jul 2010 17:14:28 +0200 Subject: Use aligned load for the blending of RGB32 over RGB32 Aligned load are faster than unaligned load. This patch add a prologue to the blending function in order to align the destination on 16 bytes before using SSE2. Reviewed-by: Kent Hansen --- src/gui/painting/qdrawhelper_sse2.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp index 346e177..279f685 100644 --- a/src/gui/painting/qdrawhelper_sse2.cpp +++ b/src/gui/painting/qdrawhelper_sse2.cpp @@ -110,13 +110,23 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl, const __m128i oneMinusConstAlpha = _mm_set1_epi16(one_minus_const_alpha); for (int y = 0; y < h; ++y) { int x = 0; + + // First, align dest to 16 bytes: + const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast(dst) >> 2) & 0x3)) & 0x3; + const int prologLength = qMin(w, offsetToAlignOn16Bytes); + for (; x < prologLength; ++x) { + quint32 s = src[x]; + s = BYTE_MUL(s, const_alpha); + dst[x] = INTERPOLATE_PIXEL_255(src[x], const_alpha, dst[x], one_minus_const_alpha); + } + for (; x < w-3; x += 4) { __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) { - const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); + const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); __m128i result; INTERPOLATE_PIXEL_255_SSE2(result, srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half); - _mm_storeu_si128((__m128i *)&dst[x], result); + _mm_store_si128((__m128i *)&dst[x], result); } } for (; x