summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-09-07 12:31:14 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-09-07 12:31:14 (GMT)
commit30cf45cf53e030158fef4dfb262e7444332d3138 (patch)
tree3bfe9133feb8d1505b6e394e791a348cdf4d475f /src/gui
parentd52f0887a740d147a74c3e38ae587f688fbf896a (diff)
parent3505c6cdcdfac5a6d0f4b94dbdbcc8ad72f8048a (diff)
downloadQt-30cf45cf53e030158fef4dfb262e7444332d3138.zip
Qt-30cf45cf53e030158fef4dfb262e7444332d3138.tar.gz
Qt-30cf45cf53e030158fef4dfb262e7444332d3138.tar.bz2
Merge branch '4.7-oslo1' into 4.7-doc
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qpixmap_s60.cpp43
-rw-r--r--src/gui/image/qpixmap_s60_p.h12
-rw-r--r--src/gui/kernel/qapplication_x11.cpp7
-rw-r--r--src/gui/kernel/qcocoasharedwindowmethods_mac_p.h6
-rw-r--r--src/gui/kernel/qgesturemanager.cpp3
-rw-r--r--src/gui/kernel/qgesturemanager_p.h4
-rw-r--r--src/gui/painting/qdrawhelper.cpp421
-rw-r--r--src/gui/painting/qdrawhelper_p.h35
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp72
-rw-r--r--src/gui/painting/qdrawhelper_x86_p.h3
-rw-r--r--src/gui/styles/qs60style.cpp20
-rw-r--r--src/gui/styles/qs60style_p.h1
-rw-r--r--src/gui/styles/qs60style_s60.cpp6
-rw-r--r--src/gui/text/qstatictext.cpp6
-rw-r--r--src/gui/text/qtextengine.cpp4
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp1
16 files changed, 333 insertions, 311 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 9d571b5..dbdf0bc 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -63,6 +63,42 @@ QT_BEGIN_NAMESPACE
const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08,
0x10, 0x20, 0x40, 0x80 };
+static bool cleanup_function_registered = false;
+static QS60PixmapData *firstPixmap = 0;
+
+static void qt_symbian_register_pixmap(QS60PixmapData *pd)
+{
+ if(!cleanup_function_registered) {
+ qAddPostRoutine(qt_symbian_release_pixmaps);
+ cleanup_function_registered = true;
+ }
+
+ pd->next = firstPixmap;
+ pd->prev = 0;
+ if (firstPixmap)
+ firstPixmap->prev = pd;
+ firstPixmap = pd;
+}
+
+static void qt_symbian_unregister_pixmap(QS60PixmapData *pd)
+{
+ if (pd->next)
+ pd->next->prev = pd->prev;
+ if (pd->prev)
+ pd->prev->next = pd->next;
+ else
+ firstPixmap = pd->next;
+}
+
+static void qt_symbian_release_pixmaps()
+{
+ // Scan all QS60PixmapData objects in the system and destroy them.
+ QS60PixmapData *pd = firstPixmap;
+ while (pd != 0) {
+ pd->release();
+ pd = pd->next;
+ }
+}
/*
\class QSymbianFbsClient
@@ -356,15 +392,18 @@ QS60PixmapData::QS60PixmapData(PixelType type) : QRasterPixmapData(type),
cfbsBitmap(0),
pengine(0),
bytes(0),
- formatLocked(false)
+ formatLocked(false),
+ next(0),
+ prev(0)
{
-
+ qt_symbian_register_pixmap(this);
}
QS60PixmapData::~QS60PixmapData()
{
release();
delete symbianBitmapDataAccess;
+ qt_symbian_unregister_pixmap(this);
}
void QS60PixmapData::resize(int width, int height)
diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h
index 85c9ebe..a82f5c2 100644
--- a/src/gui/image/qpixmap_s60_p.h
+++ b/src/gui/image/qpixmap_s60_p.h
@@ -63,6 +63,11 @@ class CFbsBitGc;
class QSymbianBitmapDataAccess;
+class QS60PixmapData;
+void qt_symbian_register_pixmap(QS60PixmapData *pd);
+void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
+void qt_symbian_release_pixmaps();
+
class QSymbianFbsHeapLock
{
public:
@@ -120,6 +125,13 @@ private:
bool formatLocked;
+ QS60PixmapData *next;
+ QS60PixmapData *prev;
+
+ friend void qt_symbian_register_pixmap(QS60PixmapData *pd);
+ friend void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
+ friend void qt_symbian_release_pixmaps();
+
friend class QPixmap;
friend class QS60WindowSurface;
friend class QS60PaintEngine;
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index e4d9848..7495f6d 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -3642,6 +3642,11 @@ int QApplication::x11ProcessEvent(XEvent* event)
case MapNotify: // window shown
if (widget->isWindow()) {
+ // if we got a MapNotify when we were not waiting for it, it most
+ // likely means the user has already asked to hide the window before
+ // it ever being shown, so we try to withdraw a window after sending
+ // the QShowEvent.
+ bool pendingHide = widget->testAttribute(Qt::WA_WState_ExplicitShowHide) && widget->testAttribute(Qt::WA_WState_Hidden);
widget->d_func()->topData()->waitingForMapNotify = 0;
if (widget->windowType() != Qt::Popup) {
@@ -3661,6 +3666,8 @@ int QApplication::x11ProcessEvent(XEvent* event)
widget->setAttribute(Qt::WA_WState_Visible, true);
}
}
+ if (pendingHide) // hide the window
+ XWithdrawWindow(X11->display, widget->internalWinId(), widget->x11Info().screen());
}
break;
diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
index 16f5bd6..ddf1a27 100644
--- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
+++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
@@ -234,8 +234,10 @@ QT_END_NAMESPACE
// This method is called the first time the window is placed on screen and
// is the earliest point in time we can connect OpenGL contexts to NSViews.
QWidget *qwidget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self];
- qt_event_request_window_change(qwidget);
- qt_mac_send_posted_gl_updates(qwidget);
+ if (qwidget) {
+ qt_event_request_window_change(qwidget);
+ qt_mac_send_posted_gl_updates(qwidget);
+ }
[super setInitialFirstResponder:view];
}
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 570d7a5..f50dbbd 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -162,7 +162,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
QMap<ObjectGesture, QList<QGesture *> >::Iterator iter = m_objectGestures.begin();
while (iter != m_objectGestures.end()) {
ObjectGesture objectGesture = iter.key();
- if (objectGesture.gesture == type && target == objectGesture.object.data()) {
+ if (objectGesture.gesture == type && target == objectGesture.object) {
QSet<QGesture *> gestures = iter.value().toSet();
for (QHash<QGestureRecognizer *, QSet<QGesture *> >::iterator
it = m_obsoleteGestures.begin(), e = m_obsoleteGestures.end(); it != e; ++it) {
@@ -172,6 +172,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
m_deletedRecognizers.remove(g);
m_gestureToRecognizer.remove(g);
}
+
qDeleteAll(gestures);
iter = m_objectGestures.erase(iter);
} else {
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h
index 747cb1a..0d84b67 100644
--- a/src/gui/kernel/qgesturemanager_p.h
+++ b/src/gui/kernel/qgesturemanager_p.h
@@ -106,13 +106,13 @@ private:
struct ObjectGesture
{
- QWeakPointer<QObject> object;
+ QObject* object;
Qt::GestureType gesture;
ObjectGesture(QObject *o, const Qt::GestureType &g) : object(o), gesture(g) { }
inline bool operator<(const ObjectGesture &rhs) const
{
- if (object.data() < rhs.object.data())
+ if (object < rhs.object)
return true;
if (object == rhs.object)
return gesture < rhs.gesture;
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 5e1509d..03ed597 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -684,8 +684,8 @@ Q_STATIC_TEMPLATE_FUNCTION inline void fetchTransformedBilinear_pixelBounds(int
} else {
if (v1 < l1) {
v2 = v1 = l1;
- } else if (v1 >= l2 - 1) {
- v2 = v1 = l2 - 1;
+ } else if (v1 >= l2) {
+ v2 = v1 = l2;
} else {
v2 = v1 + 1;
}
@@ -715,8 +715,8 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
int image_x1 = data->texture.x1;
int image_y1 = data->texture.y1;
- int image_x2 = data->texture.x2;
- int image_y2 = data->texture.y2;
+ int image_x2 = data->texture.x2 - 1;
+ int image_y2 = data->texture.y2 - 1;
const qreal cx = x + 0.5;
const qreal cy = y + 0.5;
@@ -763,9 +763,9 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
x %= image_width;
if (x < 0) x += image_width;
} else {
- lim = qMin(count, image_x2-x);
+ lim = qMin(count, image_x2-x+1);
if (x < image_x1) {
- Q_ASSERT(x < image_x2);
+ Q_ASSERT(x <= image_x2);
uint t = fetch(s1, image_x1, data->texture.colorTable);
uint b = fetch(s2, image_x1, data->texture.colorTable);
quint32 rb = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
@@ -818,7 +818,7 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
if (blendType == BlendTransformedBilinearTiled) {
if (x >= image_width) x -= image_width;
} else {
- x = qMin(x, image_x2 - 1);
+ x = qMin(x, image_x2);
}
uint t = fetch(s1, x, data->texture.colorTable);
@@ -1485,7 +1485,7 @@ static const uint L2CacheLineLengthInInts = L2CacheLineLength/sizeof(uint);
}\
}
-static void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint const_alpha)
{
comp_func_Clear_impl(dest, length, const_alpha);
}
@@ -1499,7 +1499,7 @@ void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint cons
result = s
dest = s * ca + d * cia
*/
-static void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255) {
QT_MEMFILL_UINT(dest, length, color);
@@ -1528,7 +1528,7 @@ void QT_FASTCALL comp_func_Source(uint *dest, const uint *src, int length, uint
}
}
-static void QT_FASTCALL comp_func_solid_Destination(uint *, int, uint, uint)
+void QT_FASTCALL comp_func_solid_Destination(uint *, int, uint, uint)
{
}
@@ -1542,7 +1542,7 @@ void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint)
= s * ca + d * (sia * ca + cia)
= s * ca + d * (1 - sa*ca)
*/
-static void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint color, uint const_alpha)
{
if ((const_alpha & qAlpha(color)) == 255) {
QT_MEMFILL_UINT(dest, length, color);
@@ -1583,7 +1583,7 @@ void QT_FASTCALL comp_func_SourceOver(uint *dest, const uint *src, int length, u
dest = (d + s * dia) * ca + d * cia
= d + s * dia * ca
*/
-static void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha != 255)
color = BYTE_MUL(color, const_alpha);
@@ -1618,7 +1618,7 @@ void QT_FASTCALL comp_func_DestinationOver(uint *dest, const uint *src, int leng
result = s * da
dest = s * da * ca + d * cia
*/
-static void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha)
{
PRELOAD_INIT(dest)
if (const_alpha == 255) {
@@ -1661,7 +1661,7 @@ void QT_FASTCALL comp_func_SourceIn(uint *dest, const uint *src, int length, uin
dest = d * sa * ca + d * cia
= d * (sa * ca + cia)
*/
-static void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, uint color, uint const_alpha)
{
uint a = qAlpha(color);
if (const_alpha != 255) {
@@ -1697,7 +1697,7 @@ void QT_FASTCALL comp_func_DestinationIn(uint *dest, const uint *src, int length
dest = s * dia * ca + d * cia
*/
-static void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha)
{
PRELOAD_INIT(dest)
if (const_alpha == 255) {
@@ -1740,7 +1740,7 @@ void QT_FASTCALL comp_func_SourceOut(uint *dest, const uint *src, int length, ui
dest = d * sia * ca + d * cia
= d * (sia * ca + cia)
*/
-static void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, uint color, uint const_alpha)
{
uint a = qAlpha(~color);
if (const_alpha != 255)
@@ -1776,7 +1776,7 @@ void QT_FASTCALL comp_func_DestinationOut(uint *dest, const uint *src, int lengt
= s*ca * da + d * (sia*ca + cia)
= s*ca * da + d * (1 - sa*ca)
*/
-static void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha != 255) {
color = BYTE_MUL(color, const_alpha);
@@ -1814,7 +1814,7 @@ void QT_FASTCALL comp_func_SourceAtop(uint *dest, const uint *src, int length, u
dest = d*sa*ca + s*dia*ca + d *cia
= s*ca * dia + d * (sa*ca + cia)
*/
-static void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length, uint color, uint const_alpha)
{
uint a = qAlpha(color);
if (const_alpha != 255) {
@@ -1857,7 +1857,7 @@ void QT_FASTCALL comp_func_DestinationAtop(uint *dest, const uint *src, int leng
= s*ca * dia + d * (sia*ca + cia)
= s*ca * dia + d * (1 - sa*ca)
*/
-static void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha != 255)
color = BYTE_MUL(color, const_alpha);
@@ -1938,7 +1938,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Plus_impl(uint *dest, int
}
}
-static void QT_FASTCALL comp_func_solid_Plus(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Plus(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_Plus_impl(dest, length, color, QFullCoverage());
@@ -2002,7 +2002,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Multiply_impl(uint *dest,
}
}
-static void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
@@ -2070,7 +2070,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Screen_impl(uint *dest, i
}
}
-static void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
@@ -2149,7 +2149,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Overlay_impl(uint *dest,
}
}
-static void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
@@ -2222,7 +2222,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Darken_impl(uint *dest, i
}
}
-static void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
@@ -2295,7 +2295,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Lighten_impl(uint *dest,
}
}
-static void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
@@ -2378,7 +2378,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorDodge_impl(uint *des
}
}
-static void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
@@ -2461,7 +2461,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorBurn_impl(uint *dest
}
}
-static void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
@@ -2541,7 +2541,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_HardLight_impl(uint *dest
}
}
-static void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
@@ -2632,7 +2632,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_SoftLight_impl(uint *dest
}
}
-static void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
@@ -2705,7 +2705,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Difference_impl(uint *des
}
}
-static void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
@@ -2772,7 +2772,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void QT_FASTCALL comp_func_solid_Exclusion_imp
}
}
-static void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha)
+void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
@@ -2816,10 +2816,10 @@ void QT_FASTCALL comp_func_Exclusion(uint *dest, const uint *src, int length, ui
# pragma pop
#endif
-static void QT_FASTCALL rasterop_solid_SourceOrDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
+void QT_FASTCALL rasterop_solid_SourceOrDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
{
Q_UNUSED(const_alpha);
while (length--)
@@ -2836,10 +2836,10 @@ void QT_FASTCALL rasterop_SourceOrDestination(uint *dest,
*dest++ |= *src++;
}
-static void QT_FASTCALL rasterop_solid_SourceAndDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
+void QT_FASTCALL rasterop_solid_SourceAndDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
{
Q_UNUSED(const_alpha);
color |= 0xff000000;
@@ -2859,10 +2859,10 @@ void QT_FASTCALL rasterop_SourceAndDestination(uint *dest,
}
}
-static void QT_FASTCALL rasterop_solid_SourceXorDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
+void QT_FASTCALL rasterop_solid_SourceXorDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
{
Q_UNUSED(const_alpha);
color &= 0x00ffffff;
@@ -2882,10 +2882,10 @@ void QT_FASTCALL rasterop_SourceXorDestination(uint *dest,
}
}
-static void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
+void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
{
Q_UNUSED(const_alpha);
color = ~color;
@@ -2907,10 +2907,10 @@ void QT_FASTCALL rasterop_NotSourceAndNotDestination(uint *dest,
}
}
-static void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
+void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
{
Q_UNUSED(const_alpha);
color = ~color | 0xff000000;
@@ -2932,10 +2932,10 @@ void QT_FASTCALL rasterop_NotSourceOrNotDestination(uint *dest,
}
}
-static void QT_FASTCALL rasterop_solid_NotSourceXorDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
+void QT_FASTCALL rasterop_solid_NotSourceXorDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
{
Q_UNUSED(const_alpha);
color = ~color & 0x00ffffff;
@@ -2957,8 +2957,8 @@ void QT_FASTCALL rasterop_NotSourceXorDestination(uint *dest,
}
}
-static void QT_FASTCALL rasterop_solid_NotSource(uint *dest, int length,
- uint color, uint const_alpha)
+void QT_FASTCALL rasterop_solid_NotSource(uint *dest, int length,
+ uint color, uint const_alpha)
{
Q_UNUSED(const_alpha);
qt_memfill(dest, ~color | 0xff000000, length);
@@ -2972,10 +2972,10 @@ void QT_FASTCALL rasterop_NotSource(uint *dest, const uint *src,
*dest++ = ~(*src++) | 0xff000000;
}
-static void QT_FASTCALL rasterop_solid_NotSourceAndDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
+void QT_FASTCALL rasterop_solid_NotSourceAndDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
{
Q_UNUSED(const_alpha);
color = ~color | 0xff000000;
@@ -2997,10 +2997,10 @@ void QT_FASTCALL rasterop_NotSourceAndDestination(uint *dest,
}
}
-static void QT_FASTCALL rasterop_solid_SourceAndNotDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
+void QT_FASTCALL rasterop_solid_SourceAndNotDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
{
Q_UNUSED(const_alpha);
while (length--) {
@@ -5335,181 +5335,6 @@ static void blend_tiled_rgb444(int count, const QSpan *spans, void *userData)
blend_tiled_generic<RegularSpans>(count, spans, userData);
}
-
-template <SpanMethod spanMethod, TextureBlendType blendType> /* blendType must be either BlendTransformedBilinear or BlendTransformedBilinearTiled */
-Q_STATIC_TEMPLATE_FUNCTION void blend_transformed_bilinear_argb(int count, const QSpan *spans, void *userData)
-{
- QSpanData *data = reinterpret_cast<QSpanData *>(userData);
- if (data->texture.format != QImage::Format_ARGB32_Premultiplied
- && data->texture.format != QImage::Format_RGB32) {
- blend_src_generic<spanMethod>(count, spans, userData);
- return;
- }
-
- CompositionFunction func = functionForMode[data->rasterBuffer->compositionMode];
- uint buffer[buffer_size];
-
- const int image_x1 = data->texture.x1;
- const int image_y1 = data->texture.y1;
- const int image_x2 = data->texture.x2;
- const int image_y2 = data->texture.y2;
- const int image_width = data->texture.width;
- const int image_height = data->texture.height;
- const int scanline_offset = data->texture.bytesPerLine / 4;
-
- if (data->fast_matrix) {
- // The increment pr x in the scanline
- int fdx = (int)(data->m11 * fixed_scale);
- int fdy = (int)(data->m12 * fixed_scale);
-
- while (count--) {
- void *t = data->rasterBuffer->scanLine(spans->y);
-
- uint *target = ((uint *)t) + spans->x;
- uint *image_bits = (uint *)data->texture.imageData;
-
- const qreal cx = spans->x + 0.5;
- const qreal cy = spans->y + 0.5;
-
- int x = int((data->m21 * cy
- + data->m11 * cx + data->dx) * fixed_scale) - half_point;
- int y = int((data->m22 * cy
- + data->m12 * cx + data->dy) * fixed_scale) - half_point;
-
- int length = spans->len;
- const int coverage = (data->texture.const_alpha * spans->coverage) >> 8;
- while (length) {
- int l = qMin(length, buffer_size);
- const uint *end = buffer + l;
- uint *b = buffer;
- while (b < end) {
- int x1 = (x >> 16);
- int x2;
- int y1 = (y >> 16);
- int y2;
-
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
-
- int y1_offset = y1 * scanline_offset;
- int y2_offset = y2 * scanline_offset;
-
-#if defined(Q_IRIX_GCC3_3_WORKAROUND)
- uint tl = gccBug(image_bits[y1_offset + x1]);
- uint tr = gccBug(image_bits[y1_offset + x2]);
- uint bl = gccBug(image_bits[y2_offset + x1]);
- uint br = gccBug(image_bits[y2_offset + x2]);
-#else
- uint tl = image_bits[y1_offset + x1];
- uint tr = image_bits[y1_offset + x2];
- uint bl = image_bits[y2_offset + x1];
- uint br = image_bits[y2_offset + x2];
-#endif
-
- int distx = (x & 0x0000ffff) >> 8;
- int disty = (y & 0x0000ffff) >> 8;
- int idistx = 256 - distx;
- int idisty = 256 - disty;
-
- uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx);
- uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx);
- *b = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty);
- ++b;
-
- x += fdx;
- y += fdy;
- }
- if (spanMethod == RegularSpans)
- func(target, buffer, l, coverage);
- else
- drawBufferSpan(data, buffer, buffer_size,
- spans->x + spans->len - length,
- spans->y, l, coverage);
- target += l;
- length -= l;
- }
- ++spans;
- }
- } else {
- const qreal fdx = data->m11;
- const qreal fdy = data->m12;
- const qreal fdw = data->m13;
-
- while (count--) {
- void *t = data->rasterBuffer->scanLine(spans->y);
-
- uint *target = ((uint *)t) + spans->x;
- uint *image_bits = (uint *)data->texture.imageData;
-
- const qreal cx = spans->x + 0.5;
- const qreal cy = spans->y + 0.5;
-
- qreal x = data->m21 * cy + data->m11 * cx + data->dx;
- qreal y = data->m22 * cy + data->m12 * cx + data->dy;
- qreal w = data->m23 * cy + data->m13 * cx + data->m33;
-
- int length = spans->len;
- const int coverage = (data->texture.const_alpha * spans->coverage) >> 8;
- while (length) {
- int l = qMin(length, buffer_size);
- const uint *end = buffer + l;
- uint *b = buffer;
- while (b < end) {
- const qreal iw = w == 0 ? 1 : 1 / w;
- const qreal px = x * iw - 0.5;
- const qreal py = y * iw - 0.5;
-
- int x1 = int(px) - (px < 0);
- int x2;
- int y1 = int(py) - (py < 0);
- int y2;
-
- int distx = int((px - x1) * 256);
- int disty = int((py - y1) * 256);
- int idistx = 256 - distx;
- int idisty = 256 - disty;
-
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
-
- int y1_offset = y1 * scanline_offset;
- int y2_offset = y2 * scanline_offset;
-
-#if defined(Q_IRIX_GCC3_3_WORKAROUND)
- uint tl = gccBug(image_bits[y1_offset + x1]);
- uint tr = gccBug(image_bits[y1_offset + x2]);
- uint bl = gccBug(image_bits[y2_offset + x1]);
- uint br = gccBug(image_bits[y2_offset + x2]);
-#else
- uint tl = image_bits[y1_offset + x1];
- uint tr = image_bits[y1_offset + x2];
- uint bl = image_bits[y2_offset + x1];
- uint br = image_bits[y2_offset + x2];
-#endif
-
- uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx);
- uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx);
- *b = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty);
- ++b;
-
- x += fdx;
- y += fdy;
- w += fdw;
- }
- if (spanMethod == RegularSpans)
- func(target, buffer, l, coverage);
- else
- drawBufferSpan(data, buffer, buffer_size,
- spans->x + spans->len - length,
- spans->y, l, coverage);
- target += l;
- length -= l;
- }
- ++spans;
- }
- }
-}
-
template <class DST, class SRC>
Q_STATIC_TEMPLATE_FUNCTION void blendTransformedBilinear(int count, const QSpan *spans,
void *userData)
@@ -6760,7 +6585,7 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // Indexed8
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // RGB32
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB32
- blend_transformed_bilinear_argb<RegularSpans, BlendTransformedBilinear>, // ARGB32_Premultiplied
+ SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB32_Premultiplied
blend_transformed_bilinear_rgb565,
blend_transformed_bilinear_argb8565,
blend_transformed_bilinear_rgb666,
@@ -6779,7 +6604,7 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // Indexed8
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // RGB32
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB32
- blend_transformed_bilinear_argb<RegularSpans, BlendTransformedBilinearTiled>, // ARGB32_Premultiplied
+ SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB32_Premultiplied
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // RGB16
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // ARGB8565_Premultiplied
SPANFUNC_POINTER(blend_src_generic, RegularSpans), // RGB666
@@ -6878,7 +6703,7 @@ static const ProcessSpans processTextureSpansCallback[NBlendTypes][QImage::NImag
blend_src_generic<CallbackSpans>, // Indexed8
blend_src_generic<CallbackSpans>, // RGB32
blend_src_generic<CallbackSpans>, // ARGB32
- blend_transformed_bilinear_argb<CallbackSpans, BlendTransformedBilinear>, // ARGB32_Premultiplied
+ blend_src_generic<CallbackSpans>, // ARGB32_Premultiplied
blend_src_generic<CallbackSpans>, // RGB16
blend_src_generic<CallbackSpans>, // ARGB8565_Premultiplied
blend_src_generic<CallbackSpans>, // RGB666
@@ -6897,7 +6722,7 @@ static const ProcessSpans processTextureSpansCallback[NBlendTypes][QImage::NImag
blend_src_generic<CallbackSpans>, // Indexed8
blend_src_generic<CallbackSpans>, // RGB32
blend_src_generic<CallbackSpans>, // ARGB32
- blend_transformed_bilinear_argb<CallbackSpans, BlendTransformedBilinearTiled>, // ARGB32_Premultiplied
+ blend_src_generic<CallbackSpans>, // ARGB32_Premultiplied
blend_src_generic<CallbackSpans>, // RGB16
blend_src_generic<CallbackSpans>, // ARGB8565_Premultiplied
blend_src_generic<CallbackSpans>, // RGB666
@@ -7914,6 +7739,55 @@ void qInitDrawhelperAsm()
#ifdef QT_HAVE_SSE
if (features & SSE) {
+ extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+ extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
+ }
+#endif // SSE
+
+#ifdef QT_HAVE_SSE2
+ if (features & SSE2) {
+ extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+ extern void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
+ }
+
+#ifdef QT_HAVE_SSSE3
+ if (features & SSSE3) {
+ extern void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;
+ }
+#endif // SSSE3
+
+#endif // SSE2
+
+#ifdef QT_HAVE_SSE
+ if (features & SSE) {
functionForModeAsm = qt_functionForMode_SSE;
functionForModeSolidAsm = qt_functionForModeSolid_SSE;
qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_sse;
@@ -7929,9 +7803,9 @@ void qInitDrawhelperAsm()
#ifdef QT_HAVE_SSE2
if (features & SSE2) {
extern void QT_FASTCALL comp_func_SourceOver_sse2(uint *destPixels,
- const uint *srcPixels,
- int length,
- uint const_alpha);
+ const uint *srcPixels,
+ int length,
+ uint const_alpha);
extern void QT_FASTCALL comp_func_solid_SourceOver_sse2(uint *destPixels, int length, uint color, uint const_alpha);
extern void QT_FASTCALL comp_func_Plus_sse2(uint *dst, const uint *src, int length, uint const_alpha);
extern void QT_FASTCALL comp_func_Source_sse2(uint *dst, const uint *src, int length, uint const_alpha);
@@ -7940,51 +7814,16 @@ void qInitDrawhelperAsm()
functionForModeAsm[QPainter::CompositionMode_Source] = comp_func_Source_sse2;
functionForModeAsm[QPainter::CompositionMode_Plus] = comp_func_Plus_sse2;
functionForModeSolidAsm[0] = comp_func_solid_SourceOver_sse2;
-
- extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
- extern void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
-
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
-
-#if defined(QT_HAVE_SSSE3)
- if (features & SSSE3) {
- extern void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;
- }
-#endif // QT_HAVE_SSSE3
- } else
-#endif
- {
- extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
- extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
-
-
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
}
-}
-#endif // SSE
+#endif
+ }
+#elif defined(QT_HAVE_SSE2)
+ // this is the special case when SSE2 is usable but MMX/SSE is not usable (e.g.: Windows x64 + visual studio)
+ if (features & SSE2) {
+ functionForModeAsm = qt_functionForMode_onlySSE2;
+ functionForModeSolidAsm = qt_functionForModeSolid_onlySSE2;
+ }
+#endif
#ifdef QT_HAVE_IWMMXT
if (features & IWMMXT) {
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 5747da5..0cc2e40 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -1997,6 +1997,41 @@ void QT_FASTCALL rasterop_NotSource(uint *dest, const uint *src, int length, uin
void QT_FASTCALL rasterop_NotSourceAndDestination(uint *dest, const uint *src, int length, uint const_alpha);
void QT_FASTCALL rasterop_SourceAndNotDestination(uint *dest, const uint *src, int length, uint const_alpha);
+// prototypes of all the solid composition functions
+void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Destination(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Plus(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL rasterop_solid_SourceOrDestination(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL rasterop_solid_SourceAndDestination(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL rasterop_solid_SourceXorDestination(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL rasterop_solid_NotSourceXorDestination(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL rasterop_solid_NotSource(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL rasterop_solid_NotSourceAndDestination(uint *dest, int length, uint color, uint const_alpha);
+void QT_FASTCALL rasterop_solid_SourceAndNotDestination(uint *dest, int length, uint color, uint const_alpha);
+
QT_END_NAMESPACE
#endif // QDRAWHELPER_P_H
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index 5b674b5..ba2ba32 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -311,6 +311,78 @@ void QT_FASTCALL comp_func_solid_SourceOver_sse2(uint *destPixels, int length, u
}
}
+CompositionFunctionSolid qt_functionForModeSolid_onlySSE2[numCompositionFunctions] = {
+ comp_func_solid_SourceOver_sse2,
+ 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
+};
+
+CompositionFunction qt_functionForMode_onlySSE2[numCompositionFunctions] = {
+ comp_func_SourceOver_sse2,
+ comp_func_DestinationOver,
+ comp_func_Clear,
+ comp_func_Source_sse2,
+ 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_sse2,
+ 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
+};
+
void qt_memfill16_sse2(quint16 *dest, quint16 value, int count)
{
if (count < 3) {
diff --git a/src/gui/painting/qdrawhelper_x86_p.h b/src/gui/painting/qdrawhelper_x86_p.h
index d7282a7..09ccd77 100644
--- a/src/gui/painting/qdrawhelper_x86_p.h
+++ b/src/gui/painting/qdrawhelper_x86_p.h
@@ -122,6 +122,9 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
int w, int h,
int const_alpha);
+
+extern CompositionFunction qt_functionForMode_onlySSE2[];
+extern CompositionFunctionSolid qt_functionForModeSolid_onlySSE2[];
#endif // QT_HAVE_SSE2
#ifdef QT_HAVE_IWMMXT
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 0ba1bc6..358c6aa 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -154,6 +154,9 @@ QS60StylePrivate::~QS60StylePrivate()
{
clearCaches(); //deletes also background image
deleteThemePalette();
+#ifdef Q_WS_S60
+ removeAnimations();
+#endif
}
void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter,
@@ -1097,8 +1100,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
}
State mflags = bflags;
if (toolBtn->state & State_Sunken) {
- if (toolBtn->activeSubControls & SC_ToolButton)
- bflags |= State_Sunken;
+ bflags |= State_Sunken;
mflags |= State_Sunken;
}
@@ -1114,11 +1116,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (bflags & (State_Sunken | State_On | State_Raised | State_Enabled)) {
tool.rect = button.unite(menuRect);
tool.state = bflags;
- const QToolButton *toolButtonWidget = qobject_cast<const QToolButton *>(widget);
- const QS60StylePrivate::SkinElements element =
- ((toolButtonWidget && toolButtonWidget->isDown()) || (option->state & State_Sunken)) ?
- QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
- QS60StylePrivate::drawSkinElement(element, painter, tool.rect, flags);
drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
}
if (toolBtn->subControls & SC_ToolButtonMenu) {
@@ -2174,9 +2171,12 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_PanelButtonBevel:
case PE_FrameButtonBevel:
if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget)) {
- const bool isPressed = option->state & State_Sunken;
- const QS60StylePrivate::SkinElements skinElement =
- isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
+ const bool isPressed = (option->state & State_Sunken) || (option->state & State_On);
+ QS60StylePrivate::SkinElements skinElement;
+ if (element == PE_PanelButtonTool)
+ skinElement = isPressed ? QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
+ else
+ skinElement = isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
} else {
commonStyleDraws = true;
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 836969a..51ced96 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -571,6 +571,7 @@ public:
void startAnimation(QS60StyleEnums::SkinParts animation);
void stopAnimation(QS60StyleEnums::SkinParts animation);
static QS60StyleAnimation* animationDefinition(QS60StyleEnums::SkinParts part);
+ static void removeAnimations();
#endif
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index f44b85e..5dda42e 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -1152,6 +1152,12 @@ QS60StylePrivate::QS60StylePrivate()
setActiveLayout();
}
+void QS60StylePrivate::removeAnimations()
+{
+ //currently only one animation in the list.
+ m_animations()->removeFirst();
+}
+
QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list,
int index, const QStyleOption *option)
{
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 21c2e02..b950b13 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -400,9 +400,9 @@ QStaticTextPrivate::QStaticTextPrivate()
QStaticTextPrivate::QStaticTextPrivate(const QStaticTextPrivate &other)
: text(other.text), font(other.font), textWidth(other.textWidth), matrix(other.matrix),
- items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0), needsRelayout(true),
- useBackendOptimizations(other.useBackendOptimizations), textFormat(other.textFormat),
- untransformedCoordinates(other.untransformedCoordinates)
+ items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0), textOption(other.textOption),
+ needsRelayout(true), useBackendOptimizations(other.useBackendOptimizations),
+ textFormat(other.textFormat), untransformedCoordinates(other.untransformedCoordinates)
{
}
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 119217a..05de8f5 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2263,6 +2263,9 @@ bool QTextEngine::atWordSeparator(int position) const
case ',':
case '?':
case '!':
+ case '@':
+ case '#':
+ case '$':
case ':':
case ';':
case '-':
@@ -2283,6 +2286,7 @@ bool QTextEngine::atWordSeparator(int position) const
case '*':
case '\'':
case '"':
+ case '`':
case '~':
case '|':
return true;
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
index 24f6ccf..cd023cb 100644
--- a/src/gui/util/qdesktopservices_s60.cpp
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -223,6 +223,7 @@ static void handleOtherSchemesL(const TDesC& aUrl)
TApaTask task = taskList.FindApp(KUidBrowser);
if (task.Exists()){
// Switch to existing browser instance
+ task.BringToForeground();
HBufC8* param8 = HBufC8::NewLC(buf16->Length());
param8->Des().Append(buf16->Des());
task.SendMessage(TUid::Uid( 0 ), *param8); // Uid is not used