summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qnamespace.qdoc6
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp11
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp32
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp24
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm8
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp16
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60_p.h1
-rw-r--r--src/gui/kernel/qwidget.cpp2
-rw-r--r--src/gui/painting/qdrawhelper.cpp49
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp218
-rw-r--r--src/gui/painting/qdrawhelper_x86_p.h8
-rw-r--r--src/gui/styles/qs60style.cpp4
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp2
-rw-r--r--src/s60installs/qt.iby3
-rw-r--r--src/testlib/qtestcase.cpp14
16 files changed, 346 insertions, 54 deletions
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 6627c76..392ece3 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -157,7 +157,7 @@
\value AA_MacDontSwapCtrlAndMeta On Mac OS X by default, Qt swaps the
Control and Meta (Command) keys (i.e., whenever Control is pressed, Qt
- sends Meta and whenever Meta is pressed Control is sent. When this
+ sends Meta, and whenever Meta is pressed Control is sent). When this
attribute is true, Qt will not do the flip. QKeySequence::StandardShortcuts
will also flip accordingly (i.e., QKeySequence::Copy will be
Command+C on the keyboard regardless of the value set, though what is output for
@@ -493,7 +493,7 @@
\omitvalue WordBreak
\omitvalue TextForceLeftToRight
\omitvalue TextForceRightToLeft
- \omitvalue TextLongestVariant Always use the longest variant when computing the size of a multi-variant string
+ \omitvalue TextLongestVariant Always use the longest variant when computing the size of a multi-variant string.
You can use as many modifier flags as you want, except that
Qt::TextSingleLine and Qt::TextWordWrap cannot be combined.
@@ -2115,7 +2115,7 @@
On some platforms this implies Qt::WindowSystemMenuHint for it to work.
\value MacWindowToolBarButtonHint On Mac OS X adds a tool bar button (i.e.,
- the oblong button that is on the top right of windows that have toolbars.
+ the oblong button that is on the top right of windows that have toolbars).
\value BypassGraphicsProxyWidget Prevents the window and its children from
automatically embedding themselves into a QGraphicsProxyWidget if the
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index bec0075..139075f 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -1484,7 +1484,7 @@ QAbstractFileEngine::FileFlags QFSFileEnginePrivate::getPermissions() const
{
//### what to do with permissions if we don't use NTFS
// for now just add all permissions and what about exe missions ??
- // also qt_ntfs_permission_lookup is now not set by defualt ... should it ?
+ // also qt_ntfs_permission_lookup is now not set by default ... should it ?
ret |= QAbstractFileEngine::ReadOtherPerm | QAbstractFileEngine::ReadGroupPerm
| QAbstractFileEngine::ReadOwnerPerm | QAbstractFileEngine::ReadUserPerm
| QAbstractFileEngine::WriteUserPerm | QAbstractFileEngine::WriteOwnerPerm
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index cbc87f3..93becc8 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -68,6 +68,14 @@ extern uint qGlobalPostedEventsCount();
# define QS_RAWINPUT 0x0400
#endif
+#ifndef WM_TOUCH
+# define WM_TOUCH 0x0240
+#endif
+#ifndef WM_GESTURE
+# define WM_GESTURE 0x0119
+# define WM_GESTURENOTIFY 0x011A
+#endif
+
enum {
WM_QT_SOCKETNOTIFIER = WM_USER,
WM_QT_SENDPOSTEDEVENTS = WM_USER + 1,
@@ -714,6 +722,9 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
&& msg.message <= WM_MOUSELAST)
|| msg.message == WM_MOUSEWHEEL
|| msg.message == WM_MOUSEHWHEEL
+ || msg.message == WM_TOUCH
+ || msg.message == WM_GESTURE
+ || msg.message == WM_GESTURENOTIFY
|| msg.message == WM_CLOSE)) {
// queue user input events for later processing
haveMessage = false;
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 39c41c4..2f208b7 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -319,7 +319,7 @@
QGraphicsItem::keyPressEvent() and QGraphicsItem::keyReleaseEvent().
\value ItemClipsToShape The item clips to its own shape. The item cannot
- draw or receive mouse, tablet, drag and drop or hover events outside ts
+ draw or receive mouse, tablet, drag and drop or hover events outside its
shape. It is disabled by default. This behavior is enforced by
QGraphicsView::drawItems() or QGraphicsScene::drawItems(). This flag was
introduced in Qt 4.3.
@@ -357,19 +357,22 @@
default, child items are stacked on top of the parent item. But setting
this flag, the child will be stacked behind it. This flag is useful for
drop shadow effects and for decoration objects that follow the parent
- item's geometry without drawing on top of it.
+ item's geometry without drawing on top of it. This flag was introduced
+ in Qt 4.5.
\value ItemUsesExtendedStyleOption The item makes use of either
- \l{QStyleOptionGraphicsItem::}{exposedRect} or
- \l{QStyleOptionGraphicsItem::}{matrix} in QStyleOptionGraphicsItem. By default,
- the \l{QStyleOptionGraphicsItem::}{exposedRect} is initialized to the item's
- boundingRect() and the \l{QStyleOptionGraphicsItem::}{matrix} is untransformed.
- You can enable this flag for the style options to be set up with more
- fine-grained values.
- Note that QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag
+ \l{QStyleOptionGraphicsItem::} {exposedRect} or
+ \l{QStyleOptionGraphicsItem::} {matrix} in
+ QStyleOptionGraphicsItem. By default, the
+ \l{QStyleOptionGraphicsItem::} {exposedRect} is initialized to the
+ item's boundingRect() and the
+ \l{QStyleOptionGraphicsItem::}{matrix} is untransformed. You can
+ enable this flag for the style options to be set up with more
+ fine-grained values. Note that
+ QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag
and always initialized to 1. Use
- QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need a higher
- value.
+ QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need
+ a higher value. This flag was introduced in Qt 4.6.
\value ItemHasNoContents The item does not paint anything (i.e., calling
paint() on the item has no effect). You should set this flag on items that
@@ -387,9 +390,10 @@
used for Asian languages.
This flag was introduced in Qt 4.6.
- \value ItemNegativeZStacksBehindParent The item automatically stacks behind
- it's parent if it's z-value is negative. This flag enables setZValue() to
- toggle ItemStacksBehindParent.
+ \value ItemNegativeZStacksBehindParent The item automatically
+ stacks behind it's parent if it's z-value is negative. This flag
+ enables setZValue() to toggle ItemStacksBehindParent. This flag
+ was introduced in Qt 4.6.
\value ItemIsPanel The item is a panel. A panel provides activation and
contained focus handling. Only one panel can be active at a time (see
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 66707fc..86aaa78 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5132,6 +5132,8 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
}
/*!
+ \obsolete
+
Paints the given \a items using the provided \a painter, after the
background has been drawn, and before the foreground has been
drawn. All painting is done in \e scene coordinates. Before
@@ -5154,7 +5156,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
\snippet doc/src/snippets/graphicssceneadditemsnippet.cpp 0
- \obsolete Since Qt 4.6, this function is not called anymore unless
+ Since Qt 4.6, this function is not called anymore unless
the QGraphicsView::IndirectPainting flag is given as an Optimization
flag.
@@ -5902,13 +5904,21 @@ void QGraphicsScenePrivate::getGestureTargets(const QSet<QGesture *> &gestures,
QList<QGraphicsItem *> items = itemsAtPosition(screenPos, QPointF(), viewport);
QList<QGraphicsObject *> result;
for (int j = 0; j < items.size(); ++j) {
- QGraphicsObject *item = items.at(j)->toGraphicsObject();
- if (!item)
- continue;
- QGraphicsItemPrivate *d = item->QGraphicsItem::d_func();
- if (d->gestureContext.contains(gestureType)) {
- result.append(item);
+ QGraphicsItem *item = items.at(j);
+
+ // Check if the item is blocked by a modal panel and use it as
+ // a target instead of this item.
+ (void) item->isBlockedByModalPanel(&item);
+
+ if (QGraphicsObject *itemobj = item->toGraphicsObject()) {
+ QGraphicsItemPrivate *d = item->d_func();
+ if (d->gestureContext.contains(gestureType)) {
+ result.append(itemobj);
+ }
}
+ // Don't propagate through panels.
+ if (item->isPanel())
+ break;
}
DEBUG() << "QGraphicsScenePrivate::getGestureTargets:"
<< gesture << result;
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index c7c7caf..df09185 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -492,6 +492,14 @@ static bool IsMouseOrKeyEvent( NSEvent* event )
case NSOtherMouseDown:
case NSOtherMouseUp:
case NSOtherMouseDragged:
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+ case NSEventTypeGesture: // touch events
+ case NSEventTypeMagnify:
+ case NSEventTypeSwipe:
+ case NSEventTypeRotate:
+ case NSEventTypeBeginGesture:
+ case NSEventTypeEndGesture:
+#endif
result = true;
break;
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index af84a8f..8ac1e31 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -66,17 +66,18 @@ QSoftKeyManagerPrivateS60::QSoftKeyManagerPrivateS60()
cachedCbaIconSize[1] = QSize(0,0);
cachedCbaIconSize[2] = QSize(0,0);
cachedCbaIconSize[3] = QSize(0,0);
- skipNextUpdate = false;
}
bool QSoftKeyManagerPrivateS60::skipCbaUpdate()
{
- // lets not update softkeys if
+ // Lets not update softkeys if
// 1. We don't have application panes, i.e. cba
- // 2. S60 native dialog or menu is shown
- if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes) ||
- CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || skipNextUpdate) {
- skipNextUpdate = false;
+ // 2. Our CBA is not active, i.e. S60 native dialog or menu with custom CBA is shown
+ // Note: Cannot use IsDisplayingMenuOrDialog since CBA update can be triggered before
+ // menu/dialog CBA is actually displayed i.e. it is being costructed.
+ CEikButtonGroupContainer *appUiCba = S60->buttonGroupContainer();
+ CEikButtonGroupContainer *currentCba = CEikButtonGroupContainer::Current();
+ if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes) || appUiCba != currentCba) {
return true;
}
return false;
@@ -384,9 +385,6 @@ bool QSoftKeyManagerPrivateS60::handleCommand(int command)
}
qt_symbian_next_menu_from_action(actionContainer);
QT_TRAP_THROWING(S60->menuBar()->TryDisplayMenuBarL());
- // TODO: hack remove, it can happen that IsDisplayingMenuOrDialog return false
- // in updateSoftKeys_sys, and we will override menu CBA with our own
- skipNextUpdate = true;
} else {
Q_ASSERT(action->softKeyRole() != QAction::NoSoftKey);
QWidget *actionParent = action->parentWidget();
diff --git a/src/gui/kernel/qsoftkeymanager_s60_p.h b/src/gui/kernel/qsoftkeymanager_s60_p.h
index f8bd6d9..823a2db 100644
--- a/src/gui/kernel/qsoftkeymanager_s60_p.h
+++ b/src/gui/kernel/qsoftkeymanager_s60_p.h
@@ -98,7 +98,6 @@ private:
private:
QHash<int, QAction*> realSoftKeyActions;
QSize cachedCbaIconSize[4];
- bool skipNextUpdate;
};
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 2a19d23..850e961 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -8271,7 +8271,7 @@ bool QWidget::event(QEvent *event)
}
#ifdef QT_SOFTKEYS_ENABLED
- if (isWindow() && isActiveWindow())
+ if (isWindow())
QSoftKeyManager::updateSoftKeys();
#endif
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 7a3da20..070491d 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -8092,20 +8092,43 @@ void qInitDrawhelperAsm()
qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_sse3dnow;
}
#endif // 3DNOW
- extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
- extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
- }
+
+#ifdef QT_HAVE_SSE2
+ if (features & SSE2) {
+ extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+ extern void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
+ } else
+#endif
+ {
+ extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+ extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
+ }
+}
#endif // SSE
#ifdef QT_HAVE_IWMMXT
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index dd6fa1b..1dba914 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -57,6 +57,224 @@
QT_BEGIN_NAMESPACE
+/*
+ * Multiply the components of pixelVector by alphaChannel
+ * Each 32bits components of alphaChannel must be in the form 0x00AA00AA
+ * colorMask must have 0x00ff00ff on each 32 bits component
+ * half must have the value 128 (0x80) for each 32 bits compnent
+ */
+Q_STATIC_INLINE_FUNCTION __m128i BYTE_MUL_SSE2(const __m128i pixelVector, const __m128i alphaChannel, const __m128i colorMask, const __m128i half)
+{
+ // 1. separate the colors in 2 vectors so each color is on 16 bits
+ // (in order to be multiplied by the alpha
+ // each 32 bit of dstVectorAG are in the form 0x00AA00GG
+ // each 32 bit of dstVectorRB are in the form 0x00RR00BB
+ __m128i pixelVectorAG = _mm_srli_epi16(pixelVector, 8);
+ __m128i pixelVectorRB = _mm_and_si128(pixelVector, colorMask);
+
+ // 2. multiply the vectors by the alpha channel
+ pixelVectorAG = _mm_mullo_epi16(pixelVectorAG, alphaChannel);
+ pixelVectorRB = _mm_mullo_epi16(pixelVectorRB, alphaChannel);
+
+ // 3. devide by 255, that's the tricky part.
+ // we do it like for BYTE_MUL(), with bit shift: X/255 ~= (X + X/256 + rounding)/256
+ /// so first (X + X/256 + rounding)
+ pixelVectorRB = _mm_add_epi16(pixelVectorRB, _mm_srli_epi16(pixelVectorRB, 8));
+ pixelVectorRB = _mm_add_epi16(pixelVectorRB, half);
+ pixelVectorAG = _mm_add_epi16(pixelVectorAG, _mm_srli_epi16(pixelVectorAG, 8));
+ pixelVectorAG = _mm_add_epi16(pixelVectorAG, half);
+
+ /// second devide by 256
+ pixelVectorRB = _mm_srli_epi16(pixelVectorRB, 8);
+ /// for AG, we could >> 8 to divide followed by << 8 to put the
+ /// bytes in the correct position. By masking instead, we execute
+ /// only one instruction
+ pixelVectorAG = _mm_andnot_si128(colorMask, pixelVectorAG);
+
+ // 4. combine the 2 pairs of colors
+ return _mm_or_si128(pixelVectorAG, pixelVectorRB);
+}
+
+/*
+ * Each 32bits components of alphaChannel must be in the form 0x00AA00AA
+ * oneMinusAlphaChannel must be 255 - alpha for each 32 bits component
+ * colorMask must have 0x00ff00ff on each 32 bits component
+ * half must have the value 128 (0x80) for each 32 bits compnent
+ */
+Q_STATIC_INLINE_FUNCTION __m128i INTERPOLATE_PIXEL_255_SSE2(const __m128i srcVector,
+ const __m128i dstVector,
+ const __m128i alphaChannel,
+ const __m128i oneMinusAlphaChannel ,
+ const __m128i colorMask,
+ const __m128i half) {
+ // interpolate AG
+ __m128i srcVectorAG = _mm_srli_epi16(srcVector, 8);
+ __m128i dstVectorAG = _mm_srli_epi16(dstVector, 8);
+ __m128i srcVectorAGalpha = _mm_mullo_epi16(srcVectorAG, alphaChannel);
+ __m128i dstVectorAGoneMinusAlphalpha = _mm_mullo_epi16(dstVectorAG, oneMinusAlphaChannel);
+ __m128i finalAG = _mm_add_epi16(srcVectorAGalpha, dstVectorAGoneMinusAlphalpha);
+ finalAG = _mm_add_epi16(finalAG, _mm_srli_epi16(finalAG, 8));
+ finalAG = _mm_add_epi16(finalAG, half);
+ finalAG = _mm_andnot_si128(colorMask, finalAG);
+
+ // interpolate RB
+ __m128i srcVectorRB = _mm_and_si128(srcVector, colorMask);
+ __m128i dstVectorRB = _mm_and_si128(dstVector, colorMask);
+ __m128i srcVectorRBalpha = _mm_mullo_epi16(srcVectorRB, alphaChannel);
+ __m128i dstVectorRBoneMinusAlphalpha = _mm_mullo_epi16(dstVectorRB, oneMinusAlphaChannel);
+ __m128i finalRB = _mm_add_epi16(srcVectorRBalpha, dstVectorRBoneMinusAlphalpha);
+ finalRB = _mm_add_epi16(finalRB, _mm_srli_epi16(finalRB, 8));
+ finalRB = _mm_add_epi16(finalRB, half);
+ finalRB = _mm_srli_epi16(finalRB, 8);
+
+ // combine
+ return _mm_or_si128(finalAG, finalRB);
+}
+
+void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ const quint32 *src = (const quint32 *) srcPixels;
+ quint32 *dst = (uint *) destPixels;
+ if (const_alpha == 256) {
+ const __m128i alphaMask = _mm_set1_epi32(0xff000000);
+ const __m128i nullVector = _mm_set1_epi32(0);
+ const __m128i half = _mm_set1_epi16(0x80);
+ const __m128i one = _mm_set1_epi16(0xff);
+ const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+ for (int y = 0; y < h; ++y) {
+ int x = 0;
+ for (; x < w-3; x += 4) {
+ const __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]);
+ const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask);
+ if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) {
+ // all opaque
+ _mm_storeu_si128((__m128i *)&dst[x], srcVector);
+ } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) {
+ // not fully transparent
+ // result = s + d * (1-alpha)
+
+ // extract the alpha channel on 2 x 16 bits
+ // so we have room for the multiplication
+ // each 32 bits will be in the form 0x00AA00AA
+ // with A being the 1 - alpha
+ __m128i alphaChannel = _mm_srli_epi32(srcVector, 24);
+ alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16));
+ alphaChannel = _mm_sub_epi16(one, alphaChannel);
+
+ const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]);
+ const __m128i destMultipliedByOneMinusAlpha = BYTE_MUL_SSE2(dstVector, alphaChannel, colorMask, half);
+
+ // result = s + d * (1-alpha)
+ const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha);
+ _mm_storeu_si128((__m128i *)&dst[x], result);
+ }
+ }
+ for (; x<w; ++x) {
+ uint s = src[x];
+ if (s >= 0xff000000)
+ dst[x] = s;
+ else if (s != 0)
+ dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ } else if (const_alpha != 0) {
+ // dest = (s + d * sia) * ca + d * cia
+ // = s * ca + d * (sia * ca + cia)
+ // = s * ca + d * (1 - sa*ca)
+ const_alpha = (const_alpha * 255) >> 8;
+ const __m128i nullVector = _mm_set1_epi32(0);
+ const __m128i half = _mm_set1_epi16(0x80);
+ const __m128i one = _mm_set1_epi16(0xff);
+ const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+ const __m128i constAlphaVector = _mm_set1_epi16(const_alpha);
+ for (int y = 0; y < h; ++y) {
+ int x = 0;
+ for (; x < w-3; x += 4) {
+ __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]);
+ if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) {
+ srcVector = BYTE_MUL_SSE2(srcVector, constAlphaVector, colorMask, half);
+
+ __m128i alphaChannel = _mm_srli_epi32(srcVector, 24);
+ alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16));
+ alphaChannel = _mm_sub_epi16(one, alphaChannel);
+
+ const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]);
+ const __m128i destMultipliedByOneMinusAlpha = BYTE_MUL_SSE2(dstVector, alphaChannel, colorMask, half);
+
+ const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha);
+ _mm_storeu_si128((__m128i *)&dst[x], result);
+ }
+ }
+ for (; x<w; ++x) {
+ quint32 s = src[x];
+ if (s != 0) {
+ s = BYTE_MUL(s, const_alpha);
+ dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
+ }
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+// qblendfunctions.cpp
+void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ const quint32 *src = (const quint32 *) srcPixels;
+ quint32 *dst = (uint *) destPixels;
+ if (const_alpha != 256) {
+ if (const_alpha != 0) {
+ const __m128i nullVector = _mm_set1_epi32(0);
+ const __m128i half = _mm_set1_epi16(0x80);
+ const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+
+ const_alpha = (const_alpha * 255) >> 8;
+ int one_minus_const_alpha = 255 - const_alpha;
+ const __m128i constAlphaVector = _mm_set1_epi16(const_alpha);
+ const __m128i oneMinusConstAlpha = _mm_set1_epi16(one_minus_const_alpha);
+ for (int y = 0; y < h; ++y) {
+ int x = 0;
+ 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 result = INTERPOLATE_PIXEL_255_SSE2(srcVector,
+ dstVector,
+ constAlphaVector,
+ oneMinusConstAlpha,
+ colorMask,
+ half);
+ _mm_storeu_si128((__m128i *)&dst[x], result);
+ }
+ }
+ for (; x<w; ++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);
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+ } else {
+ qt_blend_rgb32_on_rgb32(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
+ }
+}
+
void qt_memfill32_sse2(quint32 *dest, quint32 value, int count)
{
if (count < 7) {
diff --git a/src/gui/painting/qdrawhelper_x86_p.h b/src/gui/painting/qdrawhelper_x86_p.h
index 30aadd0..d7282a7 100644
--- a/src/gui/painting/qdrawhelper_x86_p.h
+++ b/src/gui/painting/qdrawhelper_x86_p.h
@@ -114,6 +114,14 @@ void qt_bitmapblit32_sse2(QRasterBuffer *rasterBuffer, int x, int y,
void qt_bitmapblit16_sse2(QRasterBuffer *rasterBuffer, int x, int y,
quint32 color,
const uchar *src, int width, int height, int stride);
+void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
#endif // QT_HAVE_SSE2
#ifdef QT_HAVE_IWMMXT
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 9025e5b..14e9b95 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2559,11 +2559,11 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
const int frameThickness = spinbox->frame ? pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0;
const int buttonMargin = spinbox->frame ? 2 : 0;
- const int buttonWidth = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin;
+ const int buttonContentWidth = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin;
QSize buttonSize;
buttonSize.setHeight(qMax(8, spinbox->rect.height() - frameThickness));
//width should at least be equal to height
- buttonSize.setWidth(qMax(buttonSize.height(), buttonWidth));
+ buttonSize.setWidth(qMax(buttonSize.height(), buttonContentWidth));
buttonSize = buttonSize.expandedTo(QApplication::globalStrut());
const int y = frameThickness + spinbox->rect.y();
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index e16aedc..0b32533 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -549,7 +549,7 @@ void QNetworkAccessManager::setCookieJar(QNetworkCookieJar *cookieJar)
/*!
Posts a request to obtain the network headers for \a request
- and returns a new QNetworkReply object which will contain such headers
+ and returns a new QNetworkReply object which will contain such headers.
The function is named after the HTTP request associated (HEAD).
*/
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index bdd668c..a6a96ec 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -113,6 +113,7 @@ data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resou
data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
// Stub sis file
-data=ZSYSTEM\install\qt.sis System\Install\qt.sis
+data=ZSYSTEM\install\qt_stub.sis System\Install\qt_stub.sis
+data=ZSYSTEM\install\qtwebkit_stub.sis System\Install\qtwebkit_stub.sis
#endif // __QT_IBY__
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index ecdcca8..1c2db2f 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1298,11 +1298,23 @@ static bool qInvokeTestMethod(const char *slotName, const char *data=0)
const int dataCount = table.dataCount();
QTestResult::setSkipCurrentTest(false);
+ // Data tag requested but none available?
+ if (data && !dataCount) {
+ // Let empty data tag through.
+ if (!*data)
+ data = 0;
+ else {
+ printf("Unknown testdata for function %s: '%s'\n", slotName, data);
+ printf("Function has no testdata.\n");
+ return false;
+ }
+ }
+
/* For each entry in the data table, do: */
do {
if (!data || !qstrcmp(data, table.testData(curDataIndex)->dataTag())) {
foundFunction = true;
- QTestDataSetter s(table.isEmpty() ? static_cast<QTestData *>(0)
+ QTestDataSetter s(curDataIndex >= dataCount ? static_cast<QTestData *>(0)
: table.testData(curDataIndex));
qInvokeTestMethodDataEntry(slot);