summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qprintdialog.qdoc10
-rw-r--r--src/gui/embedded/qkbd_qws.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp25
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp16
-rw-r--r--src/gui/image/qpixmap_x11_p.h2
-rw-r--r--src/gui/image/qtiffhandler.cpp1
-rw-r--r--src/gui/itemviews/qitemselectionmodel.cpp13
-rw-r--r--src/gui/kernel/qclipboard_s60.cpp88
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm4
-rw-r--r--src/gui/kernel/qdesktopwidget.qdoc10
-rw-r--r--src/gui/kernel/qsizepolicy.qdoc10
-rw-r--r--src/gui/kernel/qwidget.cpp44
-rw-r--r--src/gui/kernel/qwidget_mac.mm50
-rw-r--r--src/gui/kernel/qwidget_qws.cpp24
-rw-r--r--src/gui/kernel/qwidget_s60.cpp2
-rw-r--r--src/gui/painting/painting.pri7
-rw-r--r--src/gui/painting/qblendfunctions_armv6_rvct.s222
-rw-r--r--src/gui/painting/qcolormap.qdoc10
-rw-r--r--src/gui/painting/qdrawhelper.cpp159
-rw-r--r--src/gui/painting/qdrawhelper_arm_simd.cpp313
-rw-r--r--src/gui/painting/qdrawhelper_arm_simd_p.h (renamed from src/gui/painting/qdrawhelper_armv6_p.h)19
-rw-r--r--src/gui/painting/qdrawhelper_armv6_rvct.inc496
-rw-r--r--src/gui/painting/qdrawhelper_armv6_rvct.s177
-rw-r--r--src/gui/painting/qpaintdevice.qdoc10
-rw-r--r--src/gui/painting/qprinterinfo.qdoc10
-rw-r--r--src/gui/styles/qmacstyle.qdoc10
-rw-r--r--src/gui/styles/qs60style.cpp7
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp21
-rw-r--r--src/gui/widgets/qcombobox.cpp2
-rw-r--r--src/gui/widgets/qlineedit.cpp5
-rw-r--r--src/gui/widgets/qmainwindow.cpp6
-rw-r--r--src/gui/widgets/qmainwindowlayout_p.h1
-rw-r--r--src/gui/widgets/qmenubar.cpp30
33 files changed, 668 insertions, 1138 deletions
diff --git a/src/gui/dialogs/qprintdialog.qdoc b/src/gui/dialogs/qprintdialog.qdoc
index bd406c183b..b75fe2e55f 100644
--- a/src/gui/dialogs/qprintdialog.qdoc
+++ b/src/gui/dialogs/qprintdialog.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
diff --git a/src/gui/embedded/qkbd_qws.cpp b/src/gui/embedded/qkbd_qws.cpp
index b28e293e81..a6c8002a1e 100644
--- a/src/gui/embedded/qkbd_qws.cpp
+++ b/src/gui/embedded/qkbd_qws.cpp
@@ -450,6 +450,8 @@ void QWSKeyboardHandler::endAutoRepeat()
/*!
\fn QWSKeyboardHandler::KeycodeAction QWSKeyboardHandler::processKeycode(quint16 keycode, bool isPress, bool autoRepeat)
+ \since 4.6
+
Maps \a keycode according to a keymap and sends that key event to the
\l{Qt for Embedded Linux} server application.
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 3ad8f33971..e9a2f9f09d 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -3322,8 +3322,7 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim
*/
void QGraphicsItem::clearFocus()
{
- if (hasFocus())
- d_ptr->clearFocusHelper(/* giveFocusToParent = */ true);
+ d_ptr->clearFocusHelper(/* giveFocusToParent = */ true);
}
/*!
@@ -3337,8 +3336,14 @@ void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent)
QGraphicsItem *p = parent;
while (p) {
if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
- p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false,
- /* focusFromHide = */ false);
+ if (p->d_ptr->focusScopeItem == q_ptr) {
+ p->d_ptr->focusScopeItem = 0;
+ if (!q_ptr->hasFocus()) //if it has focus, focusScopeItemChange is called elsewhere
+ focusScopeItemChange(false);
+ }
+ if (q_ptr->hasFocus())
+ p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false,
+ /* focusFromHide = */ false);
return;
}
p = p->d_ptr->parent;
@@ -3346,10 +3351,10 @@ void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent)
}
}
- // Invisible items with focus must explicitly clear subfocus.
- clearSubFocus(q_ptr);
-
if (q_ptr->hasFocus()) {
+ // Invisible items with focus must explicitly clear subfocus.
+ clearSubFocus(q_ptr);
+
// If this item has the scene's input focus, clear it.
scene->setFocusItem(0);
}
@@ -3706,6 +3711,8 @@ void QGraphicsItem::setPos(const QPointF &pos)
d_ptr->setPosHelper(pos);
if (d_ptr->isWidget)
static_cast<QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos();
+ if (d_ptr->scenePosDescendants)
+ d_ptr->sendScenePosChange();
return;
}
@@ -4388,8 +4395,10 @@ void QGraphicsItem::setTransform(const QTransform &matrix, bool combine)
return;
// Update and set the new transformation.
- if (!(d_ptr->flags & ItemSendsGeometryChanges)) {
+ if (!(d_ptr->flags & (ItemSendsGeometryChanges | ItemSendsScenePositionChanges))) {
d_ptr->setTransformHelper(newTransform);
+ if (d_ptr->scenePosDescendants)
+ d_ptr->sendScenePosChange();
return;
}
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 1bfe266f69..4a733beac7 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -750,6 +750,22 @@ QSizeF QGraphicsWidget::sizeHint(Qt::SizeHint which, const QSizeF &constraint) c
/*!
\property QGraphicsWidget::layout
\brief The layout of the widget
+
+ Any existing layout manager is deleted before the new layout is assigned. If
+ \a layout is 0, the widget is left without a layout. Existing subwidgets'
+ geometries will remain unaffected.
+
+ QGraphicsWidget takes ownership of \a layout.
+
+ All widgets that are currently managed by \a layout or all of its
+ sublayouts, are automatically reparented to this item. The layout is then
+ invalidated, and the child widget geometries are adjusted according to
+ this item's geometry() and contentsMargins(). Children who are not
+ explicitly managed by \a layout remain unaffected by the layout after
+ it has been assigned to this widget.
+
+ If no layout is currently managing this widget, layout() will return 0.
+
*/
/*!
diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h
index f171281f39..7eab64c8d6 100644
--- a/src/gui/image/qpixmap_x11_p.h
+++ b/src/gui/image/qpixmap_x11_p.h
@@ -115,7 +115,7 @@ private:
friend class QEglContext; // Needs gl_surface
friend class QGLContext; // Needs gl_surface
friend class QX11GLPixmapData; // Needs gl_surface
- friend class QMeeGoGraphicsSystem; // Needs gl_surface and flags
+ friend class QMeeGoLivePixmapData; // Needs gl_surface and flags
friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs gl_surface
void release();
diff --git a/src/gui/image/qtiffhandler.cpp b/src/gui/image/qtiffhandler.cpp
index 2e8b9988ee..dd2bd10842 100644
--- a/src/gui/image/qtiffhandler.cpp
+++ b/src/gui/image/qtiffhandler.cpp
@@ -611,6 +611,7 @@ QVariant QTiffHandler::option(ImageOption option) const
TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &height);
imageSize = QSize(width, height);
+ TIFFClose(tiff);
}
device()->seek(pos);
if (imageSize.isValid())
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp
index 7156b8713d..2c3153a88b 100644
--- a/src/gui/itemviews/qitemselectionmodel.cpp
+++ b/src/gui/itemviews/qitemselectionmodel.cpp
@@ -1068,6 +1068,19 @@ void QItemSelectionModel::select(const QItemSelection &selection, QItemSelection
// store old selection
QItemSelection sel = selection;
+ // If d->ranges is non-empty when the source model is reset the persistent indexes
+ // it contains will be invalid. We can't clear them in a modelReset slot because that might already
+ // be too late if another model observer is connected to the same modelReset slot and is invoked first
+ // it might call select() on this selection model before any such QItemSelectionModelPrivate::_q_modelReset() slot
+ // is invoked, so it would not be cleared yet. We clear it invalid ranges in it here.
+ QItemSelection::iterator it = d->ranges.begin();
+ while (it != d->ranges.end()) {
+ if (!it->isValid())
+ it = d->ranges.erase(it);
+ else
+ ++it;
+ }
+
QItemSelection old = d->ranges;
old.merge(d->currentSelection, d->currentCommand);
diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp
index f07e06652f..c9b1d23862 100644
--- a/src/gui/kernel/qclipboard_s60.cpp
+++ b/src/gui/kernel/qclipboard_s60.cpp
@@ -50,16 +50,18 @@
#include "qwidget.h"
#include "qevent.h"
#include "private/qcore_symbian_p.h"
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include "txtclipboard.h"
+#endif
+#include "txtetext.h"
#include <QtDebug>
// Symbian's clipboard
#include <baclipb.h>
QT_BEGIN_NAMESPACE
-//### Mime Type mapping to UIDs
-
const TUid KQtCbDataStream = {0x2001B2DD};
-
+const TInt KPlainTextBegin = 0;
class QClipboardData
{
@@ -141,7 +143,6 @@ void writeToStreamLX(const QMimeData* aData, RWriteStream& aStream)
{
HBufC* stringData = TPtrC(reinterpret_cast<const TUint16*>((*iter).utf16())).AllocLC();
QByteArray ba = aData->data((*iter));
- qDebug() << "copy to clipboard mime: " << *iter << " data: " << ba;
// mime type
aStream << TCardinality(stringData->Size());
aStream << *(stringData);
@@ -152,6 +153,43 @@ void writeToStreamLX(const QMimeData* aData, RWriteStream& aStream)
}
}
+void writeToSymbianStoreLX(const QMimeData* aData, CClipboard* clipboard)
+{
+ // This function both leaves and throws exceptions. There must be no destructor
+ // dependencies between cleanup styles, and no cleanup stack dependencies on stacked objects.
+ if (aData->hasText()) {
+ CPlainText* text = CPlainText::NewL();
+ CleanupStack::PushL(text);
+
+ TPtrC textPtr(qt_QString2TPtrC(aData->text()));
+ text->InsertL(KPlainTextBegin, textPtr);
+ text->CopyToStoreL(clipboard->Store(), clipboard->StreamDictionary(),
+ KPlainTextBegin, textPtr.Length());
+ CleanupStack::PopAndDestroy(text);
+ }
+}
+
+void readSymbianStoreLX(QMimeData* aData, CClipboard* clipboard)
+{
+ // This function both leaves and throws exceptions. There must be no destructor
+ // dependencies between cleanup styles, and no cleanup stack dependencies on stacked objects.
+ CPlainText* text = CPlainText::NewL();
+ CleanupStack::PushL(text);
+ TInt dataLength = text->PasteFromStoreL(clipboard->Store(), clipboard->StreamDictionary(),
+ KPlainTextBegin);
+ if (dataLength == 0) {
+ User::Leave(KErrNotFound);
+ }
+ HBufC* hBuf = HBufC::NewL(dataLength);
+ TPtr buf = hBuf->Des();
+ text->Extract(buf, KPlainTextBegin, dataLength);
+
+ QString string = qt_TDesC2QString(buf);
+ CleanupStack::PopAndDestroy(text);
+
+ aData->setText(string);
+}
+
void readFromStreamLX(QMimeData* aData,RReadStream& aStream)
{
// This function both leaves and throws exceptions. There must be no destructor
@@ -174,7 +212,6 @@ void readFromStreamLX(QMimeData* aData,RReadStream& aStream)
ba.reserve(dataSize);
aStream.ReadL(reinterpret_cast<uchar*>(ba.data_ptr()->data),dataSize);
ba.data_ptr()->size = dataSize;
- qDebug() << "paste from clipboard mime: " << mimeType << " data: " << ba;
aData->setData(mimeType,ba);
}
}
@@ -192,18 +229,41 @@ const QMimeData* QClipboard::mimeData(Mode mode) const
{
if (mode != Clipboard) return 0;
QClipboardData *d = clipboardData();
+ bool dataExists(false);
if (d)
{
TRAPD(err,{
RFs fs = qt_s60GetRFs();
CClipboard* cb = CClipboard::NewForReadingLC(fs);
Q_ASSERT(cb);
+ //stream for qt
RStoreReadStream stream;
TStreamId stid = (cb->StreamDictionary()).At(KQtCbDataStream);
- stream.OpenLC(cb->Store(),stid);
- QT_TRYCATCH_LEAVING(readFromStreamLX(d->source(),stream));
- CleanupStack::PopAndDestroy(2,cb);
- return d->source();
+ if (stid != 0) {
+ stream.OpenLC(cb->Store(),stid);
+ QT_TRYCATCH_LEAVING(readFromStreamLX(d->source(),stream));
+ CleanupStack::PopAndDestroy(&stream);
+ dataExists = true;
+ }
+ else {
+ //symbian clipboard
+ RStoreReadStream symbianStream;
+ TStreamId symbianStId = (cb->StreamDictionary()).At(KClipboardUidTypePlainText);
+ if (symbianStId != 0) {
+ symbianStream.OpenLC(cb->Store(), symbianStId);
+ QT_TRYCATCH_LEAVING(readSymbianStoreLX(d->source(), cb));
+ CleanupStack::PopAndDestroy(&symbianStream);
+ dataExists = true;
+ }
+ }
+ CleanupStack::PopAndDestroy(cb);
+ if (dataExists) {
+ return d->source();
+ }
+ else {
+ return 0;
+ }
+
});
if (err != KErrNone){
qDebug()<< "clipboard is empty/err: " << err;
@@ -223,6 +283,7 @@ void QClipboard::setMimeData(QMimeData* src, Mode mode)
TRAPD(err,{
RFs fs = qt_s60GetRFs();
CClipboard* cb = CClipboard::NewForWritingLC(fs);
+ //stream for qt
RStoreWriteStream stream;
TStreamId stid = stream.CreateLC(cb->Store());
QT_TRYCATCH_LEAVING(writeToStreamLX(src,stream));
@@ -230,7 +291,14 @@ void QClipboard::setMimeData(QMimeData* src, Mode mode)
stream.CommitL();
(cb->StreamDictionary()).AssignL(KQtCbDataStream,stid);
cb->CommitL();
- CleanupStack::PopAndDestroy(2,cb);
+
+ //stream for symbian
+ RStoreWriteStream symbianStream;
+ TStreamId symbianStId = symbianStream.CreateLC(cb->Store());
+ QT_TRYCATCH_LEAVING(writeToSymbianStoreLX(src, cb));
+ (cb->StreamDictionary()).AssignL(KClipboardUidTypePlainText, symbianStId);
+ cb->CommitL();
+ CleanupStack::PopAndDestroy(3,cb);
});
if (err != KErrNone){
qDebug()<< "clipboard write err :" << err;
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 49f7d7f968..dfcc2e6ffb 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -964,10 +964,6 @@ static int qCocoaViewCount = 0;
}
}
#endif //QT_NO_WHEELEVENT
-
- if (!wheelOK) {
- return [super scrollWheel:theEvent];
- }
}
- (void)tabletProximity:(NSEvent *)tabletEvent
diff --git a/src/gui/kernel/qdesktopwidget.qdoc b/src/gui/kernel/qdesktopwidget.qdoc
index 2d72bf9740..c550082011 100644
--- a/src/gui/kernel/qdesktopwidget.qdoc
+++ b/src/gui/kernel/qdesktopwidget.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
diff --git a/src/gui/kernel/qsizepolicy.qdoc b/src/gui/kernel/qsizepolicy.qdoc
index f6a350c40c..504821ea7d 100644
--- a/src/gui/kernel/qsizepolicy.qdoc
+++ b/src/gui/kernel/qsizepolicy.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index a773e7a1c8..d89eedc5a7 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -68,6 +68,7 @@
# include "qt_cocoa_helpers_mac_p.h"
# include "qmainwindow.h"
# include "qtoolbar.h"
+# include <private/qmainwindowlayout_p.h>
#endif
#if defined(Q_WS_QWS)
# include "qwsdisplay_qws.h"
@@ -734,9 +735,9 @@ void QWidget::setAutoFillBackground(bool enabled)
\list
\i mouseMoveEvent() is called whenever the mouse moves while a mouse
button is held down. This can be useful during drag and drop
- operations. If you call setMouseTracking(true), you get mouse move
- events even when no buttons are held down. (See also the \l{Drag
- and Drop} guide.)
+ operations. If you call \l{setMouseTracking()}{setMouseTracking}(true),
+ you get mouse move events even when no buttons are held down.
+ (See also the \l{Drag and Drop} guide.)
\i keyReleaseEvent() is called whenever a key is released and while it
is held down (if the key is auto-repeating). In that case, the
widget will receive a pair of key release and key press event for
@@ -2994,6 +2995,15 @@ bool QWidget::isFullScreen() const
*/
void QWidget::showFullScreen()
{
+#ifdef Q_WS_MAC
+ // If the unified toolbar is enabled, we have to disable it before going fullscreen.
+ QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
+ if (mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()) {
+ mainWindow->setUnifiedTitleAndToolBarOnMac(false);
+ QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
+ mainLayout->activateUnifiedToolbarAfterFullScreen = true;
+ }
+#endif // Q_WS_MAC
ensurePolished();
#ifdef QT3_SUPPORT
if (parent())
@@ -3026,6 +3036,18 @@ void QWidget::showMaximized()
setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen))
| Qt::WindowMaximized);
+#ifdef Q_WS_MAC
+ // If the unified toolbar was enabled before going fullscreen, we have to enable it back.
+ QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
+ if (mainWindow)
+ {
+ QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
+ if (mainLayout->activateUnifiedToolbarAfterFullScreen) {
+ mainWindow->setUnifiedTitleAndToolBarOnMac(true);
+ mainLayout->activateUnifiedToolbarAfterFullScreen = false;
+ }
+ }
+#endif // Q_WS_MAC
show();
}
@@ -3047,6 +3069,18 @@ void QWidget::showNormal()
setWindowState(windowState() & ~(Qt::WindowMinimized
| Qt::WindowMaximized
| Qt::WindowFullScreen));
+#ifdef Q_WS_MAC
+ // If the unified toolbar was enabled before going fullscreen, we have to enable it back.
+ QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
+ if (mainWindow)
+ {
+ QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
+ if (mainLayout->activateUnifiedToolbarAfterFullScreen) {
+ mainWindow->setUnifiedTitleAndToolBarOnMac(true);
+ mainLayout->activateUnifiedToolbarAfterFullScreen = false;
+ }
+ }
+#endif // Q_WS_MAC
show();
}
@@ -8668,8 +8702,8 @@ bool QWidget::event(QEvent *event)
/*!
This event handler can be reimplemented to handle state changes.
- The state being changed in this event can be retrieved through event \a
- event.
+ The state being changed in this event can be retrieved through the \a event
+ supplied.
Change events include: QEvent::ToolBarChange,
QEvent::ActivationChange, QEvent::EnabledChange, QEvent::FontChange,
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 017541c327..fc94616c7b 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2794,19 +2794,38 @@ void QWidgetPrivate::transferChildren()
#ifdef QT_MAC_USE_COCOA
void QWidgetPrivate::setSubWindowStacking(bool set)
{
+ // This will set/remove a visual relationship between parent and child on screen.
+ // The reason for doing this is to ensure that a child always stacks infront of
+ // its parent. Unfortunatly is turns out that [NSWindow addChildWindow] has
+ // several unwanted side-effects, one of them being the moving of a child when
+ // moving the parent, which we choose to accept. A way tougher side-effect is
+ // that Cocoa will hide the parent if you hide the child. And in the case of
+ // a tool window, since it will normally hide when you deactivate the
+ // application, Cocoa will hide the parent upon deactivate as well. The result often
+ // being no more visible windows on screen. So, to make a long story short, we only
+ // allow parent-child relationships between windows that both are either a plain window
+ // or a dialog.
+
Q_Q(QWidget);
- if (!q->isWindow() || !q->testAttribute(Qt::WA_WState_Created))
+ if (!q->isWindow())
+ return;
+ NSWindow *qwin = [qt_mac_nativeview_for(q) window];
+ if (!qwin)
+ return;
+ Qt::WindowType qtype = q->windowType();
+ if (set && !(qtype == Qt::Window || qtype == Qt::Dialog))
+ return;
+ if (set && ![qwin isVisible])
return;
if (QWidget *parent = q->parentWidget()) {
- if (parent->testAttribute(Qt::WA_WState_Created)) {
+ if (NSWindow *pwin = [qt_mac_nativeview_for(parent) window]) {
if (set) {
- if (parent->isVisible()) {
- NSWindow *childwin = qt_mac_window_for(q);
- [qt_mac_window_for(parent) addChildWindow:childwin ordered:NSWindowAbove];
- }
+ Qt::WindowType ptype = parent->window()->windowType();
+ if ([pwin isVisible] && (ptype == Qt::Window || ptype == Qt::Dialog) && ![qwin parentWindow])
+ [pwin addChildWindow:qwin ordered:NSWindowAbove];
} else {
- [qt_mac_window_for(parent) removeChildWindow:qt_mac_window_for(q)];
+ [pwin removeChildWindow:qwin];
}
}
}
@@ -2814,12 +2833,15 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
QList<QWidget *> widgets = q->findChildren<QWidget *>();
for (int i=0; i<widgets.size(); ++i) {
QWidget *child = widgets.at(i);
- if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created) && child->isVisibleTo(q)) {
- if (set) {
- NSWindow *childwin = qt_mac_window_for(child);
- [qt_mac_window_for(q) addChildWindow:childwin ordered:NSWindowAbove];
- } else {
- [qt_mac_window_for(q) removeChildWindow:qt_mac_window_for(child)];
+ if (child && child->isWindow()) {
+ if (NSWindow *cwin = [qt_mac_nativeview_for(child) window]) {
+ if (set) {
+ Qt::WindowType ctype = child->window()->windowType();
+ if ([cwin isVisible] && (ctype == Qt::Window || ctype == Qt::Dialog) && ![cwin parentWindow])
+ [qwin addChildWindow:cwin ordered:NSWindowAbove];
+ } else {
+ [qwin removeChildWindow:qt_mac_window_for(child)];
+ }
}
}
}
@@ -3442,7 +3464,6 @@ void QWidgetPrivate::show_sys()
#else
// sync the opacity value back (in case of a fade).
[window setAlphaValue:q->windowOpacity()];
- setSubWindowStacking(true);
QWidget *top = 0;
if (QApplicationPrivate::tryModalHelper(q, &top)) {
@@ -3461,6 +3482,7 @@ void QWidgetPrivate::show_sys()
[modalWin orderFront:window];
}
}
+ setSubWindowStacking(true);
#endif
if (q->windowType() == Qt::Popup) {
if (q->focusWidget())
diff --git a/src/gui/kernel/qwidget_qws.cpp b/src/gui/kernel/qwidget_qws.cpp
index 31451362f1..c6cbbd067f 100644
--- a/src/gui/kernel/qwidget_qws.cpp
+++ b/src/gui/kernel/qwidget_qws.cpp
@@ -1017,6 +1017,30 @@ int QWidget::metric(PaintDeviceMetric m) const
return static_cast<QWidget *>(d->parent)->metric(m);
const QScreen *screen = d->getScreen();
return qRound(screen->height() / double(screen->physicalHeight() / 25.4));
+ } else if (m == PdmNumColors) {
+ QScreen *screen = d->getScreen();
+ int ret = screen->colorCount();
+ if (!ret) {
+ const int depth = qwsDisplay()->depth();
+ switch (depth) {
+ case 1:
+ ret = 2;
+ break;
+ case 8:
+ ret = 256;
+ break;
+ case 16:
+ ret = 65536;
+ break;
+ case 24:
+ ret = 16777216;
+ break;
+ case 32:
+ ret = 2147483647;
+ break;
+ }
+ }
+ return ret;
} else {
val = QPaintDevice::metric(m);// XXX
}
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 41ce11eb05..8972eb6e10 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -548,7 +548,7 @@ void QWidgetPrivate::show_sys()
id->MakeVisible(true);
- if(q->isWindow())
+ if(q->isWindow()&&!q->testAttribute(Qt::WA_ShowWithoutActivating))
id->setFocusSafely(true);
}
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 10c6f404ba..9ad4648507 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -234,13 +234,14 @@ embedded {
symbian {
- HEADERS += painting/qwindowsurface_s60_p.h
+ HEADERS += painting/qwindowsurface_s60_p.h \
+ painting/qdrawhelper_arm_simd_p.h
SOURCES += painting/qwindowsurface_s60.cpp
armccIfdefBlock = \
"$${LITERAL_HASH}if defined(ARMV6)" \
+ "MACRO QT_HAVE_ARM_SIMD" \
"SOURCEPATH painting" \
- "SOURCE qblendfunctions_armv6_rvct.s" \
- "SOURCE qdrawhelper_armv6_rvct.s" \
+ "SOURCE qdrawhelper_arm_simd.cpp" \
"$${LITERAL_HASH}endif"
MMP_RULES += armccIfdefBlock
diff --git a/src/gui/painting/qblendfunctions_armv6_rvct.s b/src/gui/painting/qblendfunctions_armv6_rvct.s
deleted file mode 100644
index 1e3faa98a3..0000000000
--- a/src/gui/painting/qblendfunctions_armv6_rvct.s
+++ /dev/null
@@ -1,222 +0,0 @@
-;****************************************************************************
-;**
-;** 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 QtGui module 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$
-;**
-;****************************************************************************
-
-;
-; W A R N I N G
-; -------------
-;
-; This file is not part of the Qt API. It exists purely as an
-; implementation detail. This header file may change from version to
-; version without notice, or even be removed.
-;
-; We mean it.
-;
-
-
- ARM
- PRESERVE8
-
- INCLUDE qdrawhelper_armv6_rvct.inc
-
-
-;-----------------------------------------------------------------------------
-; qt_blend_rgb32_on_rgb32_arm
-;
-; @brief
-;
-; @param dest Destination pixels (r0)
-; @param dbpl Destination bytes per line (r1)
-; @param src Source pixels (r2)
-; @param sbpl Source bytes per line (r3)
-; @param w Width (s0 -> r4)
-; @param h Height (s1 -> r5)
-; @param const_alpha Constant alpha (s2 -> r6)
-;
-;---------------------------------------------------------------------------
-qt_blend_rgb32_on_rgb32_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- ; read arguments off the stack
- add r8, sp, #10 * 4
- ldmia r8, {r9-r11}
-
- ; Reorganize registers
-
- mov r4, r10
- mov r5, r1
- mov r6, r3
-
- mov r1, r2
- mov r2, r9
- mov r3, r11
-
- ; Now we have registers
- ; @param dest Destination pixels (r0)
- ; @param src Source pixels (r1)
- ; @param w Width (r2)
- ; @param const_alpha Constant alpha (r3)
- ; @param h Height (r4)
- ; @param dbpl Destination bytes per line (r5)
- ; @param sbpl Source bytes per line (r6)
-
- cmp r3, #256 ; test if we have fully opaque constant alpha value
- bne rgb32_blend_const_alpha ; branch if not
-
-rgb32_blend_loop
-
- subs r4, r4, #1
- bmi rgb32_blend_exit ; while(h--)
-
-rgb321 PixCpySafe r0, r1, r2
-
- add r0, r0, r5 ; dest = dest + dbpl
- add r1, r1, r6 ; src = src + sbpl
-
- b rgb32_blend_loop
-
-
-rgb32_blend_const_alpha
-
- ;ldr r14, =ComponentHalf ; load 0x800080 to r14
- mov r14, #0x800000
- add r14, r14, #0x80
-
- sub r3, r3, #1 ; const_alpha -= 1;
-
-rgb32_blend_loop_const_alpha
-
- subs r4, r4, #1
- bmi rgb32_blend_exit ; while(h--)
-
-rgb322 BlendRowSafe PixelSourceOverConstAlpha
-
- add r0, r0, r5 ; dest = dest + dbpl
- add r1, r1, r6 ; src = src + sbpl
-
- b rgb32_blend_loop_const_alpha
-
-rgb32_blend_exit
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-
-
-;-----------------------------------------------------------------------------
-; qt_blend_argb32_on_argb32_arm
-;
-; @brief
-;
-; @param dest Destination pixels (r0)
-; @param dbpl Destination bytes per line (r1)
-; @param src Source pixels (r2)
-; @param sbpl Source bytes per line (r3)
-; @param w Width (s0 -> r4)
-; @param h Height (s1 -> r5)
-; @param const_alpha Constant alpha (s2 -> r6)
-;
-;---------------------------------------------------------------------------
-qt_blend_argb32_on_argb32_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- ; read arguments off the stack
- add r8, sp, #10 * 4
- ldmia r8, {r9-r11}
-
- ; Reorganize registers
-
- mov r4, r10
- mov r5, r1
- mov r6, r3
-
- mov r1, r2
- mov r2, r9
- mov r3, r11
-
- ; Now we have registers
- ; @param dest Destination pixels (r0)
- ; @param src Source pixels (r1)
- ; @param w Width (r2)
- ; @param const_alpha Constant alpha (r3)
- ; @param h Height (r4)
- ; @param dbpl Destination bytes per line (r5)
- ; @param sbpl Source bytes per line (r6)
-
- ;ldr r14, =ComponentHalf ; load 0x800080 to r14
- mov r14, #0x800000
- add r14, r14, #0x80
-
- cmp r3, #256 ; test if we have fully opaque constant alpha value
- bne argb32_blend_const_alpha ; branch if not
-
-argb32_blend_loop
-
- subs r4, r4, #1
- bmi argb32_blend_exit ; while(h--)
-
-argb321 BlendRowSafe PixelSourceOver
-
- add r0, r0, r5 ; dest = dest + dbpl
- add r1, r1, r6 ; src = src + sbpl
-
- b argb32_blend_loop
-
-argb32_blend_const_alpha
-
- sub r3, r3, #1 ; const_alpha -= 1;
-
-argb32_blend_loop_const_alpha
-
- subs r4, r4, #1
- bmi argb32_blend_exit ; while(h--)
-
-argb322 BlendRowSafe PixelSourceOverConstAlpha
-
- add r0, r0, r5 ; dest = dest + dbpl
- add r1, r1, r6 ; src = src + sbpl
-
- b argb32_blend_loop_const_alpha
-
-argb32_blend_exit
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-
- END ; File end
diff --git a/src/gui/painting/qcolormap.qdoc b/src/gui/painting/qcolormap.qdoc
index ec3d2ba327..96fd6a00ae 100644
--- a/src/gui/painting/qcolormap.qdoc
+++ b/src/gui/painting/qcolormap.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 5f190ba1ce..a4ab2783ae 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -43,7 +43,7 @@
#include <private/qpaintengine_raster_p.h>
#include <private/qpainter_p.h>
#include <private/qdrawhelper_x86_p.h>
-#include <private/qdrawhelper_armv6_p.h>
+#include <private/qdrawhelper_arm_simd_p.h>
#include <private/qdrawhelper_neon_p.h>
#include <private/qmath_p.h>
#include <qmath.h>
@@ -7678,96 +7678,6 @@ static void qt_memfill16_setup(quint16 *dest, quint16 value, int count);
qt_memfill32_func qt_memfill32 = qt_memfill32_setup;
qt_memfill16_func qt_memfill16 = qt_memfill16_setup;
-#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
-// Move these to qdrawhelper_arm.c when all
-// functions are implemented using arm assembly.
-static CompositionFunctionSolid qt_functionForModeSolid_ARMv6[numCompositionFunctions] = {
- comp_func_solid_SourceOver,
- comp_func_solid_DestinationOver,
- comp_func_solid_Clear,
- comp_func_solid_Source,
- comp_func_solid_Destination,
- comp_func_solid_SourceIn,
- comp_func_solid_DestinationIn,
- comp_func_solid_SourceOut,
- comp_func_solid_DestinationOut,
- comp_func_solid_SourceAtop,
- comp_func_solid_DestinationAtop,
- comp_func_solid_XOR,
- comp_func_solid_Plus,
- comp_func_solid_Multiply,
- comp_func_solid_Screen,
- comp_func_solid_Overlay,
- comp_func_solid_Darken,
- comp_func_solid_Lighten,
- comp_func_solid_ColorDodge,
- comp_func_solid_ColorBurn,
- comp_func_solid_HardLight,
- comp_func_solid_SoftLight,
- comp_func_solid_Difference,
- comp_func_solid_Exclusion,
- rasterop_solid_SourceOrDestination,
- rasterop_solid_SourceAndDestination,
- rasterop_solid_SourceXorDestination,
- rasterop_solid_NotSourceAndNotDestination,
- rasterop_solid_NotSourceOrNotDestination,
- rasterop_solid_NotSourceXorDestination,
- rasterop_solid_NotSource,
- rasterop_solid_NotSourceAndDestination,
- rasterop_solid_SourceAndNotDestination
-};
-
-static CompositionFunction qt_functionForMode_ARMv6[numCompositionFunctions] = {
- comp_func_SourceOver_armv6,
- comp_func_DestinationOver,
- comp_func_Clear,
- comp_func_Source_armv6,
- comp_func_Destination,
- comp_func_SourceIn,
- comp_func_DestinationIn,
- comp_func_SourceOut,
- comp_func_DestinationOut,
- comp_func_SourceAtop,
- comp_func_DestinationAtop,
- comp_func_XOR,
- comp_func_Plus,
- comp_func_Multiply,
- comp_func_Screen,
- comp_func_Overlay,
- comp_func_Darken,
- comp_func_Lighten,
- comp_func_ColorDodge,
- comp_func_ColorBurn,
- comp_func_HardLight,
- comp_func_SoftLight,
- comp_func_Difference,
- comp_func_Exclusion,
- rasterop_SourceOrDestination,
- rasterop_SourceAndDestination,
- rasterop_SourceXorDestination,
- rasterop_NotSourceAndNotDestination,
- rasterop_NotSourceOrNotDestination,
- rasterop_NotSourceXorDestination,
- rasterop_NotSource,
- rasterop_NotSourceAndDestination,
- rasterop_SourceAndNotDestination
-};
-
-static void qt_blend_color_argb_armv6(int count, const QSpan *spans, void *userData)
-{
- QSpanData *data = reinterpret_cast<QSpanData *>(userData);
-
- CompositionFunctionSolid func = qt_functionForModeSolid_ARMv6[data->rasterBuffer->compositionMode];
- while (count--) {
- uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x;
- func(target, spans->len, data->solid.color, spans->coverage);
- ++spans;
- }
-}
-
-#endif // Q_CC_RVCT && QT_HAVE_ARMV6
-
-
void qInitDrawhelperAsm()
{
@@ -7938,46 +7848,39 @@ void qInitDrawhelperAsm()
}
#endif // IWMMXT
-#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
- functionForModeAsm = qt_functionForMode_ARMv6;
- functionForModeSolidAsm = qt_functionForModeSolid_ARMv6;
+#if defined(QT_HAVE_ARM_SIMD)
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_arm_simd;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_arm_simd;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_arm_simd;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_arm_simd;
+#elif defined(QT_HAVE_NEON)
+ if (features & NEON) {
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
+ qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;
+ qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon;
+
+ qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon;
+ qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon;
- qt_memfill32 = qt_memfill32_armv6;
+ qTransformFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_rgb16_neon;
+ qTransformFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_transform_image_rgb16_on_rgb16_neon;
- qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_armv6;
+ qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_armv6;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_armv6;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_armv6;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_armv6;
-#elif defined(QT_HAVE_NEON)
- if (features & NEON) {
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
- qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;
- qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon;
-
- qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon;
- qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon;
-
- qTransformFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_rgb16_neon;
- qTransformFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_transform_image_rgb16_on_rgb16_neon;
-
- qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon;
-
- functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;
- functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon;
- functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon;
- destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon;
- destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon;
-
- qMemRotateFunctions[QImage::Format_RGB16][0] = qt_memrotate90_16_neon;
- qMemRotateFunctions[QImage::Format_RGB16][2] = qt_memrotate270_16_neon;
- qt_memfill32 = qt_memfill32_neon;
- }
+ functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;
+ functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon;
+ functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon;
+ destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon;
+ destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon;
+
+ qMemRotateFunctions[QImage::Format_RGB16][0] = qt_memrotate90_16_neon;
+ qMemRotateFunctions[QImage::Format_RGB16][2] = qt_memrotate270_16_neon;
+ qt_memfill32 = qt_memfill32_neon;
+ }
#endif
if (functionForModeSolidAsm) {
diff --git a/src/gui/painting/qdrawhelper_arm_simd.cpp b/src/gui/painting/qdrawhelper_arm_simd.cpp
new file mode 100644
index 0000000000..61dac5ef82
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_arm_simd.cpp
@@ -0,0 +1,313 @@
+/****************************************************************************
+**
+** 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 QtGui module 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 "qdrawhelper_arm_simd_p.h"
+
+#include <private/qpaintengine_raster_p.h>
+#include <private/qblendfunctions_p.h>
+
+#ifdef QT_HAVE_ARM_SIMD
+
+#if defined(Q_OS_SYMBIAN)
+#include <u32std.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
+__asm void qt_blend_argb32_on_argb32_arm_simd(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+#ifndef __ARMCC__
+ __SWITCH_TO_ARM;
+#else
+ CODE32
+#endif // __ARMCC__
+
+ stmfd sp!, {r4-r12, r14}
+
+ // read arguments off the stack
+ add r8, sp, #10 * 4
+ ldmia r8, {r4-r6}
+
+ // adjust dbpl and sbpl
+ mov r14, #4
+ mul r14, r4, r14
+ sub r1, r1, r14
+ sub r3, r3, r14
+
+ // load 0xFF00FF00 to r12
+ mov r12, #0xFF000000
+ add r12, r12, #0xFF00
+
+ // load 0x800080 to r14
+ mov r14, #0x800000
+ add r14, r14, #0x80
+
+ /*
+ Registers:
+ r0 dst
+ r1 dbpl
+ r2 src
+ r3 sbpl
+ r4 w
+ r5 h
+ r6 const_alpha
+ r12 0xFF0000
+ r14 0x800080
+ */
+
+ cmp r6, #256 //test if we have fully opaque constant alpha value
+ bne argb32constalpha // branch if not
+
+argb32_next_row
+
+ mov r7, r4
+
+argb32_next_pixel
+
+ ldr r8, [r2], #4 // load src pixel
+
+ // Negate r8 and extract src alpha
+ mvn r11, r8 // bitwise not
+ uxtb r11, r11, ror #24
+
+ cmp r11, #0 // test for full src opacity (negated)
+ beq argb32_no_blend
+
+ cmp r11, #255 // test for full src transparency (negated)
+ addeq r0, #4
+ beq argb32_nop
+
+ ldr r9, [r0] // load dst pixel
+
+ // blend
+ uxtb16 r10, r9
+ uxtb16 r6, r9, ror #8
+ mla r10, r11, r10, r14
+ mla r9, r6, r11, r14
+ uxtab16 r10, r10, r10, ror #8
+ uxtab16 r9, r9, r9, ror #8
+ and r9, r9, r12
+ uxtab16 r10, r9, r10, ror #8
+
+ uqadd8 r8, r10, r8
+
+argb32_no_blend
+
+ str r8, [r0], #4
+
+argb32_nop
+
+ subs r7, r7, #1
+ bgt argb32_next_pixel
+
+ add r0, r0, r1 // dest = dest + dbpl
+ add r2, r2, r3 // src = src + sbpl
+
+ subs r5, r5, #1
+ bgt argb32_next_row
+
+ b argb32_blend_exit
+
+argb32constalpha
+
+ cmp r6, #0
+ beq argb32_blend_exit
+
+ ; const_alpha = (const_alpha * 255) >> 8;
+ mov r11, #255
+ mul r6, r6, r11
+ mov r11, r6, lsr #8
+
+argb32constalpha_next_row
+
+ mov r7, r4
+
+argb32constalpha_next_pixel
+
+ ldr r9, [r2], #4 // load src pixel
+
+ // blend
+ uxtb16 r10, r9
+ uxtb16 r6, r9, ror #8
+ mla r10, r11, r10, r14
+ mla r9, r6, r11, r14
+ uxtab16 r10, r10, r10, ror #8
+ uxtab16 r9, r9, r9, ror #8
+ and r9, r9, r12
+ uxtab16 r8, r9, r10, ror #8
+
+ ldr r9, [r0] // load dst pixel
+
+ // blend
+ uxtb16 r10, r9
+ uxtb16 r6, r9, ror #8
+
+ // Negate r11 and extract src alpha
+ mvn r9, r11 // bitwise not
+ uxtb r9, r9, ror #24
+
+ mla r10, r9, r10, r14
+ mla r9, r6, r9, r14
+ uxtab16 r10, r10, r10, ror #8
+ uxtab16 r9, r9, r9, ror #8
+ and r9, r9, r12
+ uxtab16 r10, r9, r10, ror #8
+
+ uqadd8 r8, r10, r8
+
+ str r8, [r0], #4
+
+ subs r7, r7, #1
+ bgt argb32constalpha_next_pixel
+
+ add r0, r0, r1 // dest = dest + dbpl
+ add r2, r2, r3 // src = src + sbpl
+
+ subs r5, r5, #1
+ bgt argb32constalpha_next_row
+
+argb32_blend_exit
+
+ // Restore registers
+ ldmfd sp!, {r4-r12, lr}
+ bx lr
+
+ __END_ARM
+}
+
+void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ if (const_alpha != 256) {
+ qt_blend_argb32_on_argb32_arm_simd(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
+ return;
+ }
+
+ const uint *src = (const uint *) srcPixels;
+ uint *dst = (uint *) destPixels;
+ if (w <= 64) {
+ for (int y=0; y<h; ++y) {
+ qt_memconvert(dst, src, w);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ } else {
+ int len = w * 4;
+ for (int y=0; y<h; ++y) {
+ memcpy(dst, src, len);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+#else // defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
+
+// TODO: add GNU assembler instructions and support for other platforms.
+// Default to C code for now
+
+void qt_blend_argb32_on_argb32_arm_simd(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ const uint *src = (const uint *) srcPixels;
+ uint *dst = (uint *) destPixels;
+ if (const_alpha == 256) {
+ for (int y=0; y<h; ++y) {
+ for (int x=0; 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) {
+ const_alpha = (const_alpha * 255) >> 8;
+ for (int y=0; y<h; ++y) {
+ for (int x=0; x<w; ++x) {
+ uint s = BYTE_MUL(src[x], const_alpha);
+ dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ if (const_alpha != 256) {
+ qt_blend_argb32_on_argb32_arm_simd(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
+ return;
+ }
+
+ const uint *src = (const uint *) srcPixels;
+ uint *dst = (uint *) destPixels;
+ if (w <= 64) {
+ for (int y=0; y<h; ++y) {
+ qt_memconvert(dst, src, w);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ } else {
+ int len = w * 4;
+ for (int y=0; y<h; ++y) {
+ memcpy(dst, src, len);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+#endif
+
+#endif // QT_HAVE_ARMV_SIMD
diff --git a/src/gui/painting/qdrawhelper_armv6_p.h b/src/gui/painting/qdrawhelper_arm_simd_p.h
index e58f8bbdc1..6c96a841a6 100644
--- a/src/gui/painting/qdrawhelper_armv6_p.h
+++ b/src/gui/painting/qdrawhelper_arm_simd_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QDRAWHELPER_ARMV6_P_H
-#define QDRAWHELPER_ARMV6_P_H
+#ifndef QDRAWHELPER_ARM_SIMD_P_H
+#define QDRAWHELPER_ARM_SIMD_P_H
//
// W A R N I N G
@@ -57,25 +57,20 @@
QT_BEGIN_NAMESPACE
-#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
+#if defined(QT_HAVE_ARM_SIMD)
-extern "C" void qt_blend_rgb32_on_rgb32_armv6(uchar *destPixels, int dbpl,
+void qt_blend_argb32_on_argb32_arm_simd(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
int w, int h,
int const_alpha);
-extern "C" void qt_blend_argb32_on_argb32_armv6(uchar *destPixels, int dbpl,
+void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
int w, int h,
int const_alpha);
-extern "C" void qt_memfill32_armv6(quint32 *dest, quint32 value, int count);
-
-extern "C" void comp_func_Source_armv6(uint *dest, const uint *src, int length, uint const_alpha);
-extern "C" void comp_func_SourceOver_armv6(uint *dest, const uint *src, int length, uint const_alpha);
-
-#endif // QT_HAVE_ARMV6
+#endif // QT_HAVE_ARM_SIMD
QT_END_NAMESPACE
-#endif // QDRAWHELPER_ARMV6_P_H
+#endif // QDRAWHELPER_ARM_SIMD_P_H
diff --git a/src/gui/painting/qdrawhelper_armv6_rvct.inc b/src/gui/painting/qdrawhelper_armv6_rvct.inc
deleted file mode 100644
index 8c6d803d17..0000000000
--- a/src/gui/painting/qdrawhelper_armv6_rvct.inc
+++ /dev/null
@@ -1,496 +0,0 @@
-;****************************************************************************
-;**
-;** 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 QtGui module 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$
-;**
-;****************************************************************************
-
-;
-; W A R N I N G
-; -------------
-;
-; This file is not part of the Qt API. It exists purely as an
-; implementation detail. This header file may change from version to
-; version without notice, or even be removed.
-;
-; We mean it.
-;
-
-;-----------------------------------------------------------------------------
-; Globals.
-; Earch marcro expects that caller has loaded 0x800080 to r14.
-;-----------------------------------------------------------------------------
-
-ComponentHalf EQU 0x800080
-
-;-----------------------------------------------------------------------------
-; ARM assembly implementations of accelerated graphics operations.
-;
-; Conventions:
-;
-; - r0 = Target buffer pointer
-; - r1 = Source buffer pointer
-; - r2 = Length of the buffer to blend
-; - r3 = Constant alpha for source buffer
-;
-;-----------------------------------------------------------------------------
-
-; A macro for transparently defining ARM functions
- MACRO
-$func Function
- AREA Function_$func, CODE
- GLOBAL $func
- ALIGN 4
- CODE32
-$func
- MEND
-
-
-;-----------------------------------------------------------------------------
-; Armv6 boosted implementation of BYTE_MUL(...) function found in qdrawhelper_p.h.
-;
-; @param dst Destination register where to store the result
-; @param x Value to multiply
-; @param a Multiplicator byte
-; @param r14 Component half 0x800080
-;
-; @note Trashes x, r8
-;-----------------------------------------------------------------------------
- MACRO
- ByteMul $dst, $x, $a
-
- ; static inline uint BYTE_MUL(uint x, uint a)
-
- ; uint r8 = (x & 0xff00ff) * a + 0x800080
- uxtb16 r8, $x ; r8 = r8 & 0x00FF00FF
- mla r8, r8, $a, r14
-
- ; x = ((r >> 8) & 0xff00ff) * a + 0x800080
- uxtb16 $x, $x, ror #8
- mla $x, $x, $a, r14
-
-
- ; r8 = (r8 + ((r8 >> 8) & 0xff00ff) ) >> 8
- ; r8 &= 0xff00ff
- uxtab16 r8, r8, r8, ror #8
- uxtb16 r8, r8, ror #8
-
- ; x = x + ((x >>8) & 0xff00ff)
- uxtab16 $x, $x, $x, ror #8
-
- ; x &= 0xff00ff00
- ; x |= r8
- uxtb16 $x, $x, ror #8
- orr $dst, r8, $x, lsl #8
-
- MEND
-
-;-----------------------------------------------------------------------------
-; Armv6 boosted implementation of INTERPOLATE_PIXEL_255(...) function found in
-; qdrawhelper_p.h.
-;
-; @param dst Destination register where to store the result
-; @param x First value to multiply
-; @param a Multiplicator byte for first value
-; @param y Second value to multiply
-; @param b Multiplicator byte for second value
-; @param r14 Component half 0x800080
-;
-;
-; @note Trashes x, r8, r14
-;-----------------------------------------------------------------------------
- MACRO
- InterpolatePixel255 $dst, $x, $a, $y, $b
-
- ; static inline uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b)
-
- ; First calculate the parts where we need 0x800080
-
- ; uint r8 = (((x & 0xff00ff) * a) + 0x800080)
- uxtb16 r8, $x ; r8 = r8 & 0x00FF00FF
- mla r8, r8, $a, r14
-
- ; x = ((((x >> 8) & 0xff00ff) * a) + 0x800080)
- uxtb16 $x, $x, ror #8
- mla $x, $x, $a, r14
-
- ; Now we are trashing r14 to free it for other purposes
-
- ; uint r14 = (y & 0xff00ff) * b
- uxtb16 r14, $y ; r14 = y & 0x00FF00FF
- mul r14, r14, $b
-
- ; r8 = r8 + r14
- add r8, r8, r14
-
- ; r8 = (r8 + ((r8 >> 8) & 0xff00ff) ) >> 8
- ; r8 &= 0xff00ff
- uxtab16 r8, r8, r8, ror #8
- uxtb16 r8, r8, ror #8
-
- ; r14 = ((y >> 8) & 0xff00ff) * b
- uxtb16 r14, $y, ror #8 ; r14 = ((y >> 8) & 0xFF00FF)
- mul r14, r14, $b
-
- ; x = x + r14
- add $x, $x, r14
-
- ; x = x + ((x >>8) & 0xff00ff)
- uxtab16 $x, $x, $x, ror #8
-
- ; x &= 0xff00ff00
- ; x |= r8
- uxtb16 $x, $x, ror #8
- orr $dst, r8, $x, lsl #8
-
- MEND
-
-;-----------------------------------------------------------------------------
-;
-;-----------------------------------------------------------------------------
- MACRO
-$label Blend4Pixels $BlendPixel
-
- ; Blend first 4 pixels
-
- ldmia r1!, {r4-r7}
- ldm r0, {r9-r12}
-
-b4p1_$label $BlendPixel r9, r4, r3
-b4p2_$label $BlendPixel r10, r5, r3
-b4p3_$label $BlendPixel r11, r6, r3
-b4p4_$label $BlendPixel r12, r7, r3
-
- stmia r0!, {r9-r12}
-
- MEND
-
-;-----------------------------------------------------------------------------
-;
-;-----------------------------------------------------------------------------
- MACRO
-$label Blend8Pixels $BlendPixel
-
-b8p1_$label Blend4Pixels $BlendPixel
-b8p2_$label Blend4Pixels $BlendPixel
-
- MEND
-
-;-----------------------------------------------------------------------------
-;
-;-----------------------------------------------------------------------------
- MACRO
-$label Blend16Pixels $BlendPixel
-
-b16p1_$label Blend8Pixels $BlendPixel
-b16p2_$label Blend8Pixels $BlendPixel
-
- MEND
-
-;-----------------------------------------------------------------------------
-;
-;-----------------------------------------------------------------------------
- MACRO
-$label Blend32Pixels $BlendPixel
-
-b32p1_$label Blend16Pixels $BlendPixel
-b32p2_$label Blend16Pixels $BlendPixel
-
- MEND
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one row of pixels and saving the results
-; to destination buffer.
-;
-; @param dest Destination buffer (r0)
-; @param src Source buffer (r1)
-; @param length Length (r2)
-; @param const_alpha Constant alpha (r3)
-; @param r14 Component Half (0x800080) (r14)
-;
-; @note Advances r0, r1
-; @note Trashes r2, r4-r12
-;-----------------------------------------------------------------------------
- MACRO
-$label BlendRow $BlendPixel
-
- pld [r1]
-
-bloop_$label
- ; Blend 32 pixels per loop iteration
- subs r2, r2, #32
- bmi b_remaining_$label
-
-brp1_$label Blend32Pixels $BlendPixel
-
- b bloop_$label
-
-b_remaining_$label
-
- ; Remaining 31 pixels
-
- addmi r2, r2, #32
-
- ; Blend 16 pixels
- tst r2, #16
- beq b_remaining8_$label
-
-brp2_$label Blend16Pixels $BlendPixel
-
-b_remaining8_$label
-
- ; Blend 8 pixels
- tst r2, #8
- beq b_remaining4_$label
-
-brp3_$label Blend8Pixels $BlendPixel
-
-b_remaining4_$label
-
- ; Blend 4 pixels
- tst r2, #4
- beq b_remaining3_$label
-
-brp4_$label Blend4Pixels $BlendPixel
-
-b_remaining3_$label
-
- ; Remaining 3 pixels
-
- tst r2, #2
- beq b_last_$label
-
- ldmia r1!, {r4-r5}
- ldm r0, {r9-r10}
-
-brp5_$label $BlendPixel r9, r4, r3
-brp6_$label $BlendPixel r10, r5, r3
-
- stmia r0!, {r9-r10}
-
-b_last_$label
-
- tst r2, #1
- beq bexit_$label
-
- ldr r4, [r1]
- ldr r9, [r0]
-
-bpl_$label $BlendPixel r9, r4, r3
-
- str r9, [r0]
-
-bexit_$label
-
- MEND
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one row of pixels and saving the results
-; to destination buffer. Restores all registers.
-;
-; @param dest Destination buffer (r0)
-; @param src Source buffer (r1)
-; @param length Length (r2)
-; @param const_alpha Constant alpha (r3)
-; @param r14 Component Half (0x800080) (r14)
-;
-; @note Advances r0, r1
-; @note Trashes r2, r4-r12
-;-----------------------------------------------------------------------------
- MACRO
-$label BlendRowSafe $BlendPixel
-
- stmfd sp!, {r0-r6} ; Preserves registers only up to r6
-
-brs_$label BlendRow $BlendPixel
-
- ldmfd sp!, {r0-r6}
-
- MEND
-
-
-;-----------------------------------------------------------------------------
-; Pix Copy.
-; NOTE! Cache line size of ARM1136JF-S and ARM1136J-S is 32 bytes (8 pixels).
-;
-; @param dst Destination pixels (r0)
-; @param src Source pixels (r1)
-; @param len Length (r2)
-;
-; @note Trashes r3-r10
-;-----------------------------------------------------------------------------
- MACRO
-$label PixCpy $dst, $src, $len
-
- pld [$src]
-
-pcpy_loop_$label
- ; Copy 8 pixels per loop iteration
- pld [$src, #96]
- subs $len, $len, #8
- ldmgeia $src!, {r3-r10}
- stmgeia $dst!, {r3-r10}
- bgt pcpy_loop_$label
-
-pcpy_remaining_$label
-
- ; Copy up to 7 remaining pixels
-
- ; Copy 4 pixels
- tst $len, #4
- ldmneia $src!, {r3-r6}
- stmneia $dst!, {r3-r6}
-
- tst $len, #2
- ldmneia $src!, {r3-r4}
- stmneia $dst!, {r3-r4}
-
- tst $len, #1
- ldrne r3, [$src]
- strne r3, [$dst]
-
- MEND
-
-;-----------------------------------------------------------------------------
-; General Pix Copy. Maximum 8 pixels at time. Restores all registers.
-;
-; @param dst Destination pixels (r0)
-; @param src Source pixels (r1)
-; @param len Length (r2)
-;
-; @note Trashes r3-r10
-;-----------------------------------------------------------------------------
- MACRO
-$label PixCpySafe $dst, $src, $len
-
- stmfd sp!, {r0-r6} ; Preserves registers only up to r6
-
-pcs_$label PixCpy $dst, $src, $len
-
- ldmfd sp!, {r0-r6} ; pop
-
- MEND
-
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one pixel and saving the result to
-; dst register.
-;
-; @param dst Destination register, must contain destination pixel upon entry
-; @param src Source register, must contain source pixel upon entry
-; @param const_alpha Constant source alpha
-; @param r14 Component half 0x800080
-;
-; @note Trashes const_alpha, r8
-;-----------------------------------------------------------------------------
- MACRO
-$label PixelSourceOver $dst, $src, $const_alpha
-
- ; Negate src and extract alpha
- mvn $const_alpha, $src ; bitwise not
- uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24);
-
- ;cmp $const_alpha, #255 ; test for full transparency ( negated )
- ;beq exit_$label
- cmp $const_alpha, #0 ; test for full opacity ( negated )
- moveq $dst, $src
- beq exit_$label
-
- ByteMul $dst, $dst, $const_alpha
- add $dst, $src, $dst
-
-exit_$label
- MEND
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one pixel and saving the result to
-; dst register.
-;
-; @param dst Destination register, must contain destination pixel upon entry
-; @param src Source register, must contain source pixel upon entry
-; @param const_alpha Constant source alpha
-; @param r14 Component half 0x800080
-;
-; @note Trashes src, const_alpha, r8
-;-----------------------------------------------------------------------------
- MACRO
-$label PixelSourceOverConstAlpha $dst, $src, $const_alpha
-
- ; store alpha because we are going to trash it
- stmfd sp!, {$const_alpha}
-
- ByteMul $src, $src, $const_alpha
-
- ; Negate src and extract alpha
- mvn $const_alpha, $src ; bitwise not
- uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24);
-
- ByteMul $dst, $dst, $const_alpha
-
- add $dst, $src, $dst
-
- ; recover alpha
- ldmfd sp!, {$const_alpha}
-
- MEND
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one pixel and saving the result to
-; a register.
-;
-; @param dst Destination register, must contain destination pixel upon entry
-; @param src Source register, must contain source pixel upon entry
-; @param const_alpha Constant source alpha
-; @param r14 Component half 0x800080
-;
-; @note Trashes src, r8
-;-----------------------------------------------------------------------------
- MACRO
-$label PixelSourceConstAlpha $dst, $src, $const_alpha
-
- ; store r2 and r14 because we are going to trash them
- stmfd sp!, {r2, r14}
-
- rsb r2, $const_alpha, #255
- InterpolatePixel255 $dst, $src, $const_alpha, $dst, r2
-
- ; recover r2 and r14
- ldmfd sp!, {r2, r14}
-
- MEND
-
- END ; File end
diff --git a/src/gui/painting/qdrawhelper_armv6_rvct.s b/src/gui/painting/qdrawhelper_armv6_rvct.s
deleted file mode 100644
index 180980a0ca..0000000000
--- a/src/gui/painting/qdrawhelper_armv6_rvct.s
+++ /dev/null
@@ -1,177 +0,0 @@
-;****************************************************************************
-;**
-;** 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 QtGui module 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$
-;**
-;****************************************************************************
-
-;
-; W A R N I N G
-; -------------
-;
-; This file is not part of the Qt API. It exists purely as an
-; implementation detail. This header file may change from version to
-; version without notice, or even be removed.
-;
-; We mean it.
-;
-
- ARM
- PRESERVE8
-
- INCLUDE qdrawhelper_armv6_rvct.inc
-
-;-----------------------------------------------------------------------------
-; qt_memfill32_armv6
-;
-; @brief Not yet in use!
-;
-; @param dest Destination buffer (r0)
-; @param value Value (r1)
-; @param count Count (r2)
-;
-;---------------------------------------------------------------------------
-qt_memfill32_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- mov r3, r1
- mov r4, r1
- mov r5, r1
- mov r6, r1
- mov r7, r1
- mov r8, r1
- mov r9, r1
-
-mfill_loop
- ; Fill 32 pixels per loop iteration
- subs r2, r2, #32
- stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- bgt mfill_loop
-
-mfill_remaining
-
- ; Fill up to 31 remaining pixels
-
- ; Fill 16 pixels
- tst r2, #16
- stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
-
- ; Fill 8 pixels
- tst r2, #8
- stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
-
- ; Fill 4 pixels
- tst r2, #4
- stmneia r0!, {r1, r3, r4, r5}
-
- ; Fill 2 pixels
- tst r2, #2
- stmneia r0!, {r1, r3}
-
- ; Fill last one
- tst r2, #1
- strne r1, [r0]
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-;-----------------------------------------------------------------------------
-; comp_func_Source_arm
-;
-; @brief
-;
-; @param dest Destination buffer (r0)
-; @param src Source buffer (r1)
-; @param length Length (r2)
-; @param const_alpha Constant alpha (r3)
-;
-;---------------------------------------------------------------------------
-comp_func_Source_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- cmp r3, #255 ; if(r3 == 255)
- bne src2 ; branch if not
-
-src1 PixCpy r0, r1, r2
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-src2
- ;ldr r14, =ComponentHalf ; load 0x800080 to r14
- mov r14, #0x800000
- add r14, r14, #0x80
-
-src22 BlendRow PixelSourceConstAlpha
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-;-----------------------------------------------------------------------------
-; comp_func_SourceOver_arm
-;
-; @brief
-;
-; @param dest Destination buffer (r0)
-; @param src Source buffer (r1)
-; @param length Length (r2)
-; @param const_alpha Constant alpha (r3)
-;
-;---------------------------------------------------------------------------
-comp_func_SourceOver_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- ;ldr r14, =ComponentHalf ; load 0x800080 to r14
- mov r14, #0x800000
- add r14, r14, #0x80
-
- cmp r3, #255 ; if(r3 == 255)
- bne srcovr2 ; branch if not
-
-srcovr1 BlendRow PixelSourceOver
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-srcovr2
-
-srcovr22 BlendRow PixelSourceOverConstAlpha
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-
- END ; File end
diff --git a/src/gui/painting/qpaintdevice.qdoc b/src/gui/painting/qpaintdevice.qdoc
index 38a15758c4..5290766c8e 100644
--- a/src/gui/painting/qpaintdevice.qdoc
+++ b/src/gui/painting/qpaintdevice.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
diff --git a/src/gui/painting/qprinterinfo.qdoc b/src/gui/painting/qprinterinfo.qdoc
index 7374675126..9193213bb9 100644
--- a/src/gui/painting/qprinterinfo.qdoc
+++ b/src/gui/painting/qprinterinfo.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
diff --git a/src/gui/styles/qmacstyle.qdoc b/src/gui/styles/qmacstyle.qdoc
index a86f2ed604..3efabe1c24 100644
--- a/src/gui/styles/qmacstyle.qdoc
+++ b/src/gui/styles/qmacstyle.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 89f54bc297..5ebaf4cc6c 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -837,11 +837,8 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const
s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
QApplication::setPalette(widgetPalette, "QLineEdit");
QApplication::setPalette(widgetPalette, "QTextEdit");
- widgetPalette = *palette;
-
- widgetPalette.setColor(QPalette::HighlightedText,
- s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
QApplication::setPalette(widgetPalette, "QComboBox");
+ QApplication::setPalette(widgetPalette, "QSpinBox");
widgetPalette = *palette;
widgetPalette.setColor(QPalette::WindowText, s60Color(QS60StyleEnums::CL_QsnTextColors, 7, 0));
@@ -2620,6 +2617,8 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
break;
}
+ if (!sz.isValid())
+ sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget);
return sz;
}
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index a7aa2ce282..9bf6cc810c 100644
--- a/src/gui/text/qfontdatabase_x11.cpp
+++ b/src/gui/text/qfontdatabase_x11.cpp
@@ -1891,6 +1891,18 @@ QFontEngine *QFontDatabase::loadXlfd(int screen, int script, const QFontDef &req
return fe;
}
+#if (defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6)) && defined(Q_CC_GNU) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
+#define NEEDS_GCC_BUG_WORKAROUND
+#endif
+
+#ifdef NEEDS_GCC_BUG_WORKAROUND
+static inline void gccBugWorkaround(const QFontDef &req)
+{
+ char buffer[8];
+ snprintf(buffer, 8, "%f", req.pixelSize);
+}
+#endif
+
/*! \internal
Loads a QFontEngine for the specified \a script that matches the
QFontDef \e request member variable.
@@ -1902,9 +1914,15 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
// normalize the request to get better caching
QFontDef req = d->request;
if (req.pixelSize <= 0)
- req.pixelSize = floor(qt_pixelSize(req.pointSize, d->dpi) * 100 + 0.5) / 100;
+ req.pixelSize = qFloor(qt_pixelSize(req.pointSize, d->dpi) * 100.0 + 0.5) * 0.01;
if (req.pixelSize < 1)
req.pixelSize = 1;
+
+#ifdef NEEDS_GCC_BUG_WORKAROUND
+ // req.pixelSize ends up with a bogus value unless this workaround is called
+ gccBugWorkaround(req);
+#endif
+
if (req.weight == 0)
req.weight = QFont::Normal;
if (req.stretch == 0)
@@ -1940,7 +1958,6 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
#ifndef QT_NO_FONTCONFIG
} else if (X11->has_fontconfig) {
fe = loadFc(d, script, req);
-
if (fe != 0 && fe->fontDef.pixelSize != req.pixelSize && mainThread && qt_is_gui_used) {
QFontEngine *xlfdFontEngine = loadXlfd(d->screen, script, req);
if (xlfdFontEngine->fontDef.family == fe->fontDef.family) {
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index b857e944ca..ced0d73ff0 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -2486,7 +2486,7 @@ void QComboBox::showPopup()
listRect.setWidth(listRect.height());
//by default popup is centered on screen in landscape
listRect.moveCenter(screen.center());
- if (staConTopRect.IsEmpty()) {
+ if (staConTopRect.IsEmpty() && AknLayoutUtils::CbaLocation() != AknLayoutUtils::EAknCbaLocationBottom) {
// landscape without stacon, menu should be at the right
(opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
listRect.setLeft(screen.left());
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index caaef6866e..0a33220128 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -139,7 +139,10 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
The length of the text can be constrained to maxLength(). The text
can be arbitrarily constrained using a validator() or an
- inputMask(), or both.
+ inputMask(), or both. When switching between a validator and an input mask
+ on the same line edit, it is best to clear the validator or input mask to
+ prevent undefined behavior.
+
A related class is QTextEdit which allows multi-line, rich text
editing.
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index d4118bd486..da902d5154 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -78,6 +78,7 @@ public:
: layout(0), explicitIconSize(false), toolButtonStyle(Qt::ToolButtonIconOnly)
#ifdef Q_WS_MAC
, useHIToolBar(false)
+ , activateUnifiedToolbarAfterFullScreen(false)
#endif
#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR)
, hasOldCursor(false) , cursorAdjusted(false)
@@ -89,6 +90,7 @@ public:
Qt::ToolButtonStyle toolButtonStyle;
#ifdef Q_WS_MAC
bool useHIToolBar;
+ bool activateUnifiedToolbarAfterFullScreen;
#endif
void init();
QList<int> hoverSeparator;
@@ -502,7 +504,7 @@ void QMainWindow::setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle)
*/
QMenuBar *QMainWindow::menuBar() const
{
- QMenuBar *menuBar = qobject_cast<QMenuBar *>(d_func()->layout->menuBar());
+ QMenuBar *menuBar = qobject_cast<QMenuBar *>(layout()->menuBar());
if (!menuBar) {
QMainWindow *self = const_cast<QMainWindow *>(this);
menuBar = new QMenuBar(self);
@@ -1501,8 +1503,6 @@ bool QMainWindow::event(QEvent *event)
\i Before Qt 4.5, if you called showFullScreen() on the main window, the QToolbar would
disappear since it is considered to be part of the title bar. Qt 4.5 and up will now work around this by pulling
the toolbars out and back into the regular toolbar and vice versa when you swap out.
- However, a good practice would be that turning off the unified toolbar before you call
- showFullScreen() and restoring it after you call showNormal().
\endlist
Setting this back to false will remove these restrictions.
diff --git a/src/gui/widgets/qmainwindowlayout_p.h b/src/gui/widgets/qmainwindowlayout_p.h
index e882d118e7..a37221686d 100644
--- a/src/gui/widgets/qmainwindowlayout_p.h
+++ b/src/gui/widgets/qmainwindowlayout_p.h
@@ -339,6 +339,7 @@ public:
void cleanUpMacToolbarItems();
void fixSizeInUnifiedToolbar(QToolBar *tb) const;
bool useHIToolBar;
+ bool activateUnifiedToolbarAfterFullScreen;
void syncUnifiedToolbarVisibility();
bool blockVisiblityCheck;
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index df16f7f83a..ae56fa53f4 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -1628,10 +1628,10 @@ bool QMenuBar::eventFilter(QObject *object, QEvent *event)
}
/*!
- \internal
+ Returns the QAction at \a pt. Returns 0 if there is no action at \a pt or if
+the location has a separator.
- Return the item at \a pt, or 0 if there is no item there or if it is
- a separator item.
+ \sa addAction(), addSeparator()
*/
QAction *QMenuBar::actionAt(const QPoint &pt) const
{
@@ -1640,9 +1640,9 @@ QAction *QMenuBar::actionAt(const QPoint &pt) const
}
/*!
- \internal
+ Returns the geometry of action \a act as a QRect.
- Returns the geometry of action \a act.
+ \sa actionAt()
*/
QRect QMenuBar::actionGeometry(QAction *act) const
{
@@ -1836,10 +1836,17 @@ void QMenuBarPrivate::_q_updateLayout()
}
/*!
- \internal
+ \fn void QMenuBar::setCornerWidget(QWidget *widget, Qt::Corner corner)
- This sets widget \a w to be shown directly on the left of the first or
- the right of the last menu item, depending on \a corner.
+ This sets the given \a widget to be shown directly on the left of the first
+ menu item, or on the right of the last menu item, depending on \a corner.
+
+ The menu bar takes ownership of \a widget, reparenting it into the menu bar.
+ However, if the \a corner already contains a widget, this previous widget
+ will no longer be managed and will still be a visible child of the menu bar.
+
+ \note Using a corner other than Qt::TopRightCorner or Qt::TopLeftCorner
+ will result in a warning.
*/
void QMenuBar::setCornerWidget(QWidget *w, Qt::Corner corner)
{
@@ -1869,10 +1876,11 @@ void QMenuBar::setCornerWidget(QWidget *w, Qt::Corner corner)
}
/*!
- \internal
+ Returns the widget on the left of the first or on the right of the last menu
+ item, depending on \a corner.
- Returns the widget in the left of the first or the right of the last menu
- item, depending on \a corner.
+ \note Using a corner other than Qt::TopRightCorner or Qt::TopLeftCorner
+ will result in a warning.
*/
QWidget *QMenuBar::cornerWidget(Qt::Corner corner) const
{