summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-03-23 13:36:29 +0100
committerKent Hansen <kent.hansen@nokia.com>2012-03-23 14:10:58 +0100
commit3b512ae142017f105f297467f74dc28d3cb9030a (patch)
tree9e131e23c01537f051851a1da9576c1e1ddf5ba2 /src/gui
parente20c4730192f312881591fb50e571af0a88fe421 (diff)
parentf956f9a83603a3df5651e3238c24e8df37558d6e (diff)
Merge master into api_changes
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessible.cpp17
-rw-r--r--src/gui/accessible/qaccessible.h155
-rw-r--r--src/gui/gui.pro22
-rw-r--r--src/gui/kernel/qevent.cpp2
-rw-r--r--src/gui/kernel/qevent.h4
-rw-r--r--src/gui/kernel/qguiapplication.cpp21
-rw-r--r--src/gui/kernel/qinputmethod.cpp2
-rw-r--r--src/gui/kernel/qinputmethod.h8
-rw-r--r--src/gui/kernel/qpalette.cpp1
-rw-r--r--src/gui/kernel/qscreen.cpp1
-rw-r--r--src/gui/kernel/qwindow.cpp7
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.cpp2
-rw-r--r--src/gui/painting/painting.pri5
-rw-r--r--src/gui/painting/qdrawhelper.cpp31
-rw-r--r--src/gui/painting/qdrawhelper_mips_dsp.cpp176
-rw-r--r--src/gui/painting/qdrawhelper_mips_dsp_asm.S424
-rw-r--r--src/gui/painting/qdrawhelper_mips_dsp_p.h78
-rw-r--r--src/gui/painting/qdrawhelper_mips_dspr2_asm.S95
-rw-r--r--src/gui/painting/qpaintengineex.cpp2
-rw-r--r--src/gui/painting/qpainterpath.cpp2
-rw-r--r--src/gui/painting/qpainterpath_p.h2
-rw-r--r--src/gui/painting/qstroker.cpp4
-rw-r--r--src/gui/painting/qstroker_p.h1
-rw-r--r--src/gui/painting/qt_mips_asm_dsp.h113
-rw-r--r--src/gui/text/qfont_qpa.cpp21
-rw-r--r--src/gui/text/qfontengine_ft_p.h1
26 files changed, 1134 insertions, 63 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 59794a5a06..7b1da21095 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -268,16 +268,16 @@ QT_BEGIN_NAMESPACE
row's header, has been changed.
\value TableRowHeaderChanged A table row header has been changed.
\value TableSummaryChanged The summary of a table has been changed.
- \value TextAttributeChanged
- \value TextCaretMoved The caret has moved in an editable widget.
+ \omitvalue TextAttributeChanged
+ \omitvalue TextCaretMoved The caret has moved in an editable widget.
The caret represents the cursor position in an editable
widget with the input focus.
\value TextColumnChanged A text column has been changed.
- \value TextInserted Text has been inserted into an editable widget.
- \value TextRemoved Text has been removed from an editable widget.
- \value TextSelectionChanged The selected text has changed in an editable widget.
- \value TextUpdated The text has been update in an editable widget.
- \value ValueChanged The QAccessible::Value of an object has changed.
+ \omitvalue TextInserted Text has been inserted into an editable widget.
+ \omitvalue TextRemoved Text has been removed from an editable widget.
+ \omitvalue TextSelectionChanged The selected text has changed in an editable widget.
+ \omitvalue TextUpdated The text has been update in an editable widget.
+ \omitvalue ValueChanged The QAccessible::Value of an object has changed.
\value VisibleDataChanged
The values for this enum are defined to be the same as those defined in the
@@ -648,7 +648,8 @@ void QAccessible::setRootObject(QObject *object)
void QAccessible::updateAccessibility(QObject *object, int child, Event reason)
{
Q_ASSERT(object);
- QAccessibleEvent ev(reason, object, child);
+
+ QAccessibleEvent ev(object, reason);
updateAccessibility(&ev);
}
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index 4d79fe78ee..91726f194b 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -145,7 +145,9 @@ public:
ParentChanged = 0x800F,
HelpChanged = 0x80A0,
DefaultActionChanged = 0x80B0,
- AcceleratorChanged = 0x80C0
+ AcceleratorChanged = 0x80C0,
+
+ InvalidEvent
};
// 64 bit enums seem hard on some platforms (windows...)
@@ -432,10 +434,19 @@ class Q_GUI_EXPORT QAccessibleEvent
{
Q_DISABLE_COPY(QAccessibleEvent)
public:
- inline QAccessibleEvent(QAccessible::Event typ, QObject *obj, int chld = -1)
- : m_type(typ), m_object(obj), m_child(chld)
+ inline QAccessibleEvent(QObject *obj, QAccessible::Event typ)
+ : m_type(typ), m_object(obj), m_child(-1)
{
Q_ASSERT(obj);
+ // All events below have a subclass of QAccessibleEvent.
+ // Use the subclass, since it's expected that it's possible to cast to that.
+ Q_ASSERT(m_type != QAccessible::ValueChanged);
+ Q_ASSERT(m_type != QAccessible::StateChanged);
+ Q_ASSERT(m_type != QAccessible::TextCaretMoved);
+ Q_ASSERT(m_type != QAccessible::TextSelectionChanged);
+ Q_ASSERT(m_type != QAccessible::TextInserted);
+ Q_ASSERT(m_type != QAccessible::TextRemoved);
+ Q_ASSERT(m_type != QAccessible::TextUpdated);
}
virtual ~QAccessibleEvent()
@@ -443,12 +454,13 @@ public:
QAccessible::Event type() const { return m_type; }
QObject *object() const { return m_object; }
+
+ void setChild(int chld) { m_child = chld; }
int child() const { return m_child; }
QAccessibleInterface *accessibleInterface() const;
protected:
-
QAccessible::Event m_type;
QObject *m_object;
int m_child;
@@ -457,9 +469,11 @@ protected:
class Q_GUI_EXPORT QAccessibleStateChangeEvent :public QAccessibleEvent
{
public:
- inline QAccessibleStateChangeEvent(QAccessible::State state, QObject *obj, int chld = -1)
- : QAccessibleEvent(QAccessible::StateChanged, obj, chld), m_changedStates(state)
- {}
+ inline QAccessibleStateChangeEvent(QObject *obj, QAccessible::State state)
+ : QAccessibleEvent(obj, QAccessible::InvalidEvent), m_changedStates(state)
+ {
+ m_type = QAccessible::StateChanged;
+ }
QAccessible::State changedStates() const {
return m_changedStates;
@@ -469,6 +483,133 @@ protected:
QAccessible::State m_changedStates;
};
+// Update the cursor and optionally the selection.
+class Q_GUI_EXPORT QAccessibleTextCursorEvent : public QAccessibleEvent
+{
+public:
+ inline QAccessibleTextCursorEvent(QObject *obj, int cursorPos)
+ : QAccessibleEvent(obj, QAccessible::InvalidEvent)
+ , m_cursorPosition(cursorPos)
+ {
+ m_type = QAccessible::TextCaretMoved;
+ }
+
+ void setCursorPosition(int position) { m_cursorPosition = position; }
+ int cursorPosition() const { return m_cursorPosition; }
+
+protected:
+ int m_cursorPosition;
+};
+
+// Updates the cursor position simultaneously. By default the cursor is set to the end of the selection.
+class Q_GUI_EXPORT QAccessibleTextSelectionEvent : public QAccessibleTextCursorEvent
+{
+public:
+ inline QAccessibleTextSelectionEvent(QObject *obj, int start, int end)
+ : QAccessibleTextCursorEvent(obj, (start == -1) ? 0 : end)
+ , m_selectionStart(start), m_selectionEnd(end)
+ {
+ m_type = QAccessible::TextSelectionChanged;
+ }
+
+ void setSelection(int start, int end) {
+ m_selectionStart = start;
+ m_selectionEnd = end;
+ }
+
+ int selectionStart() const { return m_selectionStart; }
+ int selectionEnd() const { return m_selectionEnd; }
+
+protected:
+ int m_selectionStart;
+ int m_selectionEnd;
+};
+
+class Q_GUI_EXPORT QAccessibleTextInsertEvent : public QAccessibleTextCursorEvent
+{
+public:
+ inline QAccessibleTextInsertEvent(QObject *obj, int position, const QString &text)
+ : QAccessibleTextCursorEvent(obj, position + text.length())
+ , m_position(position), m_text(text)
+ {
+ m_type = QAccessible::TextInserted;
+ }
+
+ QString textInserted() const {
+ return m_text;
+ }
+ int changePosition() const {
+ return m_position;
+ }
+
+protected:
+ int m_position;
+ QString m_text;
+};
+
+class Q_GUI_EXPORT QAccessibleTextRemoveEvent : public QAccessibleTextCursorEvent
+{
+public:
+ inline QAccessibleTextRemoveEvent(QObject *obj, int position, const QString &text)
+ : QAccessibleTextCursorEvent(obj, position)
+ , m_position(position), m_text(text)
+ {
+ m_type = QAccessible::TextRemoved;
+ }
+
+ QString textRemoved() const {
+ return m_text;
+ }
+ int changePosition() const {
+ return m_position;
+ }
+
+protected:
+ int m_position;
+ QString m_text;
+};
+
+class Q_GUI_EXPORT QAccessibleTextUpdateEvent : public QAccessibleTextCursorEvent
+{
+public:
+ inline QAccessibleTextUpdateEvent(QObject *obj, int position, const QString &oldText, const QString &text)
+ : QAccessibleTextCursorEvent(obj, position + text.length())
+ , m_position(position), m_oldText(oldText), m_text(text)
+ {
+ m_type = QAccessible::TextUpdated;
+ }
+ QString textRemoved() const {
+ return m_oldText;
+ }
+ QString textInserted() const {
+ return m_text;
+ }
+ int changePosition() const {
+ return m_position;
+ }
+
+protected:
+ int m_position;
+ QString m_oldText;
+ QString m_text;
+};
+
+class Q_GUI_EXPORT QAccessibleValueChangeEvent : public QAccessibleEvent
+{
+public:
+ inline QAccessibleValueChangeEvent(QObject *obj, const QVariant &val)
+ : QAccessibleEvent(obj, QAccessible::InvalidEvent)
+ , m_value(val)
+ {
+ m_type = QAccessible::ValueChanged;
+ }
+
+ void setValue(const QVariant & val) { m_value= val; }
+ QVariant value() const { return m_value; }
+
+protected:
+ QVariant m_value;
+};
#define QAccessibleInterface_iid "org.qt-project.Qt.QAccessibleInterface"
Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid)
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index e6a820b5c4..1fb3790254 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -151,4 +151,24 @@ win32:!contains(QT_CONFIG, directwrite) {
sse2: SOURCES += $$SSE2_SOURCES
ssse3: SOURCES += $$SSSE3_SOURCES
iwmmxt: SOURCES += $$IWMMXT_SOURCES
- } \ No newline at end of file
+ }
+
+mips_dsp:*-g++* {
+ DEFINES += QT_HAVE_MIPS_DSP
+ HEADERS += $$MIPS_DSP_HEADERS
+
+ DRAWHELPER_MIPS_DSP_ASM_FILES = $$MIPS_DSP_ASM
+ mips_dspr2 {
+ DEFINES += QT_HAVE_MIPS_DSPR2
+ DRAWHELPER_MIPS_DSP_ASM_FILES += $$MIPS_DSPR2_ASM
+ }
+ mips_dsp_compiler.commands = $$QMAKE_CXX -c
+ mips_dsp_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
+ mips_dsp_compiler.dependency_type = TYPE_C
+ mips_dsp_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ mips_dsp_compiler.input = DRAWHELPER_MIPS_DSP_ASM_FILES MIPS_DSP_SOURCES
+ mips_dsp_compiler.variable_out = OBJECTS
+ mips_dsp_compiler.name = compiling[mips_dsp] ${QMAKE_FILE_IN}
+ silent:mips_dsp_compiler.commands = @echo compiling[mips_dsp] ${QMAKE_FILE_IN} && $$mips_dsp_compiler.commands
+ QMAKE_EXTRA_COMPILERS += mips_dsp_compiler
+}
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 3e3db64d6f..fd674225ae 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1698,6 +1698,7 @@ void QInputMethodEvent::setCommitString(const QString &commitString, int replace
The tentative commit string is what the preedit string is expected to be committed as.
The string can be used within the editor to trigger code that reacts on text changes such as validators.
+ \deprecated
*/
void QInputMethodEvent::setTentativeCommitString(const QString &tentativeCommitString)
{
@@ -1758,6 +1759,7 @@ void QInputMethodEvent::setTentativeCommitString(const QString &tentativeCommitS
Returns the text as which preedit string is expected to be committed as.
The string can be used within the editor to trigger code that reacts on text changes such as validators.
+ \deprecated
\sa setTentativeCommitString()
*/
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index a7dce43f72..1642cd006b 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -444,7 +444,7 @@ public:
QInputMethodEvent();
QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
- void setTentativeCommitString(const QString &tentativeCommitString);
+ QT_DEPRECATED void setTentativeCommitString(const QString &tentativeCommitString);
inline const QList<Attribute> &attributes() const { return attrs; }
inline const QString &preeditString() const { return preedit; }
@@ -452,7 +452,7 @@ public:
inline const QString &commitString() const { return commit; }
inline int replacementStart() const { return replace_from; }
inline int replacementLength() const { return replace_length; }
- inline const QString &tentativeCommitString() const { return tentativeCommit; }
+ QT_DEPRECATED inline const QString &tentativeCommitString() const { return tentativeCommit; }
QInputMethodEvent(const QInputMethodEvent &other);
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 0fd18e7d2d..9b0973afb2 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -475,7 +475,6 @@ QWindow *QGuiApplication::topLevelAt(const QPoint &pos)
/*!
\property QGuiApplication::platformName
\brief The name of the underlying platform plugin.
- \since 5.0
*/
QString QGuiApplication::platformName()
@@ -503,10 +502,14 @@ static void init_platform(const QString &pluginArgument, const QString &platform
const QString defaultPlatform = QLatin1String("cocoa");
#elif defined (Q_OS_WIN)
const QString defaultPlatform = QLatin1String("windows");
+#elif defined (Q_OS_QNX)
+ const QString defaultPlatform = QLatin1String("qnx");
#elif !defined (QT_NO_XCB)
const QString defaultPlatform = QLatin1String("xcb");
#elif !defined (QT_NO_WAYLAND)
const QString defaultPlatform = QLatin1String("wayland");
+#elif !defined (QT_NO_EGLFS)
+ const QString defaultPlatform = QLatin1String("eglfs");
#else
const QString defaultPlatform = QLatin1String("minimal");
#endif
@@ -1143,14 +1146,21 @@ void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Le
void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e)
{
QWindow *previous = QGuiApplicationPrivate::focus_window;
- QGuiApplicationPrivate::focus_window = e->activated.data();
+ QWindow *newFocus = e->activated.data();
- if (previous == QGuiApplicationPrivate::focus_window)
+ if (previous == newFocus)
return;
QObject *previousFocusObject = previous ? previous->focusObject() : 0;
if (previous) {
+ QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange);
+ QCoreApplication::sendSpontaneousEvent(previous, &focusAboutToChange);
+ }
+
+ QGuiApplicationPrivate::focus_window = newFocus;
+
+ if (previous) {
QFocusEvent focusOut(QEvent::FocusOut);
QCoreApplication::sendSpontaneousEvent(previous, &focusOut);
QObject::disconnect(previous, SIGNAL(focusObjectChanged(QObject*)),
@@ -1944,8 +1954,6 @@ void QGuiApplication::restoreOverrideCursor()
#endif// QT_NO_CURSOR
/*!
- \since 5.0
-
Returns the application's style hints.
The style hints encapsulate a set of platform dependent properties
@@ -1999,8 +2007,6 @@ QInputMethod *QGuiApplication::inputMethod() const
}
/*!
- \since 5.0
-
returns the input panel.
The input panel returns properties about the state and position of
@@ -2015,7 +2021,6 @@ QInputPanel *QGuiApplication::inputPanel() const
}
/*!
- \since 4.5
\fn void QGuiApplication::fontDatabaseChanged()
This signal is emitted when application fonts are loaded or removed.
diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp
index 9e724446ff..23ab8535a0 100644
--- a/src/gui/kernel/qinputmethod.cpp
+++ b/src/gui/kernel/qinputmethod.cpp
@@ -215,7 +215,7 @@ void QInputMethod::hide()
\sa show(), hide()
*/
-bool QInputMethod::visible() const
+bool QInputMethod::isVisible() const
{
Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
diff --git a/src/gui/kernel/qinputmethod.h b/src/gui/kernel/qinputmethod.h
index 0acddc05e2..92ae016b97 100644
--- a/src/gui/kernel/qinputmethod.h
+++ b/src/gui/kernel/qinputmethod.h
@@ -62,7 +62,7 @@ class Q_GUI_EXPORT QInputMethod : public QObject
Q_PROPERTY(QObject *inputItem READ inputItem WRITE setInputItem NOTIFY inputItemChanged)
Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged)
- Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
+ Q_PROPERTY(bool visible READ isVisible NOTIFY visibleChanged)
Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged)
Q_PROPERTY(QLocale locale READ locale NOTIFY localeChanged)
Q_PROPERTY(Qt::LayoutDirection inputDirection READ inputDirection NOTIFY inputDirectionChanged)
@@ -89,7 +89,11 @@ public:
ContextMenu
};
- bool visible() const;
+#if QT_DEPRECATED_SINCE(5,0)
+ QT_DEPRECATED bool visible() const { return isVisible(); }
+#endif
+
+ bool isVisible() const;
void setVisible(bool visible);
bool isAnimating() const;
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 9a2eb12e3f..ab62ec0992 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -524,6 +524,7 @@ QPalette::QPalette()
} else {
init();
qt_palette_from_color(*this, Qt::black);
+ resolve_mask = 0;
}
}
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index 5d7ffdbc2b..ce26b9dd93 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -578,7 +578,6 @@ void QScreenPrivate::updatePrimaryOrientation()
\warning In general, grabbing an area outside the screen is not
safe. This depends on the underlying window system.
- \since 5.0
*/
QPixmap QScreen::grabWindow(WId window, int x, int y, int w, int h) const
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index ab1e8f7601..d72cc991d7 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -224,7 +224,6 @@ QWindow::SurfaceType QWindow::surfaceType() const
/*!
\property QWindow::visible
\brief whether the window is visible or not
- \since 5.0
This property controls the visibility of the window in the windowing system.
@@ -496,7 +495,6 @@ Qt::WindowType QWindow::windowType() const
/*!
\property QWindow::windowTitle
\brief the window's title in the windowing system
- \since 5.0
The window title might appear in the title area of the window decorations,
depending on the windowing system and the window flags. It might also
@@ -625,7 +623,6 @@ bool QWindow::isActive() const
/*!
\property QWindow::contentOrientation
- \since 5.0
\brief the orientation of the window's contents
This is a hint to the window manager in case it needs to display
@@ -945,25 +942,21 @@ void QWindow::setGeometry(const QRect &rect)
/*!
\property QWindow::x
- \since 5.0
\brief the x position of the window's geometry
*/
/*!
\property QWindow::y
- \since 5.0
\brief the y position of the window's geometry
*/
/*!
\property QWindow::width
- \since 5.0
\brief the width of the window's geometry
*/
/*!
\property QWindow::height
- \since 5.0
\brief the height of the window's geometry
*/
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
index fcffd75b39..bcbf96b2c0 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
@@ -226,7 +226,7 @@ void QWindowSystemInterface::handleWheelEvent(QWindow *w, const QPointF & local,
void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, const QPointF & local, const QPointF & global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods)
{
QPoint point = (o == Qt::Vertical) ? QPoint(0, d) : QPoint(d, 0);
- handleWheelEvent(tlw, timestamp, local, global, point, point, mods);
+ handleWheelEvent(tlw, timestamp, local, global, QPoint(), point, mods);
}
void QWindowSystemInterface::handleWheelEvent(QWindow *w, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods)
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 4cd2351b23..3ce2e5b258 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -109,4 +109,9 @@ NEON_SOURCES += painting/qdrawhelper_neon.cpp
NEON_HEADERS += painting/qdrawhelper_neon_p.h
NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
+MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
+MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp.h
+MIPS_DSP_ASM += painting/qdrawhelper_mips_dsp_asm.S
+MIPS_DSPR2_ASM += painting/qdrawhelper_mips_dspr2_asm.S
+
include($$PWD/../../3rdparty/zlib_dependency.pri)
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 0491a3deaf..035f56b35e 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -47,6 +47,9 @@
#include <private/qdrawhelper_arm_simd_p.h>
#endif
#include <private/qdrawhelper_neon_p.h>
+#ifdef QT_HAVE_MIPS_DSP
+#include <private/qdrawhelper_mips_dsp_p.h>
+#endif
#include <private/qmath_p.h>
#include <qmath.h>
@@ -55,18 +58,6 @@ QT_BEGIN_NAMESPACE
#define MASK(src, a) src = BYTE_MUL(src, a)
-#if defined(Q_OS_IRIX) && defined(Q_CC_GNU) && __GNUC__ == 3 && __GNUC__ < 4 && QT_POINTER_SIZE == 8
-#define Q_IRIX_GCC3_3_WORKAROUND
-//
-// work around http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14484
-//
-static uint gccBug(uint value) __attribute__((noinline));
-static uint gccBug(uint value)
-{
- return value;
-}
-#endif
-
/*
constants and structures
*/
@@ -6057,6 +6048,22 @@ void qInitDrawhelperAsm()
}
#endif
+#if defined(QT_HAVE_MIPS_DSP)
+ functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_asm_mips_dsp;
+ functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_mips_dsp;
+
+ qt_memfill32 = qt_memfill32_asm_mips_dsp;
+
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_mips_dsp;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_mips_dsp;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_mips_dsp;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_mips_dsp;
+
+ destFetchProc[QImage::Format_ARGB32] = qt_destFetchARGB32_mips_dsp;
+
+ destStoreProc[QImage::Format_ARGB32] = qt_destStoreARGB32_mips_dsp;
+
+#endif // QT_HAVE_MIPS_DSP
if (functionForModeSolidAsm) {
const int destinationMode = QPainter::CompositionMode_Destination;
functionForModeSolidAsm[destinationMode] = functionForModeSolid_C[destinationMode];
diff --git a/src/gui/painting/qdrawhelper_mips_dsp.cpp b/src/gui/painting/qdrawhelper_mips_dsp.cpp
new file mode 100644
index 0000000000..9b104eb5c9
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_mips_dsp.cpp
@@ -0,0 +1,176 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic <dtatalovic@mips.com>
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <private/qdrawhelper_p.h>
+#include <private/qdrawhelper_mips_dsp_p.h>
+#include <private/qpaintengine_raster_p.h>
+
+QT_BEGIN_NAMESPACE
+
+#if defined(QT_HAVE_MIPS_DSP)
+
+extern "C" uint INTERPOLATE_PIXEL_255_asm_mips_dsp(uint x, uint a, uint y, uint b);
+
+extern "C" uint BYTE_MUL_asm_mips_dsp(uint x, uint a);
+
+extern "C" uint * destfetchARGB32_asm_mips_dsp(uint *buffer, const uint *data, int length);
+
+extern "C" uint * qt_destStoreARGB32_asm_mips_dsp(uint *buffer, const uint *data, int length);
+
+#if defined(QT_HAVE_MIPS_DSPR2)
+
+extern "C" uint INTERPOLATE_PIXEL_255_asm_mips_dspr2(uint x, uint a, uint y, uint b);
+
+extern "C" uint BYTE_MUL_asm_mips_dspr2(uint x, uint a);
+
+#endif // QT_HAVE_MIPS_DSPR2
+
+void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+
+{
+#ifdef QT_DEBUG_DRAW
+ fprintf(stdout,
+ "qt_blend_argb32_on_argb32: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
+ destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
+ fflush(stdout);
+#endif
+
+ 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)
+#if !defined(QT_HAVE_MIPS_DSPR2)
+ dst[x] = s + BYTE_MUL_asm_mips_dsp(dst[x], qAlpha(~s));
+#else
+ dst[x] = s + BYTE_MUL_asm_mips_dspr2(dst[x], qAlpha(~s));
+#endif
+ }
+ 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) {
+#if !defined(QT_HAVE_MIPS_DSPR2)
+ uint s = BYTE_MUL_asm_mips_dsp(src[x], const_alpha);
+ dst[x] = s + BYTE_MUL_asm_mips_dsp(dst[x], qAlpha(~s));
+#else
+ uint s = BYTE_MUL_asm_mips_dspr2(src[x], const_alpha);
+ dst[x] = s + BYTE_MUL_asm_mips_dspr2(dst[x], qAlpha(~s));
+#endif
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+void qt_blend_rgb32_on_rgb32_mips_dsp(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+#ifdef QT_DEBUG_DRAW
+ fprintf(stdout,
+ "qt_blend_rgb32_on_rgb32: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
+ destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
+ fflush(stdout);
+#endif
+
+ if (const_alpha != 256) {
+ qt_blend_argb32_on_argb32_mips_dsp(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
+ return;
+ }
+
+ const uint *src = (const uint *) srcPixels;
+ uint *dst = (uint *) destPixels;
+ 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);
+ }
+}
+
+void comp_func_Source_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ ::memcpy(dest, src, length * sizeof(uint));
+ } else {
+ int ialpha = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+#if !defined(QT_HAVE_MIPS_DSPR2)
+ dest[i] = INTERPOLATE_PIXEL_255_asm_mips_dsp(src[i], const_alpha, dest[i], ialpha);
+#else
+ dest[i] = INTERPOLATE_PIXEL_255_asm_mips_dspr2(src[i], const_alpha, dest[i], ialpha);
+#endif
+ }
+ }
+}
+
+uint * QT_FASTCALL qt_destFetchARGB32_mips_dsp(uint *buffer,
+ QRasterBuffer *rasterBuffer,
+ int x, int y, int length)
+{
+ const uint *data = (const uint *)rasterBuffer->scanLine(y) + x;
+ buffer = destfetchARGB32_asm_mips_dsp(buffer, data, length);
+ return buffer;
+}
+
+void QT_FASTCALL qt_destStoreARGB32_mips_dsp(QRasterBuffer *rasterBuffer, int x, int y,
+ const uint *buffer, int length)
+{
+ uint *data = (uint *)rasterBuffer->scanLine(y) + x;
+ qt_destStoreARGB32_asm_mips_dsp(data, buffer, length);
+}
+
+#endif // QT_HAVE_MIPS_DSP
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper_mips_dsp_asm.S b/src/gui/painting/qdrawhelper_mips_dsp_asm.S
new file mode 100644
index 0000000000..f426905aad
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_mips_dsp_asm.S
@@ -0,0 +1,424 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic <dtatalovic@mips.com>
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qt_mips_asm_dsp.h"
+
+LEAF_MIPS_DSP(INTERPOLATE_PIXEL_255_asm_mips_dsp)
+/*
+ * a0 - uint x (First value to multiply)
+ * a1 - uint a (Multiplicator byte for first value)
+ * a2 - uint y (Second value to multiply)
+ * a3 - uint b (Multiplicator byte for second value)
+ */
+
+ .set reorder
+ li t4, 8388736
+ preceu.ph.qbra t0, a0 /* (x & 0xff00ff) */
+ mul t0, t0, a1 /* (x & 0xff00ff) * a */
+ preceu.ph.qbra t1, a2 /* (y & 0xff00ff) */
+ mul t1, t1, a3 /* (y & 0xff00ff) * b */
+ addu t0, t0, t1 /* (x & 0xff00ff) * a +
+ * (y & 0xff00ff) * b
+ */
+ preceu.ph.qbla t1, t0 /* (t >> 8) & 0xff00ff */
+ addu t0, t0, t1 /* t + ((t >> 8) & 0xff00ff */
+ addu t0, t0, t4 /* t + ((t >> 8) & 0xff00ff) + 0x800080 */
+ preceu.ph.qbla t0, t0 /* t >> 8 and t&=0xff00ff */
+ preceu.ph.qbla t2, a0 /* (x>>8) & 0xff00ff */
+ mul t2, t2, a1 /* ((x>>8) & 0xff00ff) * a */
+ preceu.ph.qbla t3, a2 /* ((y>>8) & 0xff00ff) */
+ mul t3, t3, a3 /* ((y>>8) & 0xff00ff) * b */
+ addu t2, t2, t3 /* ((x>>8) & 0xff00ff) * a +
+ * ((y >> 8) & 0xff00ff) * b
+ */
+ preceu.ph.qbla t3, t2 /* (x>>8) & 0xff00ff */
+ addu t2, t2, t3 /* (x>>8) & 0xff00ff) + 0x800080 */
+ addu t2, t2, t4 /* x + ((x>>8) & 0xff00ff) + 0x800080 */
+ and t2, t2, 0xff00ff00
+ or t1, t0, t2
+ move v0, t1
+ j ra
+
+END(INTERPOLATE_PIXEL_255_asm_mips_dsp)
+
+LEAF_MIPS_DSP(BYTE_MUL_asm_mips_dsp)
+/*
+ * a0 - uint x (Value to multiply)
+ * a1 - uint a (Multiplicator byte)
+ */
+
+ .set reorder
+ replv.ph a1, a1 /* a1 = 0x00a00a */
+ li t4, 8388736 /* t4 = 0x800080 */
+ muleu_s.ph.qbl t0, a0, a1
+ muleu_s.ph.qbr t2, a0, a1
+ preceu.ph.qbla t1, t0
+ addu t0, t0, t1
+ addu t0, t0, t4
+ preceu.ph.qbla t3, t2
+ addu t2, t2, t3
+ addu t2, t2, t4
+ precrq.qb.ph t4, t0, t2
+ move v0, t4
+ j ra
+
+END(BYTE_MUL_asm_mips_dsp)
+
+LEAF_MIPS_DSP(destfetchARGB32_asm_mips_dsp)
+/*
+ * a0 - buffer address (dst)
+ * a1 - data address (src)
+ * a2 - length
+ */
+
+ beqz a2, 2f
+ move v0, a0 /* just return the address of buffer
+ * for storing returning values */
+ move v0, a0
+ andi t1, a2, 0x1
+ li t7, 8388736 /* t7 = 0x800080 */
+ beqz t1, 1f
+ nop
+ lw t8, 0(a1)
+ addiu a2, a2, -1
+ srl t6, t8, 24 /* t6 = alpha */
+
+ preceu.ph.qbra t0, t8
+ mul t1, t0, t6
+ preceu.ph.qbla t4, t8
+ mul t5, t4, t6
+
+ preceu.ph.qbla t2, t1
+ addq.ph t3, t1, t2
+ addq.ph t3, t3, t7
+ preceu.ph.qbla t1, t3 /* t1 holds R & B blended with alpha
+ * | 0 | dRab | 0 | dBab | */
+ preceu.ph.qbla t2, t5
+ addq.ph t3, t2, t5
+ addq.ph t4, t3, t7
+ preceu.ph.qbla t2, t4 /* t2 holds A & G blended with alpha
+ * | 0 | dAab | 0 | dGab | */
+ andi t2, t2, 255 /* t2 = 0xff */
+
+ sll t0, t6, 24
+ sll t3, t2, 8
+ or t4, t0, t3
+ or t0, t1, t4
+ sw t0, 0(a0)
+ addiu a0, a0, 4
+ addiu a1, a1, 4
+ beqz a2, 2f /* there was only one member */
+ nop
+1:
+ lw t0, 0(a1) /* t0 = src1 */
+ lw t1, 4(a1) /* t1 = src2 */
+ precrq.qb.ph t4, t0, t1 /* t4 = a1 G1 a2 G2 */
+ preceu.ph.qbra t3, t4 /* t3 = 0 G1 0 G2 */
+ preceu.ph.qbla t2, t4 /* t2 = | 0 | a1 | 0 | a2 | */
+ srl t5, t2, 8
+ or t8, t2, t5 /* t8 = 0 a1 a1 a2 */
+ muleu_s.ph.qbr t5, t8, t3
+
+ addiu a2, a2, -2
+ addiu a1, a1, 8
+ precrq.ph.w t9, t0, t1
+ preceu.ph.qbra t9, t9
+
+ preceu.ph.qbla t6, t5
+ addq.ph t5, t5, t6
+ addq.ph t2, t5, t7
+ muleu_s.ph.qbr t6, t8, t9
+ sll t3, t1, 16
+ packrl.ph t3, t0, t3
+ preceu.ph.qbra t3, t3
+ muleu_s.ph.qbr t8, t8, t3
+ preceu.ph.qbla t3, t6
+ addq.ph t3, t6, t3
+ addq.ph t3, t3, t7
+ preceu.ph.qbla t5, t8
+ addq.ph t5, t8, t5
+ addq.ph t5, t5, t7
+
+ precrq.ph.w t0, t4, t3 /* t0 = | 0 | a1 | 0 | dR1 | */
+ precrq.ph.w t1, t2, t5 /* t1 = | 0 | dG1 | 0 | dB1 | */
+ precrq.qb.ph t6, t0, t1 /* t6 = | a1 | dR1 | dG1 | dB1 | */
+ sll t3, t3, 16
+ sll t5, t5, 16
+ packrl.ph t0, t4, t3
+ packrl.ph t1, t2, t5
+ precrq.qb.ph t8, t0, t1 /* t8 = | a2 | dR2 | dG2 | dB2 | */
+ sw t6, 0(a0)
+ sw t8, 4(a0)
+ bnez a2, 1b
+ addiu a0, a0, 8
+2:
+ j ra
+ nop
+
+END(destfetchARGB32_asm_mips_dsp)
+
+LEAF_MIPS_DSP(qt_memfill32_asm_mips_dsp)
+/*
+ * a0 - destination address (dst)
+ * a1 - value
+ * a2 - count
+ */
+
+ beqz a2, 5f
+ nop
+ li t8, 8
+ andi t0, a2, 0x7 /* t0 holds how many counts exceeds 8 */
+ beqzl t0, 2f /* count is multiple of 8 (8, 16, 24, ....) */
+ addiu a2, a2, -8
+ subu a2, a2, t0
+1:
+ sw a1, 0(a0)
+ addiu t0, t0, -1
+ bnez t0, 1b
+ addiu a0, a0, 4
+ bgeu a2, t8, 2f
+ addiu a2, a2, -8
+ b 5f
+ nop
+2:
+ beqz a2, 4f
+ nop
+3:
+ pref 30, 32(a0)
+ addiu a2, a2, -8
+ sw a1, 0( a0)
+ sw a1, 4(a0)
+ sw a1, 8(a0)
+ sw a1, 12(a0)
+ addiu a0, a0, 32
+ sw a1, -16(a0)
+ sw a1, -12(a0)
+ sw a1, -8(a0)
+ bnez a2, 3b
+ sw a1, -4(a0)
+4:
+ sw a1, 0(a0)
+ sw a1, 4(a0)
+ sw a1, 8(a0)
+ sw a1, 12(a0)
+ addiu a0, a0, 32
+ sw a1, -16(a0)
+ sw a1, -12(a0)
+ sw a1, -8(a0)
+ sw a1, -4(a0)
+5:
+ jr ra
+ nop
+
+END(qt_memfill32_asm_mips_dsp)
+
+LEAF_MIPS_DSP(comp_func_SourceOver_asm_mips_dsp)
+/*
+ * a0 - uint *dest
+ * a1 - const uint *src
+ * a2 - int length
+ * a3 - uint const_alpha
+ */
+
+ beqz a2, 5f
+ nop
+ li t8, 0xff
+ li t7, 8388736 /* t7 = 0x800080 */
+ bne a3, t8, 4f
+ nop
+
+/* part where const_alpha = 255 */
+ b 2f
+ nop
+1:
+ addiu a0, a0, 4
+ addiu a2, a2, -1
+ beqz a2, 5f
+ nop
+2:
+ lw t0, 0(a1) /* t0 = s = src[i] */
+ addiu a1, a1, 4
+ nor t1, t0, zero
+ srl t1, t1, 24 /* t1 = ~qAlpha(s) */
+ bnez t1, 3f
+ nop
+ sw t0, 0(a0) /* dst[i] = src[i] */
+ addiu a2, a2, -1
+ bnez a2, 2b
+ addiu a0, a0, 4
+ b 5f
+ nop
+3:
+ beqz t0, 1b
+ nop
+
+ lw t4, 0(a0)
+ replv.ph t6, t1
+ muleu_s.ph.qbl t2, t4, t6
+ muleu_s.ph.qbr t3, t4, t6
+ addiu a2, a2, -1
+ preceu.ph.qbla t4, t2
+ addq.ph t4, t2, t4
+ addq.ph t4, t4, t7
+ preceu.ph.qbla t5, t3
+ addq.ph t5, t5, t3
+ addq.ph t5, t5, t7
+ precrq.qb.ph t8, t4, t5 /* t8 = | dsA | dsR | dsG | dsB | */
+ addu t8, t0, t8 /* dst[i] =
+ * s + BYTE_MUL(dst[i],~qAlpha(s)) */
+ sw t8, 0(a0)
+ bnez a2, 2b
+ addiu a0, a0, 4
+ b 5f
+ nop
+4:
+ lw t0, 0(a0) /* t0 - dst[i] "1" */
+ lw t1, 0(a1) /* t1 - src[i] "2" */
+ addiu a1, a1, 4
+ addiu a2, a2, -1
+ replv.ph t6, a3 /* a1 = 0x00a00a */
+ muleu_s.ph.qbl t2, t1, t6
+ muleu_s.ph.qbr t3, t1, t6
+ preceu.ph.qbla t4, t2
+ addq.ph t4, t2, t4
+ addq.ph t4, t4, t7
+ preceu.ph.qbla t5, t3
+ addq.ph t5, t5, t3
+ addq.ph t5, t5, t7
+ precrq.qb.ph t8, t4, t5 /* t8 = | dsA | dsR | dsG | dsB | */
+
+ nor t6, t8, zero
+ srl t6, t6, 24
+ replv.ph t6, t6
+
+ muleu_s.ph.qbl t2, t0, t6
+ muleu_s.ph.qbr t3, t0, t6
+ preceu.ph.qbla t4, t2
+ addq.ph t4, t2, t4
+ addq.ph t4, t4, t7
+ preceu.ph.qbla t5, t3
+ addq.ph t5, t5, t3
+ addq.ph t5, t5, t7
+ precrq.qb.ph t6, t4, t5 /* t6 = | ddA | ddR | ddG | ddB | */
+
+ addu t0, t8, t6
+ sw t0, 0(a0)
+ bnez a2, 4b
+ addiu a0, a0, 4
+5:
+ jr ra
+ nop
+
+END(comp_func_SourceOver_asm_mips_dsp)
+
+LEAF_MIPS_DSP(qt_destStoreARGB32_asm_mips_dsp)
+/*
+ * a0 - uint * data
+ * a1 - const uint *buffer
+ * a2 - int length
+ */
+
+ blez a2, 6f
+ move v1, zero
+ li t0, 255
+ lui a3, 0xff
+ j 2f
+ lui t2, 0xff00
+1:
+ addiu v1, v1, 1
+ sw zero, 0(a0)
+ addiu a1, a1, 4
+ beq v1, a2, 6f
+ addiu a0, a0, 4
+2:
+ lw v0, 0(a1)
+ srl t3, v0, 0x18
+ beql t3, t0, 5f
+ addiu v1, v1, 1
+ beqz t3, 1b
+
+ srl t1, v0, 0x8
+ andi t1, t1, 0xff
+
+ teq t3, zero, 0x7
+ div zero, a3, t3
+ move t8, t3
+ andi t6, v0, 0xff
+
+ srl t3,v0,0x10
+ andi t3,t3,0xff
+
+ and t5, v0, t2
+ mflo t4
+
+ mult $ac0, t4, t6
+ mult $ac1, t1, t4
+ mul t4, t3, t4
+
+ sltiu t8, t8, 2
+ beqz t8, 3f
+ nop
+ mflo t6, $ac0
+ mflo t1, $ac1
+ sra t6, t6, 0x10
+ sra t1, t1, 0x8
+ b 4f
+ nop
+3:
+ extr.w t6, $ac0, 0x10
+ extr.w t1, $ac1, 0x8
+4:
+ and v0, t4, a3
+ or v0, v0, t6
+ or v0, v0, t5
+ andi t1, t1, 0xff00
+ or v0, v0, t1
+ addiu v1, v1, 1
+5:
+ sw v0, 0(a0)
+ addiu a1, a1, 4
+ bne v1, a2, 2b
+ addiu a0, a0, 4
+6:
+ jr ra
+ nop
+
+END(qt_destStoreARGB32_asm_mips_dsp)
diff --git a/src/gui/painting/qdrawhelper_mips_dsp_p.h b/src/gui/painting/qdrawhelper_mips_dsp_p.h
new file mode 100644
index 0000000000..c68a3fff9b
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_mips_dsp_p.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic <dtatalovic@mips.com>
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDRAWHELPER_MIPS_P_H
+#define QDRAWHELPER_MIPS_P_H
+
+#include <private/qdrawhelper_p.h>
+
+QT_BEGIN_NAMESPACE
+
+#if defined(QT_HAVE_MIPS_DSP)
+
+extern "C" void qt_memfill32_asm_mips_dsp(quint32 *dest, quint32 value, int count);
+
+extern "C" void comp_func_SourceOver_asm_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha);
+
+void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+void qt_blend_rgb32_on_rgb32_mips_dsp(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+void comp_func_Source_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha);
+
+uint * QT_FASTCALL qt_destFetchARGB32_mips_dsp(uint *buffer,
+ QRasterBuffer *rasterBuffer,
+ int x, int y, int length);
+
+void QT_FASTCALL qt_destStoreARGB32_mips_dsp(QRasterBuffer *rasterBuffer, int x, int y,
+ const uint *buffer, int length);
+
+#endif // QT_HAVE_MIPS_DSP
+
+QT_END_NAMESPACE
+
+#endif // QDRAWHELPER_MIPS_P_H
diff --git a/src/gui/painting/qdrawhelper_mips_dspr2_asm.S b/src/gui/painting/qdrawhelper_mips_dspr2_asm.S
new file mode 100644
index 0000000000..688d16b552
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_mips_dspr2_asm.S
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic <dtatalovic@mips.com>
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qt_mips_asm_dsp.h"
+
+LEAF_MIPS_DSPR2(INTERPOLATE_PIXEL_255_asm_mips_dspr2)
+/*
+ * a0 - uint x (First value to multiply)
+ * a1 - uint a (Multiplicator byte for first value)
+ * a2 - uint y (Second value to multiply)
+ * a3 - uint b (Multiplicator byte for second value)
+ */
+
+ .set reorder
+ replv.ph a1, a1
+ replv.ph a3, a3
+ li t8, 8388736
+ muleu_s.ph.qbl t0, a0, a1
+ muleu_s.ph.qbl t1, a2, a3
+ muleu_s.ph.qbr t2, a0, a1
+ muleu_s.ph.qbr t3, a2, a3
+ addu.ph t4, t0, t1
+ addu.ph t5, t2, t3
+ preceu.ph.qbla t0, t4
+ addu t1, t0, t8
+ addu t1, t4, t1
+ preceu.ph.qbla t6, t5
+ addu t7, t6, t8
+ addu t7, t5, t7
+ precrq.qb.ph t2, t1, t7
+ move v0, t2
+ j ra
+
+END(INTERPOLATE_PIXEL_255_asm_mips_dspr2)
+
+LEAF_MIPS_DSPR2(BYTE_MUL_asm_mips_dspr2)
+/*
+ * a0 - uint x (Value to multiply)
+ * a1 - uint a (Multiplicator byte)
+ */
+
+ .set reorder
+ replv.ph a1, a1 /* a1 = 0x00a00a */
+ li t4, 8388736 /* t4 = 0x800080 */
+ muleu_s.ph.qbl t0, a0, a1
+ muleu_s.ph.qbr t2, a0, a1
+ preceu.ph.qbla t1, t0
+ addu t0, t0, t1
+ addu t0, t0, t4
+ preceu.ph.qbla t3, t2
+ addu t2, t2, t3
+ addu t2, t2, t4
+ precrq.qb.ph t4, t0, t2
+ move v0, t4
+ j ra
+
+END(BYTE_MUL_asm_mips_dspr2)
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 36414f4774..7f9f82d00a 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -870,7 +870,7 @@ void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount)
}
} else {
for (int i=0; i<pointCount; ++i) {
- qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + 1/63., points[i].y() };
+ qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + qreal(1/63.), points[i].y() };
QVectorPath path(pts, 2, 0);
stroke(path, pen);
}
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index eb67709318..e098e7c761 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -2399,7 +2399,7 @@ QDataStream &operator>>(QDataStream &s, QPainterPath &p)
#endif
continue;
}
- QPainterPath::Element elm = { x, y, QPainterPath::ElementType(type) };
+ QPainterPath::Element elm = { qreal(x), qreal(y), QPainterPath::ElementType(type) };
p.d_func()->elements.append(elm);
}
s >> p.d_func()->cStart;
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h
index 23e8332f19..a9068f3855 100644
--- a/src/gui/painting/qpainterpath_p.h
+++ b/src/gui/painting/qpainterpath_p.h
@@ -268,7 +268,7 @@ inline void QPainterPathData::maybeMoveTo()
}
}
-#define KAPPA 0.5522847498
+#define KAPPA qreal(0.5522847498)
QT_END_NAMESPACE
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index 1201a481b6..c135adc63f 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -1028,6 +1028,10 @@ QDashStroker::QDashStroker(QStroker *stroker)
}
}
+QDashStroker::~QDashStroker()
+{
+}
+
QVector<qfixed> QDashStroker::patternForStyle(Qt::PenStyle style)
{
const qfixed space = 2;
diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h
index 30953d304b..29d497e90b 100644
--- a/src/gui/painting/qstroker_p.h
+++ b/src/gui/painting/qstroker_p.h
@@ -254,6 +254,7 @@ class Q_GUI_EXPORT QDashStroker : public QStrokerOps
{
public:
QDashStroker(QStroker *stroker);
+ ~QDashStroker();
QStroker *stroker() const { return m_stroker; }
diff --git a/src/gui/painting/qt_mips_asm_dsp.h b/src/gui/painting/qt_mips_asm_dsp.h
new file mode 100644
index 0000000000..bcde7068a2
--- /dev/null
+++ b/src/gui/painting/qt_mips_asm_dsp.h
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic <dtatalovic@mips.com>
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT_MIPS_DSP_H__
+#define QT_MIPS_DSP_H__
+
+#define zero $0
+#define AT $1
+#define v0 $2
+#define v1 $3
+#define a0 $4
+#define a1 $5
+#define a2 $6
+#define a3 $7
+#define t0 $8
+#define t1 $9
+#define t2 $10
+#define t3 $11
+#define t4 $12
+#define t5 $13
+#define t6 $14
+#define t7 $15
+#define s0 $16
+#define s1 $17
+#define s2 $18
+#define s3 $19
+#define s4 $20
+#define s5 $21
+#define s6 $22
+#define s7 $23
+#define t8 $24
+#define t9 $25
+#define k0 $26
+#define k1 $27
+#define gp $28
+#define sp $29
+#define fp $30
+#define s8 $30
+#define ra $31
+
+/*
+ * LEAF_MIPS32R2 - declare leaf_mips32r2 routine
+ */
+#define LEAF_MIPS32R2(symbol) \
+ .globl symbol; \
+ .align 2; \
+ .type symbol,@function; \
+ .ent symbol,0; \
+symbol: .frame sp, 0, ra; \
+ .set arch=mips32r2; \
+ .set noreorder;
+
+/*
+ * LEAF_MIPS_DSP - declare leaf_mips_dsp routine
+ */
+#define LEAF_MIPS_DSP(symbol) \
+LEAF_MIPS32R2(symbol) \
+ .set dsp;
+
+/*
+ * LEAF_MIPS_DSPR2 - declare leaf_mips_dspr2 routine
+ */
+#define LEAF_MIPS_DSPR2(symbol) \
+LEAF_MIPS32R2(symbol) \
+ .set dspr2;
+
+/*
+ * END - mark end of function
+ */
+#define END(function) \
+ .set reorder; \
+ .end function; \
+ .size function,.-function
+
+#endif //QT_MIPS_DSP_H__
diff --git a/src/gui/text/qfont_qpa.cpp b/src/gui/text/qfont_qpa.cpp
index 29ba7767bc..6576f237c4 100644
--- a/src/gui/text/qfont_qpa.cpp
+++ b/src/gui/text/qfont_qpa.cpp
@@ -77,28 +77,29 @@ QString QFont::defaultFamily() const
{
QString familyName;
switch(d->request.styleHint) {
- case QFont::Times:
- familyName = QString::fromLatin1("Times");
+ case QFont::SansSerif:
+ familyName = QString::fromLatin1("sans-serif");
break;
- case QFont::Courier:
- familyName = QString::fromLatin1("Courier");
+ case QFont::Serif:
+ familyName = QString::fromLatin1("serif");
break;
+ case QFont::TypeWriter:
case QFont::Monospace:
- familyName = QString::fromLatin1("Courier New");
+ familyName = QString::fromLatin1("monospace");
break;
case QFont::Cursive:
- familyName = QString::fromLatin1("Comic Sans MS");
+ familyName = QString::fromLatin1("cursive");
break;
case QFont::Fantasy:
- familyName = QString::fromLatin1("Impact");
+ familyName = QString::fromLatin1("fantasy");
break;
case QFont::Decorative:
- familyName = QString::fromLatin1("Old English");
+ familyName = QString::fromLatin1("decorative");
break;
- case QFont::Helvetica:
case QFont::System:
default:
- familyName = QString::fromLatin1("Helvetica");
+ familyName = QString();
+ break;
}
return QGuiApplicationPrivate::platformIntegration()->fontDatabase()->resolveFontFamilyAlias(familyName);
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 83b51685c0..2add894c19 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -364,6 +364,7 @@ inline QFontEngineFT::Glyph *QFontEngineFT::QGlyphSet::getGlyph(glyph_t index, Q
return glyph_data.value(GlyphAndSubPixelPosition(index, subPixelPosition));
}
+extern Q_GUI_EXPORT FT_Library qt_getFreetype();
QT_END_NAMESPACE