summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp15
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h3
-rw-r--r--src/corelib/global/qglobal.h3
-rw-r--r--src/corelib/kernel/qobject.cpp8
-rw-r--r--src/gui/embedded/directfb.pri39
-rw-r--r--src/gui/embedded/embedded.pri4
-rw-r--r--src/gui/embedded/qscreendriverfactory_qws.cpp9
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp27
-rw-r--r--src/gui/styles/qstyle.cpp8
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp39
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp14
-rw-r--r--src/network/access/qnetworkaccesscachebackend.cpp1
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp3
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp36
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h3
-rw-r--r--src/network/socket/qhttpsocketengine.cpp1
-rw-r--r--src/network/ssl/qsslsocket.cpp8
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp36
-rw-r--r--src/opengl/qglframebufferobject.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/directfb.pro38
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp4
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp99
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h16
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp101
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp35
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h6
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp55
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.h12
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp29
-rw-r--r--src/svg/qsvghandler.cpp283
31 files changed, 557 insertions, 384 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
index 8371229..4a33e67 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
@@ -684,6 +684,10 @@ void JIT::emit_op_catch(Instruction* currentInstruction)
killLastResultRegister(); // FIXME: Implicitly treat op_catch as a labeled statement, and remove this line of code.
peek(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof (void*));
emitPutVirtualRegister(currentInstruction[1].u.operand);
+#ifdef QT_BUILD_SCRIPT_LIB
+ JITStubCall stubCall(this, JITStubs::cti_op_debug_catch);
+ stubCall.call();
+#endif
}
void JIT::emit_op_jmp_scopes(Instruction* currentInstruction)
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
index 2563848..f0d3b84 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
@@ -2713,15 +2713,22 @@ DEFINE_STUB_FUNCTION(void, op_debug)
int debugHookID = stackFrame.args[0].int32();
int firstLine = stackFrame.args[1].int32();
int lastLine = stackFrame.args[2].int32();
-#ifdef QT_BUILD_SCRIPT_LIB
int column = stackFrame.args[3].int32();
-#else
- int column = -1;
-#endif
stackFrame.globalData->interpreter->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine, column);
}
+#ifdef QT_BUILD_SCRIPT_LIB
+DEFINE_STUB_FUNCTION(void, op_debug_catch)
+{
+ STUB_INIT_STACK_FRAME(stackFrame);
+ CallFrame* callFrame = stackFrame.callFrame;
+ if (JSC::Debugger* debugger = callFrame->lexicalGlobalObject()->debugger() ) {
+ debugger->exceptionCatch(DebuggerCallFrame(callFrame), callFrame->codeBlock()->ownerNode()->sourceID());
+ }
+}
+#endif
+
DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw)
{
STUB_INIT_STACK_FRAME(stackFrame);
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
index 0493189..60bf64a 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
@@ -221,6 +221,9 @@ namespace JITStubs { extern "C" {
void JIT_STUB cti_op_create_arguments(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_create_arguments_no_params(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_debug(STUB_ARGS_DECLARATION);
+#ifdef QT_BUILD_SCRIPT_LIB
+ void JIT_STUB cti_op_debug_catch(STUB_ARGS_DECLARATION);
+#endif
void JIT_STUB cti_op_end(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_jmp_scopes(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_pop_scope(STUB_ARGS_DECLARATION);
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 55eb4fa..ed403cb 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1372,6 +1372,9 @@ inline void qt_noop() {}
#ifdef QT_BOOTSTRAPPED
# define QT_NO_EXCEPTIONS
#endif
+#if defined(Q_CC_GNU) && !defined (__EXCEPTIONS)
+# define QT_NO_EXCEPTIONS
+#endif
#ifdef QT_NO_EXCEPTIONS
# define QT_TRY if (true)
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 4d9d3b2..c0c97b8 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3364,10 +3364,10 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign
&& (currentThreadData != sender->d_func()->threadData
|| receiver->d_func()->threadData != sender->d_func()->threadData))
|| (c->connectionType == Qt::QueuedConnection)) {
- queued_activate(sender, signal_absolute_index, c, argv);
+ queued_activate(sender, signal_absolute_index, c, argv ? argv : empty_argv);
continue;
} else if (c->connectionType == Qt::BlockingQueuedConnection) {
- blocking_activate(sender, signal_absolute_index, c, argv);
+ blocking_activate(sender, signal_absolute_index, c, argv ? argv : empty_argv);
continue;
}
@@ -3442,7 +3442,7 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign
void QMetaObject::activate(QObject *sender, int signal_index, void **argv)
{
const QMetaObject *mo = sender->metaObject();
- while (mo && mo->methodOffset() > signal_index)
+ while (mo->methodOffset() > signal_index)
mo = mo->superClass();
activate(sender, mo, signal_index - mo->methodOffset(), argv);
}
@@ -3706,7 +3706,7 @@ void QObject::dumpObjectInfo()
const QMetaObject *mo = metaObject();
int signalOffset, methodOffset;
computeOffsets(mo, &signalOffset, &methodOffset);
- while (mo && signalOffset > signal_index) {
+ while (signalOffset > signal_index) {
mo = mo->superClass();
offsetToNextMetaObject = signalOffset;
computeOffsets(mo, &signalOffset, &methodOffset);
diff --git a/src/gui/embedded/directfb.pri b/src/gui/embedded/directfb.pri
new file mode 100644
index 0000000..7dae9d5
--- /dev/null
+++ b/src/gui/embedded/directfb.pri
@@ -0,0 +1,39 @@
+# These defines might be necessary if your DirectFB driver doesn't
+# support all of the DirectFB API.
+#
+#DEFINES += QT_NO_DIRECTFB_SUBSURFACE
+#DEFINES += QT_DIRECTFB_WINDOW_AS_CURSOR
+#DEFINES += QT_NO_DIRECTFB_IMAGEPROVIDER
+#DEFINES += QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
+#DEFINES += QT_DIRECTFB_IMAGECACHE
+#DEFINES += QT_NO_DIRECTFB_WM
+#DEFINES += QT_NO_DIRECTFB_LAYER
+#DEFINES += QT_NO_DIRECTFB_PALETTE
+#DEFINES += QT_NO_DIRECTFB_PREALLOCATED
+#DEFINES += QT_NO_DIRECTFB_MOUSE
+#DEFINES += QT_NO_DIRECTFB_KEYBOARD
+#DEFINES += QT_DIRECTFB_TIMING
+#DEFINES += QT_NO_DIRECTFB_OPAQUE_DETECTION
+#DIRECTFB_DRAWINGOPERATIONS=DRAW_RECTS|DRAW_LINES|DRAW_IMAGE|DRAW_PIXMAP|DRAW_TILED_PIXMAP|STROKE_PATH|DRAW_PATH|DRAW_POINTS|DRAW_ELLIPSE|DRAW_POLYGON|DRAW_TEXT|FILL_PATH|FILL_RECT|DRAW_COLORSPANS
+#DEFINES += \"QT_DIRECTFB_WARN_ON_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\"
+#DEFINES += \"QT_DIRECTFB_DISABLE_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\"
+
+HEADERS += $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.h \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbmouse.h
+
+SOURCES += $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp \
+ $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
+
+
+QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB
+LIBS += $$QT_LIBS_DIRECTFB
diff --git a/src/gui/embedded/embedded.pri b/src/gui/embedded/embedded.pri
index 255a504..eb13d8d 100644
--- a/src/gui/embedded/embedded.pri
+++ b/src/gui/embedded/embedded.pri
@@ -139,6 +139,10 @@ embedded {
SOURCES += embedded/qscreentransformed_qws.cpp
}
+ contains( gfx-drivers, directfb ) {
+ INCLUDEPATH += $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb
+ include($$PWD/directfb.pri)
+ }
#
# Keyboard drivers
#
diff --git a/src/gui/embedded/qscreendriverfactory_qws.cpp b/src/gui/embedded/qscreendriverfactory_qws.cpp
index 21058af..99ee8f2 100644
--- a/src/gui/embedded/qscreendriverfactory_qws.cpp
+++ b/src/gui/embedded/qscreendriverfactory_qws.cpp
@@ -51,7 +51,9 @@
#include <stdlib.h>
#include "private/qfactoryloader_p.h"
#include "qscreendriverplugin_qws.h"
-
+#ifndef QT_NO_QWS_DIRECTFB
+#include "qdirectfbscreen.h"
+#endif
#ifndef QT_NO_QWS_VNC
#include "qscreenvnc_qws.h"
#endif
@@ -118,6 +120,10 @@ QScreen *QScreenDriverFactory::create(const QString& key, int displayId)
if (driver == QLatin1String("linuxfb") || driver.isEmpty())
return new QLinuxFbScreen(displayId);
#endif
+#ifndef QT_NO_QWS_DIRECTFB
+ if (driver == QLatin1String("directfb") || driver.isEmpty())
+ return new QDirectFBScreen(displayId);
+#endif
#ifndef QT_NO_QWS_TRANSFORMED
if (driver == QLatin1String("transformed"))
return new QTransformedScreen(displayId);
@@ -130,7 +136,6 @@ QScreen *QScreenDriverFactory::create(const QString& key, int displayId)
if (driver == QLatin1String("multi"))
return new QMultiScreen(displayId);
#endif
-
#if !defined(Q_OS_WIN32) || defined(QT_MAKEDLL)
#ifndef QT_NO_LIBRARY
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 0dae629..e931e4c 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -198,20 +198,19 @@
\o hoverEnterEvent(), hoverMoveEvent(), and hoverLeaveEvent() handles
hover enter, move and leave events
\o inputMethodEvent() handles input events, for accessibility support
- \o keyPressEvent() and keyReleaseEvent handle key press and release events
+ \o keyPressEvent() and keyReleaseEvent() handle key press and release events
\o mousePressEvent(), mouseMoveEvent(), mouseReleaseEvent(), and
mouseDoubleClickEvent() handles mouse press, move, release, click and
doubleclick events
\endlist
- You can filter events for any other item by installing event
- filters. This functionaly is separate from from Qt's regular
- event filters (see QObject::installEventFilter()), which only
- work on subclasses of QObject. After installing your item as an
- event filter for another item by calling
- installSceneEventFilter(), the filtered events will be received
- by the virtual function sceneEventFilter(). You can remove item
- event filters by calling removeSceneEventFilter().
+ You can filter events for any other item by installing event filters. This
+ functionality is separate from Qt's regular event filters (see
+ QObject::installEventFilter()), which only work on subclasses of QObject. After
+ installing your item as an event filter for another item by calling
+ installSceneEventFilter(), the filtered events will be received by the virtual
+ function sceneEventFilter(). You can remove item event filters by calling
+ removeSceneEventFilter().
\section1 Custom Data
@@ -410,11 +409,11 @@
(same as transform()), and QGraphicsItem ignores the return value for this
notification (i.e., a read-only notification).
- \value ItemSelectedChange The item's selected state changes. If the item
- is presently selected, it will become unselected, and vice verca. The
- value argument is the new selected state (i.e., true or false). Do not
- call setSelected() in itemChange() as this notification is delivered();
- instead, you can return the new selected state from itemChange().
+ \value ItemSelectedChange The item's selected state changes. If the item is
+ presently selected, it will become unselected, and vice verca. The value
+ argument is the new selected state (i.e., true or false). Do not call
+ setSelected() in itemChange() as this notification is delivered; instead, you
+ can return the new selected state from itemChange().
\value ItemSelectedHasChanged The item's selected state has changed. The
value argument is the new selected state (i.e., true or false). Do not
diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index d61d291..0500bff 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -1897,11 +1897,9 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
Returns an integer representing the specified style \a hint for
the given \a widget described by the provided style \a option.
- Note that currently, the \a returnData and \a widget parameters
- are not used; they are provided for future enhancement. In
- addition, the \a option parameter is used only in case of the
- SH_ComboBox_Popup, SH_ComboBox_LayoutDirection, and
- SH_GroupBox_TextLabelColor style hints.
+ \c returnData is used when the querying widget needs more detailed data than
+ the integer that styleHint() returns. See the QStyleHintReturn class
+ description for details.
*/
/*!
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index da9ec09..bd6fa57 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -425,32 +425,25 @@ void QHttpNetworkConnectionPrivate::dequeueAndSendRequest(QAbstractSocket *socke
int i = indexOf(socket);
if (!highPriorityQueue.isEmpty()) {
- for (int j = highPriorityQueue.count() - 1; j >= 0; --j) {
- HttpMessagePair &messagePair = highPriorityQueue[j];
- if (!messagePair.second->d_func()->requestIsPrepared)
- prepareRequest(messagePair);
-
- channels[i].request = messagePair.first;
- channels[i].reply = messagePair.second;
- // remove before sendRequest! else we might pipeline the same request again
- highPriorityQueue.removeAt(j);
- channels[i].sendRequest();
- return;
- }
+ // remove from queue before sendRequest! else we might pipeline the same request again
+ HttpMessagePair messagePair = highPriorityQueue.takeLast();
+ if (!messagePair.second->d_func()->requestIsPrepared)
+ prepareRequest(messagePair);
+ channels[i].request = messagePair.first;
+ channels[i].reply = messagePair.second;
+ channels[i].sendRequest();
+ return;
}
if (!lowPriorityQueue.isEmpty()) {
- for (int j = lowPriorityQueue.count() - 1; j >= 0; --j) {
- HttpMessagePair &messagePair = lowPriorityQueue[j];
- if (!messagePair.second->d_func()->requestIsPrepared)
- prepareRequest(messagePair);
- channels[i].request = messagePair.first;
- channels[i].reply = messagePair.second;
- // remove before sendRequest! else we might pipeline the same request again
- lowPriorityQueue.removeAt(j);
- channels[i].sendRequest();
- return;
- }
+ // remove from queue before sendRequest! else we might pipeline the same request again
+ HttpMessagePair messagePair = lowPriorityQueue.takeLast();
+ if (!messagePair.second->d_func()->requestIsPrepared)
+ prepareRequest(messagePair);
+ channels[i].request = messagePair.first;
+ channels[i].reply = messagePair.second;
+ channels[i].sendRequest();
+ return;
}
}
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp
index b624c24..be7896b 100644
--- a/src/network/access/qnetworkaccessbackend.cpp
+++ b/src/network/access/qnetworkaccessbackend.cpp
@@ -92,8 +92,11 @@ QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessM
QNetworkRequest::PreferNetwork).toInt());
if (mode == QNetworkRequest::AlwaysCache
&& (op == QNetworkAccessManager::GetOperation
- || op == QNetworkAccessManager::HeadOperation))
- return new QNetworkAccessCacheBackend;
+ || op == QNetworkAccessManager::HeadOperation)) {
+ QNetworkAccessBackend *backend = new QNetworkAccessCacheBackend;
+ backend->manager = this;
+ return backend;
+ }
if (!factoryDataShutdown) {
QMutexLocker locker(&factoryData()->mutex);
@@ -111,7 +114,6 @@ QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessM
return 0;
}
-
QNonContiguousByteDevice* QNetworkAccessBackend::createUploadByteDevice()
{
QNonContiguousByteDevice* device = 0;
@@ -143,6 +145,8 @@ void QNetworkAccessBackend::emitReplyUploadProgress(qint64 bytesSent, qint64 byt
}
QNetworkAccessBackend::QNetworkAccessBackend()
+ : manager(0)
+ , reply(0)
{
}
@@ -205,7 +209,9 @@ QList<QNetworkProxy> QNetworkAccessBackend::proxyList() const
QAbstractNetworkCache *QNetworkAccessBackend::networkCache() const
{
- return reply->networkCache; // should be the same as manager->networkCache
+ if (!manager)
+ return 0;
+ return manager->networkCache;
}
void QNetworkAccessBackend::setCachingEnabled(bool enable)
diff --git a/src/network/access/qnetworkaccesscachebackend.cpp b/src/network/access/qnetworkaccesscachebackend.cpp
index df66c9d..2be10db 100644
--- a/src/network/access/qnetworkaccesscachebackend.cpp
+++ b/src/network/access/qnetworkaccesscachebackend.cpp
@@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE
QNetworkAccessCacheBackend::QNetworkAccessCacheBackend()
: QNetworkAccessBackend()
+ , device(0)
{
}
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index d925e77..bc01e82 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -711,9 +711,6 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
// fourth step: setup the reply
priv->setup(op, request, outgoingData);
- if (request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt() !=
- QNetworkRequest::AlwaysNetwork)
- priv->setNetworkCache(d->networkCache);
#ifndef QT_NO_NETWORKPROXY
QList<QNetworkProxy> proxyList = d->queryProxy(QNetworkProxyQuery(request.url()));
priv->proxyList = proxyList;
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 3b0948b..a60a8dd 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
inline QNetworkReplyImplPrivate::QNetworkReplyImplPrivate()
: backend(0), outgoingData(0), outgoingDataBuffer(0),
- copyDevice(0), networkCache(0),
+ copyDevice(0),
cacheEnabled(false), cacheSaveDevice(0),
notificationHandlingPaused(false),
bytesDownloaded(0), lastBytesDownloaded(-1), bytesUploaded(-1),
@@ -252,11 +252,6 @@ void QNetworkReplyImplPrivate::setup(QNetworkAccessManager::Operation op, const
q->QIODevice::open(QIODevice::ReadOnly);
}
-void QNetworkReplyImplPrivate::setNetworkCache(QAbstractNetworkCache *nc)
-{
- networkCache = nc;
-}
-
void QNetworkReplyImplPrivate::backendNotify(InternalNotifications notification)
{
Q_Q(QNetworkReplyImpl);
@@ -318,17 +313,28 @@ void QNetworkReplyImplPrivate::resumeNotificationHandling()
QCoreApplication::postEvent(q, new QEvent(QEvent::NetworkReplyUpdated));
}
+QAbstractNetworkCache *QNetworkReplyImplPrivate::networkCache() const
+{
+ if (!backend)
+ return 0;
+ return backend->networkCache();
+}
+
void QNetworkReplyImplPrivate::createCache()
{
// check if we can save and if we're allowed to
- if (!networkCache || !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool())
+ if (!networkCache()
+ || !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool()
+ || request.attribute(QNetworkRequest::CacheLoadControlAttribute,
+ QNetworkRequest::PreferNetwork).toInt()
+ == QNetworkRequest::AlwaysNetwork)
return;
cacheEnabled = true;
}
bool QNetworkReplyImplPrivate::isCachingEnabled() const
{
- return (cacheEnabled && networkCache != 0);
+ return (cacheEnabled && networkCache() != 0);
}
void QNetworkReplyImplPrivate::setCachingEnabled(bool enable)
@@ -352,7 +358,7 @@ void QNetworkReplyImplPrivate::setCachingEnabled(bool enable)
qDebug("QNetworkReplyImpl: setCachingEnabled(true) called after setCachingEnabled(false) -- "
"backend %s probably needs to be fixed",
backend->metaObject()->className());
- networkCache->remove(url);
+ networkCache()->remove(url);
cacheSaveDevice = 0;
cacheEnabled = false;
}
@@ -361,9 +367,9 @@ void QNetworkReplyImplPrivate::setCachingEnabled(bool enable)
void QNetworkReplyImplPrivate::completeCacheSave()
{
if (cacheEnabled && errorCode != QNetworkReplyImpl::NoError) {
- networkCache->remove(url);
+ networkCache()->remove(url);
} else if (cacheEnabled && cacheSaveDevice) {
- networkCache->insert(cacheSaveDevice);
+ networkCache()->insert(cacheSaveDevice);
}
cacheSaveDevice = 0;
cacheEnabled = false;
@@ -410,15 +416,15 @@ void QNetworkReplyImplPrivate::appendDownstreamData(QByteDataBuffer &data)
metaData.setAttributes(attributes);
}
- cacheSaveDevice = networkCache->prepare(metaData);
+ cacheSaveDevice = networkCache()->prepare(metaData);
if (!cacheSaveDevice || (cacheSaveDevice && !cacheSaveDevice->isOpen())) {
if (cacheSaveDevice && !cacheSaveDevice->isOpen())
qCritical("QNetworkReplyImpl: network cache returned a device that is not open -- "
"class %s probably needs to be fixed",
- networkCache->metaObject()->className());
+ networkCache()->metaObject()->className());
- networkCache->remove(url);
+ networkCache()->remove(url);
cacheSaveDevice = 0;
cacheEnabled = false;
}
@@ -566,7 +572,7 @@ QNetworkReplyImpl::~QNetworkReplyImpl()
{
Q_D(QNetworkReplyImpl);
if (d->isCachingEnabled())
- d->networkCache->remove(url());
+ d->networkCache()->remove(url());
}
void QNetworkReplyImpl::abort()
diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h
index 8cda7a4..04f8aa8 100644
--- a/src/network/access/qnetworkreplyimpl_p.h
+++ b/src/network/access/qnetworkreplyimpl_p.h
@@ -131,7 +131,6 @@ public:
void setup(QNetworkAccessManager::Operation op, const QNetworkRequest &request,
QIODevice *outgoingData);
- void setNetworkCache(QAbstractNetworkCache *networkCache);
void pauseNotificationHandling();
void resumeNotificationHandling();
@@ -160,7 +159,7 @@ public:
QIODevice *outgoingData;
QRingBuffer *outgoingDataBuffer;
QIODevice *copyDevice;
- QAbstractNetworkCache *networkCache;
+ QAbstractNetworkCache *networkCache() const;
bool cacheEnabled;
QIODevice *cacheSaveDevice;
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index bb0915a..9ef92e1 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -752,6 +752,7 @@ QHttpSocketEnginePrivate::QHttpSocketEnginePrivate()
, readNotificationPending(false)
, writeNotificationPending(false)
, connectionNotificationPending(false)
+ , pendingResponseData(0)
{
socket = 0;
state = QHttpSocketEngine::None;
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 6858d40..0e0c347 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1745,7 +1745,13 @@ qint64 QSslSocket::writeData(const char *data, qint64 len)
\internal
*/
QSslSocketPrivate::QSslSocketPrivate()
- : initialized(false), readyReadEmittedPointer(0), plainSocket(0)
+ : initialized(false)
+ , mode(QSslSocket::UnencryptedMode)
+ , autoStartHandshake(false)
+ , connectionEncrypted(false)
+ , ignoreAllSslErrors(false)
+ , readyReadEmittedPointer(0)
+ , plainSocket(0)
{
QSslConfigurationPrivate::deepCopyDefaultConfiguration(&configuration);
}
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 891c027..d48a7b6 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -570,20 +570,34 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
requiredProgram.program->link();
if (!requiredProgram.program->isLinked()) {
+ QLatin1String none("none");
+ QLatin1String br("\n");
QString error;
- qWarning() << "Shader program failed to link,"
+ error = QLatin1String("Shader program failed to link,")
#if defined(QT_DEBUG)
- << '\n'
- << " Shaders Used:" << '\n'
- << " mainVertexShader = " << requiredProgram.mainVertexShader->objectName() << '\n'
- << " positionVertexShader = " << requiredProgram.positionVertexShader->objectName() << '\n'
- << " mainFragShader = " << requiredProgram.mainFragShader->objectName() << '\n'
- << " srcPixelFragShader = " << requiredProgram.srcPixelFragShader->objectName() << '\n'
- << " maskFragShader = " << requiredProgram.maskFragShader->objectName() << '\n'
- << " compositionFragShader = "<< requiredProgram.compositionFragShader->objectName() << '\n'
+ + br
+ + QLatin1String(" Shaders Used:\n")
+ + QLatin1String(" mainVertexShader = ")
+ + (requiredProgram.mainVertexShader ?
+ requiredProgram.mainVertexShader->objectName() : none) + br
+ + QLatin1String(" positionVertexShader = ")
+ + (requiredProgram.positionVertexShader ?
+ requiredProgram.positionVertexShader->objectName() : none) + br
+ + QLatin1String(" mainFragShader = ")
+ + (requiredProgram.mainFragShader ?
+ requiredProgram.mainFragShader->objectName() : none) + br
+ + QLatin1String(" srcPixelFragShader = ")
+ + (requiredProgram.srcPixelFragShader ?
+ requiredProgram.srcPixelFragShader->objectName() : none) + br
+ + QLatin1String(" maskFragShader = ")
+ + (requiredProgram.maskFragShader ?
+ requiredProgram.maskFragShader->objectName() : none) + br
+ + QLatin1String(" compositionFragShader = ")
+ + (requiredProgram.compositionFragShader ?
+ requiredProgram.compositionFragShader->objectName() : none) + br
#endif
- << " Error Log:" << '\n'
- << " " << requiredProgram.program->log();
+ + QLatin1String(" Error Log:\n")
+ + QLatin1String(" ") + requiredProgram.program->log();
qWarning() << error;
delete requiredProgram.program;
} else {
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 8fd113a..427aab3 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -877,7 +877,7 @@ QImage QGLFramebufferObject::toImage() const
// qt_gl_read_framebuffer doesn't work on a multisample FBO
if (format().samples() != 0) {
- QGLFramebufferObject temp(size());
+ QGLFramebufferObject temp(size(), QGLFramebufferObjectFormat());
QRect rect(QPoint(0, 0), size());
blitFramebuffer(&temp, rect, const_cast<QGLFramebufferObject *>(this), rect);
diff --git a/src/plugins/gfxdrivers/directfb/directfb.pro b/src/plugins/gfxdrivers/directfb/directfb.pro
index c5da3df..d397050 100644
--- a/src/plugins/gfxdrivers/directfb/directfb.pro
+++ b/src/plugins/gfxdrivers/directfb/directfb.pro
@@ -1,47 +1,15 @@
TARGET = qdirectfbscreen
include(../../qpluginbase.pri)
+include($$QT_SOURCE_TREE/src/gui/embedded/directfb.pri)
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/gfxdrivers
-# These defines might be necessary if your DirectFB driver doesn't
-# support all of the DirectFB API.
-#
-#DEFINES += QT_DIRECTFB_WINDOW_AS_CURSOR
-#DEFINES += QT_NO_DIRECTFB_IMAGEPROVIDER
-#DEFINES += QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
-#DEFINES += QT_DIRECTFB_IMAGECACHE
-#DEFINES += QT_NO_DIRECTFB_WM
-#DEFINES += QT_NO_DIRECTFB_LAYER
-#DEFINES += QT_NO_DIRECTFB_PALETTE
-#DEFINES += QT_NO_DIRECTFB_PREALLOCATED
-#DEFINES += QT_NO_DIRECTFB_MOUSE
-#DEFINES += QT_NO_DIRECTFB_KEYBOARD
-#DEFINES += QT_DIRECTFB_TIMING
-#DEFINES += QT_NO_DIRECTFB_OPAQUE_DETECTION
-#DIRECTFB_DRAWINGOPERATIONS=DRAW_RECTS|DRAW_LINES|DRAW_IMAGE|DRAW_PIXMAP|DRAW_TILED_PIXMAP|STROKE_PATH|DRAW_PATH|DRAW_POINTS|DRAW_ELLIPSE|DRAW_POLYGON|DRAW_TEXT|FILL_PATH|FILL_RECT|DRAW_COLORSPANS
-#DEFINES += \"QT_DIRECTFB_WARN_ON_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\"
-#DEFINES += \"QT_DIRECTFB_DISABLE_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\"
-
target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers
INSTALLS += target
-HEADERS = qdirectfbscreen.h \
- qdirectfbwindowsurface.h \
- qdirectfbpaintengine.h \
- qdirectfbpaintdevice.h \
- qdirectfbpixmap.h \
- qdirectfbkeyboard.h \
- qdirectfbmouse.h
-
-SOURCES = qdirectfbscreen.cpp \
- qdirectfbscreenplugin.cpp \
- qdirectfbwindowsurface.cpp \
- qdirectfbpaintengine.cpp \
- qdirectfbpaintdevice.cpp \
- qdirectfbpixmap.cpp \
- qdirectfbkeyboard.cpp \
- qdirectfbmouse.cpp
+SOURCES += qdirectfbscreenplugin.cpp
QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB
LIBS += $$QT_LIBS_DIRECTFB
DEFINES += $$QT_DEFINES_DIRECTFB
+contains(gfx-plugins, directfb):DEFINES += QT_QWS_DIRECTFB
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
index 2fb1520..896f512 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
@@ -121,8 +121,8 @@ QDirectFBMouseHandlerPrivate::QDirectFBMouseHandlerPrivate(QDirectFBMouseHandler
return;
}
- int flags = ::fcntl(fd, F_GETFL, 0);
- ::fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+ int flags = fcntl(fd, F_GETFL, 0);
+ fcntl(fd, F_SETFL, flags | O_NONBLOCK);
// DirectFB seems to assume that the mouse always starts centered
prevPoint = QPoint(screen->deviceWidth() / 2, screen->deviceHeight() / 2);
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
index 106de0d..2e56b9a 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
@@ -48,14 +48,29 @@
QT_BEGIN_NAMESPACE
QDirectFBPaintDevice::QDirectFBPaintDevice(QDirectFBScreen *scr)
- : QCustomRasterPaintDevice(0), dfbSurface(0), lockedImage(0), screen(scr),
- bpl(-1), lockFlgs(DFBSurfaceLockFlags(0)), mem(0), engine(0),
- imageFormat(QImage::Format_Invalid)
-{}
+ : QCustomRasterPaintDevice(0), dfbSurface(0), screen(scr),
+ bpl(-1), lockFlgs(DFBSurfaceLockFlags(0)), mem(0), engine(0), imageFormat(QImage::Format_Invalid)
+{
+#ifdef QT_DIRECTFB_SUBSURFACE
+ subSurface = 0;
+ syncPending = false;
+#endif
+}
QDirectFBPaintDevice::~QDirectFBPaintDevice()
{
- delete lockedImage;
+ unlockSurface();
+ if (QDirectFBScreen::instance()) {
+ unlockSurface();
+#ifdef QT_DIRECTFB_SUBSURFACE
+ if (subSurface) {
+ screen->releaseDFBSurface(subSurface);
+ }
+#endif
+ if (dfbSurface) {
+ screen->releaseDFBSurface(dfbSurface);
+ }
+ }
delete engine;
}
@@ -64,30 +79,57 @@ IDirectFBSurface *QDirectFBPaintDevice::directFBSurface() const
return dfbSurface;
}
-void QDirectFBPaintDevice::lockDirectFB(DFBSurfaceLockFlags flags)
+bool QDirectFBPaintDevice::lockSurface(DFBSurfaceLockFlags lockFlags)
{
- if (!(lockFlgs & flags)) {
- if (lockFlgs)
- unlockDirectFB();
- mem = QDirectFBScreen::lockSurface(dfbSurface, flags, &bpl);
+ if (lockFlgs && (lockFlags & ~lockFlgs))
+ unlockSurface();
+ if (!mem) {
+ Q_ASSERT(dfbSurface);
+#ifdef QT_DIRECTFB_SUBSURFACE
+ if (!subSurface) {
+ DFBResult result;
+ subSurface = screen->getSubSurface(dfbSurface, QRect(), QDirectFBScreen::TrackSurface, &result);
+ if (result != DFB_OK || !subSurface) {
+ DirectFBError("Couldn't create sub surface", result);
+ return false;
+ }
+ }
+ IDirectFBSurface *surface = subSurface;
+#else
+ IDirectFBSurface *surface = dfbSurface;
+#endif
+ Q_ASSERT(surface);
+ mem = QDirectFBScreen::lockSurface(surface, lockFlags, &bpl);
+ lockFlgs = lockFlags;
Q_ASSERT(mem);
+ Q_ASSERT(bpl > 0);
const QSize s = size();
- lockedImage = new QImage(mem, s.width(), s.height(), bpl,
- QDirectFBScreen::getImageFormat(dfbSurface));
- lockFlgs = flags;
+ lockedImage = QImage(mem, s.width(), s.height(), bpl,
+ QDirectFBScreen::getImageFormat(dfbSurface));
+ return true;
+ }
+#ifdef QT_DIRECTFB_SUBSURFACE
+ if (syncPending) {
+ syncPending = false;
+ screen->waitIdle();
}
+#endif
+ return false;
}
-void QDirectFBPaintDevice::unlockDirectFB()
+void QDirectFBPaintDevice::unlockSurface()
{
- if (!lockedImage || !QDirectFBScreen::instance())
- return;
-
- dfbSurface->Unlock(dfbSurface);
- delete lockedImage;
- lockedImage = 0;
- mem = 0;
- lockFlgs = DFBSurfaceLockFlags(0);
+ if (QDirectFBScreen::instance() && lockFlgs) {
+#ifdef QT_DIRECTFB_SUBSURFACE
+ IDirectFBSurface *surface = subSurface;
+#else
+ IDirectFBSurface *surface = dfbSurface;
+#endif
+ if (surface) {
+ surface->Unlock(surface);
+ lockFlgs = static_cast<DFBSurfaceLockFlags>(0);
+ }
+ }
}
void *QDirectFBPaintDevice::memory() const
@@ -102,17 +144,10 @@ QImage::Format QDirectFBPaintDevice::format() const
int QDirectFBPaintDevice::bytesPerLine() const
{
- if (bpl == -1) {
- // Can only get the stride when we lock the surface
- Q_ASSERT(!lockedImage);
- QDirectFBPaintDevice* that = const_cast<QDirectFBPaintDevice*>(this);
- that->lockDirectFB(DSLF_READ|DSLF_WRITE);
- Q_ASSERT(bpl != -1);
- }
+ Q_ASSERT(!mem || bpl != -1);
return bpl;
}
-
QSize QDirectFBPaintDevice::size() const
{
int w, h;
@@ -142,8 +177,8 @@ int QDirectFBPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
case QPaintDevice::PdmDepth:
return QDirectFBScreen::depth(imageFormat);
case QPaintDevice::PdmNumColors: {
- if (lockedImage)
- return lockedImage->numColors();
+ if (!lockedImage.isNull())
+ return lockedImage.numColors();
DFBResult result;
IDirectFBPalette *palette = 0;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
index f5de44b..cdd2bea 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
@@ -62,8 +62,8 @@ public:
virtual IDirectFBSurface *directFBSurface() const;
- void lockDirectFB(DFBSurfaceLockFlags lock);
- void unlockDirectFB();
+ bool lockSurface(DFBSurfaceLockFlags lockFlags);
+ void unlockSurface();
// Reimplemented from QCustomRasterPaintDevice:
void *memory() const;
@@ -73,7 +73,6 @@ public:
int metric(QPaintDevice::PaintDeviceMetric metric) const;
DFBSurfaceLockFlags lockFlags() const { return lockFlgs; }
QPaintEngine *paintEngine() const;
-
protected:
QDirectFBPaintDevice(QDirectFBScreen *scr);
inline int dotsPerMeterX() const
@@ -84,17 +83,20 @@ protected:
{
return (screen->deviceHeight() * 1000) / screen->physicalHeight();
}
-protected:
+
IDirectFBSurface *dfbSurface;
- QImage *lockedImage;
+#ifdef QT_DIRECTFB_SUBSURFACE
+ IDirectFBSurface *subSurface;
+ friend class QDirectFBPaintEnginePrivate;
+ bool syncPending;
+#endif
+ QImage lockedImage;
QDirectFBScreen *screen;
int bpl;
DFBSurfaceLockFlags lockFlgs;
uchar *mem;
QDirectFBPaintEngine *engine;
QImage::Format imageFormat;
-private:
- Q_DISABLE_COPY(QDirectFBPaintDevice);
};
QT_END_NAMESPACE
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 9a9553e..5bad4de 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -93,6 +93,7 @@ public:
inline void lock();
inline void unlock();
+ static inline void unlock(QDirectFBPaintDevice *device);
inline bool isSimpleBrush(const QBrush &brush) const;
@@ -109,7 +110,7 @@ public:
#endif
void prepareForBlit(bool alpha);
-private:
+
IDirectFBSurface *surface;
bool antialiased;
@@ -129,7 +130,6 @@ private:
QRect currentClip;
QDirectFBPaintEngine *q;
- friend class QDirectFBPaintEngine;
};
class SurfaceCache
@@ -222,6 +222,7 @@ template <class T>
static inline void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface);
#define CLIPPED_PAINT(operation) { \
+ d->unlock(); \
DFBRegion clipRegion; \
switch (d->clipType) { \
case QDirectFBPaintEnginePrivate::NoClip: \
@@ -269,6 +270,7 @@ bool QDirectFBPaintEngine::begin(QPaintDevice *device)
QPixmapData *data = static_cast<QPixmap*>(device)->pixmapData();
Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
QDirectFBPixmapData *dfbPixmapData = static_cast<QDirectFBPixmapData*>(data);
+ QDirectFBPaintEnginePrivate::unlock(dfbPixmapData);
d->dfbDevice = static_cast<QDirectFBPaintDevice*>(dfbPixmapData);
}
@@ -409,14 +411,13 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount)
QRasterPaintEngine::drawRects(rects, rectCount);
return;
}
- d->unlock();
if (brush != Qt::NoBrush) {
d->setDFBColor(brush.color());
- CLIPPED_PAINT(::fillRects<QRect>(rects, rectCount, state()->matrix, d->surface));
+ CLIPPED_PAINT(QT_PREPEND_NAMESPACE(fillRects<QRect>)(rects, rectCount, state()->matrix, d->surface));
}
if (pen != Qt::NoPen) {
d->setDFBColor(pen.color());
- CLIPPED_PAINT(::drawRects<QRect>(rects, rectCount, state()->matrix, d->surface));
+ CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects<QRect>)(rects, rectCount, state()->matrix, d->surface));
}
}
@@ -438,14 +439,13 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount)
QRasterPaintEngine::drawRects(rects, rectCount);
return;
}
- d->unlock();
if (brush != Qt::NoBrush) {
d->setDFBColor(brush.color());
- CLIPPED_PAINT(::fillRects<QRectF>(rects, rectCount, state()->matrix, d->surface));
+ CLIPPED_PAINT(fillRects<QRectF>(rects, rectCount, state()->matrix, d->surface));
}
if (pen != Qt::NoPen) {
d->setDFBColor(pen.color());
- CLIPPED_PAINT(::drawRects<QRectF>(rects, rectCount, state()->matrix, d->surface));
+ CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects<QRectF>)(rects, rectCount, state()->matrix, d->surface));
}
}
@@ -464,9 +464,8 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount)
const QPen &pen = state()->pen;
if (pen != Qt::NoPen) {
- d->unlock();
d->setDFBColor(pen.color());
- CLIPPED_PAINT(::drawLines<QLine>(lines, lineCount, state()->matrix, d->surface));
+ CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines<QLine>)(lines, lineCount, state()->matrix, d->surface));
}
}
@@ -485,9 +484,8 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount)
const QPen &pen = state()->pen;
if (pen != Qt::NoPen) {
- d->unlock();
d->setDFBColor(pen.color());
- CLIPPED_PAINT(::drawLines<QLineF>(lines, lineCount, state()->matrix, d->surface));
+ CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines<QLineF>)(lines, lineCount, state()->matrix, d->surface));
}
}
@@ -533,7 +531,6 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image,
return;
}
#if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE
- d->unlock();
bool release;
IDirectFBSurface *imgSurface = d->getSurface(image, &release);
d->prepareForBlit(QDirectFBScreen::hasAlphaChannel(imgSurface));
@@ -561,25 +558,25 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap,
RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
d->lock();
QRasterPaintEngine::drawPixmap(r, pixmap, sr);
- } else if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits)
- || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
- || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
- || (state()->renderHints & QPainter::SmoothPixmapTransform
- && state()->matrix.mapRect(r).size() != sr.size())) {
- RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
- const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
- d->lock();
- QRasterPaintEngine::drawImage(r, *img, sr);
} else {
- d->unlock();
- d->prepareForBlit(pixmap.hasAlphaChannel());
QPixmapData *data = pixmap.pixmapData();
Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
- dfbData->unlockDirectFB();
- IDirectFBSurface *s = dfbData->directFBSurface();
-
- CLIPPED_PAINT(d->blit(r, s, sr));
+ if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits)
+ || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
+ || (state()->renderHints & QPainter::SmoothPixmapTransform
+ && state()->matrix.mapRect(r).size() != sr.size())) {
+ RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
+ const QImage *img = dfbData->buffer();
+ d->lock();
+ QRasterPaintEngine::drawImage(r, *img, sr);
+ } else {
+ QDirectFBPaintEnginePrivate::unlock(dfbData);
+ d->prepareForBlit(pixmap.hasAlphaChannel());
+ IDirectFBSurface *s = dfbData->directFBSurface();
+ CLIPPED_PAINT(d->blit(r, s, sr));
+ }
}
}
@@ -602,14 +599,16 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r,
|| d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
|| (state()->renderHints & QPainter::SmoothPixmapTransform && state()->matrix.isScaling())) {
RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), offset);
- const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
+ QPixmapData *pixmapData = pixmap.pixmapData();
+ Q_ASSERT(pixmapData->classId() == QPixmapData::DirectFBClass);
+ QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(pixmapData);
+ const QImage *img = dfbData->buffer();
d->lock();
QRasterPixmapData *data = new QRasterPixmapData(QPixmapData::PixmapType);
data->fromImage(*img, Qt::AutoColor);
const QPixmap pix(data);
QRasterPaintEngine::drawTiledPixmap(r, pix, offset);
} else {
- d->unlock();
CLIPPED_PAINT(d->drawTiledPixmap(r, pixmap, offset));
}
}
@@ -708,7 +707,6 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
const QColor color = brush.color();
if (!color.isValid())
return;
- d->unlock();
d->setDFBColor(color);
const QRect r = state()->matrix.mapRect(rect).toRect();
CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height()));
@@ -725,7 +723,6 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
if (texture.pixmapData()->classId() != QPixmapData::DirectFBClass)
break;
- d->unlock();
CLIPPED_PAINT(d->drawTiledPixmap(rect, texture, rect.topLeft() - state()->brushOrigin));
return; }
default:
@@ -749,7 +746,6 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color)
d->lock();
QRasterPaintEngine::fillRect(rect, color);
} else {
- d->unlock();
d->setDFBColor(color);
const QRect r = state()->matrix.mapRect(rect).toRect();
CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height()));
@@ -811,8 +807,7 @@ void QDirectFBPaintEnginePrivate::lock()
// lock so we need to call the base implementation of prepare so
// it updates its rasterBuffer to point to the new buffer address.
Q_ASSERT(dfbDevice);
- if (dfbDevice->lockFlags() != (DSLF_WRITE|DSLF_READ)) {
- dfbDevice->lockDirectFB(DSLF_READ|DSLF_WRITE);
+ if (dfbDevice->lockSurface(DSLF_READ|DSLF_WRITE)) {
prepare(dfbDevice);
}
}
@@ -820,7 +815,21 @@ void QDirectFBPaintEnginePrivate::lock()
void QDirectFBPaintEnginePrivate::unlock()
{
Q_ASSERT(dfbDevice);
- dfbDevice->unlockDirectFB();
+#ifdef QT_DIRECTFB_SUBSURFACE
+ dfbDevice->syncPending = true;
+#else
+ QDirectFBPaintEnginePrivate::unlock(dfbDevice);
+#endif
+}
+
+void QDirectFBPaintEnginePrivate::unlock(QDirectFBPaintDevice *device)
+{
+#ifdef QT_NO_DIRECTFB_SUBSURFACE
+ Q_ASSERT(device);
+ device->unlockSurface();
+#else
+ Q_UNUSED(device);
+#endif
}
void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform)
@@ -1031,7 +1040,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
QPixmapData *data = pixmap.pixmapData();
Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
- dfbData->unlockDirectFB();
+ QDirectFBPaintEnginePrivate::unlock(dfbData);
const QSize pixmapSize = dfbData->size();
IDirectFBSurface *sourceSurface = dfbData->directFBSurface();
if (transform.isScaling()) {
@@ -1040,8 +1049,8 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
offset.ry() *= transform.m22();
const QSizeF mappedSize(pixmapSize.width() * transform.m11(), pixmapSize.height() * transform.m22());
- qreal y = ::fixCoord(destinationRect.y(), mappedSize.height(), offset.y());
- const qreal startX = ::fixCoord(destinationRect.x(), mappedSize.width(), offset.x());
+ qreal y = fixCoord(destinationRect.y(), mappedSize.height(), offset.y());
+ const qreal startX = fixCoord(destinationRect.x(), mappedSize.width(), offset.x());
while (y <= destinationRect.bottom()) {
qreal x = startX;
while (x <= destinationRect.right()) {
@@ -1052,8 +1061,8 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
y += mappedSize.height();
}
} else {
- qreal y = ::fixCoord(destinationRect.y(), pixmapSize.height(), offset.y());
- const qreal startX = ::fixCoord(destinationRect.x(), pixmapSize.width(), offset.x());
+ qreal y = fixCoord(destinationRect.y(), pixmapSize.height(), offset.y());
+ const qreal startX = fixCoord(destinationRect.x(), pixmapSize.width(), offset.x());
int horizontal = qMax(1, destinationRect.width() / pixmapSize.width()) + 1;
if (startX != destinationRect.x())
++horizontal;
@@ -1165,12 +1174,12 @@ template <class T>
static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface)
{
if (n == 1) {
- const QLine l = ::map(transform, lines[0]);
+ const QLine l = map(transform, lines[0]);
surface->DrawLine(surface, l.x1(), l.y1(), l.x2(), l.y2());
} else {
QVarLengthArray<DFBRegion, 32> lineArray(n);
for (int i=0; i<n; ++i) {
- const QLine l = ::map(transform, lines[i]);
+ const QLine l = map(transform, lines[i]);
lineArray[i].x1 = l.x1();
lineArray[i].y1 = l.y1();
lineArray[i].x2 = l.x2();
@@ -1184,12 +1193,12 @@ template <class T>
static inline void fillRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
{
if (n == 1) {
- const QRect r = ::mapRect(transform, rects[0]);
+ const QRect r = mapRect(transform, rects[0]);
surface->FillRectangle(surface, r.x(), r.y(), r.width(), r.height());
} else {
QVarLengthArray<DFBRectangle, 32> rectArray(n);
for (int i=0; i<n; ++i) {
- const QRect r = ::mapRect(transform, rects[i]);
+ const QRect r = mapRect(transform, rects[i]);
rectArray[i].x = r.x();
rectArray[i].y = r.y();
rectArray[i].w = r.width();
@@ -1203,7 +1212,7 @@ template <class T>
static inline void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
{
for (int i=0; i<n; ++i) {
- const QRect r = ::mapRect(transform, rects[i]);
+ const QRect r = mapRect(transform, rects[i]);
surface->DrawRectangle(surface, r.x(), r.y(), r.width(), r.height());
}
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 0717020..6550683 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -64,9 +64,6 @@ QDirectFBPixmapData::QDirectFBPixmapData(QDirectFBScreen *screen, PixelType pixe
QDirectFBPixmapData::~QDirectFBPixmapData()
{
- unlockDirectFB();
- if (dfbSurface && QDirectFBScreen::instance())
- screen->releaseDFBSurface(dfbSurface);
}
void QDirectFBPixmapData::resize(int width, int height)
@@ -167,7 +164,7 @@ static bool checkForAlphaPixels(const QImage &img)
bool QDirectFBPixmapData::hasAlphaChannel(const QImage &img)
{
#ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION
- return ::checkForAlphaPixels(img);
+ return checkForAlphaPixels(img);
#else
return img.hasAlphaChannel();
#endif
@@ -375,9 +372,13 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
QPixmapData::copy(data, rect);
return;
}
- unlockDirectFB();
const QDirectFBPixmapData *otherData = static_cast<const QDirectFBPixmapData*>(data);
+#ifdef QT_NO_DIRECTFB_SUBSURFACE
+ if (otherData->lockFlags()) {
+ const_cast<QDirectFBPixmapData*>(otherData)->unlockSurface();
+ }
+#endif
IDirectFBSurface *src = otherData->directFBSurface();
alpha = data->hasAlphaChannel();
imageFormat = (alpha
@@ -405,6 +406,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
h = rect.height();
d = otherData->d;
is_null = (w <= 0 || h <= 0);
+ unlockSurface();
DFBResult result = dfbSurface->Blit(dfbSurface, src, &blitRect, 0, 0);
#if (Q_DIRECTFB_VERSION >= 0x010000)
dfbSurface->ReleaseSource(dfbSurface);
@@ -443,7 +445,7 @@ void QDirectFBPixmapData::fill(const QColor &color)
alpha = (color.alpha() < 255);
- if (alpha && ::isOpaqueFormat(imageFormat)) {
+ if (alpha && isOpaqueFormat(imageFormat)) {
QSize size;
dfbSurface->GetSize(dfbSurface, &size.rwidth(), &size.rheight());
screen->releaseDFBSurface(dfbSurface);
@@ -465,18 +467,21 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
Qt::TransformationMode mode) const
{
QDirectFBPixmapData *that = const_cast<QDirectFBPixmapData*>(this);
+#ifdef QT_NO_DIRECTFB_SUBSURFACE
+ if (lockFlags())
+ that->unlockSurface();
+#endif
+
if (!dfbSurface || transform.type() != QTransform::TxScale
|| mode != Qt::FastTransformation)
{
const QImage *image = that->buffer();
Q_ASSERT(image);
const QImage transformed = image->transformed(transform, mode);
- that->unlockDirectFB();
QDirectFBPixmapData *data = new QDirectFBPixmapData(screen, QPixmapData::PixmapType);
data->fromImage(transformed, Qt::AutoColor);
return QPixmap(data);
}
- that->unlockDirectFB();
const QSize size = transform.mapRect(QRect(0, 0, w, h)).size();
if (size.isEmpty())
@@ -556,14 +561,12 @@ QPaintEngine *QDirectFBPixmapData::paintEngine() const
QImage *QDirectFBPixmapData::buffer()
{
- lockDirectFB(DSLF_READ|DSLF_WRITE);
- return lockedImage;
-}
-
-QImage * QDirectFBPixmapData::buffer(DFBSurfaceLockFlags lockFlags)
-{
- lockDirectFB(lockFlags);
- return lockedImage;
+ if (!lockFlgs) {
+ lockSurface(DSLF_READ|DSLF_WRITE);
+ }
+ Q_ASSERT(lockFlgs);
+ Q_ASSERT(!lockedImage.isNull());
+ return &lockedImage;
}
void QDirectFBPixmapData::invalidate()
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
index 7b4ae47..5d3a2f6 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
@@ -81,11 +81,9 @@ public:
virtual QImage toImage() const;
virtual QPaintEngine *paintEngine() const;
virtual QImage *buffer();
- virtual int metric(QPaintDevice::PaintDeviceMetric m) const {return QDirectFBPaintDevice::metric(m);}
-
- QImage *buffer(DFBSurfaceLockFlags lockFlags);
-
// Pure virtual in QPixmapData, so re-implement here and delegate to QDirectFBPaintDevice
+ virtual int metric(QPaintDevice::PaintDeviceMetric m) const { return QDirectFBPaintDevice::metric(m); }
+
inline QImage::Format pixelFormat() const { return imageFormat; }
static bool hasAlphaChannel(const QImage &img);
inline bool hasAlphaChannel() const { return alpha; }
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 59fa191..599b2a9 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -319,14 +319,38 @@ IDirectFBSurface *QDirectFBScreen::createDFBSurface(DFBSurfaceDescription desc,
if (options & TrackSurface) {
d_ptr->allocatedSurfaces.insert(newSurface);
-
- //qDebug("Created a new DirectFB surface at %p. New count = %d",
- // newSurface, d_ptr->allocatedSurfaces.count());
}
return newSurface;
}
+#ifdef QT_DIRECTFB_SUBSURFACE
+IDirectFBSurface *QDirectFBScreen::getSubSurface(IDirectFBSurface *surface,
+ const QRect &rect,
+ SurfaceCreationOptions options,
+ DFBResult *resultPtr)
+{
+ Q_ASSERT(!(options & NoPreallocated));
+ Q_ASSERT(surface);
+ DFBResult res;
+ DFBResult &result = (resultPtr ? *resultPtr : res);
+ IDirectFBSurface *subSurface = 0;
+ if (rect.isNull()) {
+ result = surface->GetSubSurface(surface, 0, &subSurface);
+ } else {
+ const DFBRectangle subRect = { rect.x(), rect.y(), rect.width(), rect.height() };
+ result = surface->GetSubSurface(surface, &subRect, &subSurface);
+ }
+ if (result != DFB_OK) {
+ DirectFBError("Can't get sub surface", result);
+ } else if (options & TrackSurface) {
+ d_ptr->allocatedSurfaces.insert(subSurface);
+ }
+ return subSurface;
+}
+#endif
+
+
void QDirectFBScreen::releaseDFBSurface(IDirectFBSurface *surface)
{
Q_ASSERT(QDirectFBScreen::instance());
@@ -999,9 +1023,9 @@ static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface)
dev.name, dev.vendor, dev.driver.name, dev.driver.major,
dev.driver.minor, dev.driver.vendor, DFB_PIXELFORMAT_INDEX(pixelFormat),
QDirectFBScreen::getImageFormat(primarySurface), dev.acceleration_mask,
- ::flagDescriptions(dev.acceleration_mask, accelerationDescriptions).constData(),
- dev.blitting_flags, ::flagDescriptions(dev.blitting_flags, blitDescriptions).constData(),
- dev.drawing_flags, ::flagDescriptions(dev.drawing_flags, drawDescriptions).constData(),
+ flagDescriptions(dev.acceleration_mask, accelerationDescriptions).constData(),
+ dev.blitting_flags, flagDescriptions(dev.blitting_flags, blitDescriptions).constData(),
+ dev.drawing_flags, flagDescriptions(dev.drawing_flags, drawDescriptions).constData(),
(dev.video_memory >> 10));
}
#endif
@@ -1067,7 +1091,7 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
#ifdef QT_DIRECTFB_IMAGECACHE
int imageCacheSize = 4 * 1024 * 1024; // 4 MB
- ::setIntOption(displayArgs, QLatin1String("imagecachesize"), &imageCacheSize);
+ setIntOption(displayArgs, QLatin1String("imagecachesize"), &imageCacheSize);
QDirectFBPaintEngine::initImageCache(imageCacheSize);
#endif
@@ -1191,8 +1215,8 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
"Unable to get screen size!", result);
return false;
}
- ::setIntOption(displayArgs, QLatin1String("width"), &w);
- ::setIntOption(displayArgs, QLatin1String("height"), &h);
+ setIntOption(displayArgs, QLatin1String("width"), &w);
+ setIntOption(displayArgs, QLatin1String("height"), &h);
dw = w;
dh = h;
@@ -1200,8 +1224,8 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
Q_ASSERT(dw != 0 && dh != 0);
physWidth = physHeight = -1;
- ::setIntOption(displayArgs, QLatin1String("mmWidth"), &physWidth);
- ::setIntOption(displayArgs, QLatin1String("mmHeight"), &physHeight);
+ setIntOption(displayArgs, QLatin1String("mmWidth"), &physWidth);
+ setIntOption(displayArgs, QLatin1String("mmHeight"), &physHeight);
const int dpi = 72;
if (physWidth < 0)
physWidth = qRound(dw * 25.4 / dpi);
@@ -1527,6 +1551,11 @@ void QDirectFBScreen::setDirectFBImageProvider(IDirectFBImageProvider *provider)
}
#endif
+void QDirectFBScreen::waitIdle()
+{
+ d_ptr->dfb->WaitIdle(d_ptr->dfb);
+}
+
IDirectFBSurface * QDirectFBScreen::surfaceForWidget(const QWidget *widget, QRect *rect) const
{
Q_ASSERT(widget);
@@ -1540,6 +1569,7 @@ IDirectFBSurface * QDirectFBScreen::surfaceForWidget(const QWidget *widget, QRec
return 0;
}
+#ifdef QT_DIRECTFB_SUBSURFACE
IDirectFBSurface *QDirectFBScreen::subSurfaceForWidget(const QWidget *widget, const QRect &area) const
{
Q_ASSERT(widget);
@@ -1550,7 +1580,7 @@ IDirectFBSurface *QDirectFBScreen::subSurfaceForWidget(const QWidget *widget, co
if (!area.isNull())
rect &= area.translated(widget->mapTo(widget->window(), QPoint(0, 0)));
if (!rect.isNull()) {
- const DFBRectangle subRect = {rect.x(), rect.y(), rect.width(), rect.height() };
+ const DFBRectangle subRect = { rect.x(), rect.y(), rect.width(), rect.height() };
const DFBResult result = surface->GetSubSurface(surface, &subRect, &subSurface);
if (result != DFB_OK) {
DirectFBError("QDirectFBScreen::subSurface(): Can't get sub surface", result);
@@ -1559,6 +1589,7 @@ IDirectFBSurface *QDirectFBScreen::subSurfaceForWidget(const QWidget *widget, co
}
return subSurface;
}
+#endif
QT_END_NAMESPACE
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
index e74adb1..0ce7a53 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
@@ -54,6 +54,9 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
+#if !defined QT_NO_DIRECTFB_SUBSURFACE && !defined QT_DIRECTFB_SUBSURFACE
+#define QT_DIRECTFB_SUBSURFACE
+#endif
#if !defined QT_NO_DIRECTFB_LAYER && !defined QT_DIRECTFB_LAYER
#define QT_DIRECTFB_LAYER
#endif
@@ -166,8 +169,11 @@ public:
return static_cast<QDirectFBScreen*>(inst);
}
+ void waitIdle();
IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const;
+#ifdef QT_DIRECTFB_SUBSURFACE
IDirectFBSurface *subSurfaceForWidget(const QWidget *widget, const QRect &area = QRect()) const;
+#endif
IDirectFB *dfb();
#ifdef QT_NO_DIRECTFB_WM
@@ -199,6 +205,12 @@ public:
IDirectFBSurface *createDFBSurface(DFBSurfaceDescription desc,
SurfaceCreationOptions options,
DFBResult *result);
+#ifdef QT_DIRECTFB_SUBSURFACE
+ IDirectFBSurface *getSubSurface(IDirectFBSurface *surface,
+ const QRect &rect,
+ SurfaceCreationOptions options,
+ DFBResult *result);
+#endif
void flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags flipFlags,
const QRegion &region, const QPoint &offset);
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index 73a6dd7..e288199 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -102,6 +102,11 @@ QDirectFBWindowSurface::~QDirectFBWindowSurface()
{
}
+bool QDirectFBWindowSurface::isValid() const
+{
+ return true;
+}
+
#ifdef QT_DIRECTFB_WM
void QDirectFBWindowSurface::raise()
{
@@ -111,14 +116,7 @@ void QDirectFBWindowSurface::raise()
sibling->raise();
}
}
-#endif
-bool QDirectFBWindowSurface::isValid() const
-{
- return true;
-}
-
-#ifndef QT_NO_DIRECTFB_WM
void QDirectFBWindowSurface::createWindow()
{
IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
@@ -148,10 +146,8 @@ void QDirectFBWindowSurface::createWindow()
dfbWindow->GetSurface(dfbWindow, &dfbSurface);
updateFormat();
}
-#endif // QT_NO_DIRECTFB_WM
-#ifndef QT_NO_DIRECTFB_WM
-static DFBResult setGeometry(IDirectFBWindow *dfbWindow, const QRect &old, const QRect &rect)
+static DFBResult setWindowGeometry(IDirectFBWindow *dfbWindow, const QRect &old, const QRect &rect)
{
DFBResult result = DFB_OK;
const bool isMove = old.isEmpty() || rect.topLeft() != old.topLeft();
@@ -178,7 +174,7 @@ static DFBResult setGeometry(IDirectFBWindow *dfbWindow, const QRect &old, const
#endif
return result;
}
-#endif
+#endif // QT_NO_DIRECTFB_WM
void QDirectFBWindowSurface::setGeometry(const QRect &rect)
{
@@ -205,11 +201,10 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect)
const QRect oldRect = geometry();
DFBResult result = DFB_OK;
// If we're in a resize, the surface shouldn't be locked
- Q_ASSERT((lockedImage == 0) || (rect.size() == geometry().size()));
#ifdef QT_DIRECTFB_WM
if (!dfbWindow)
createWindow();
- ::setGeometry(dfbWindow, oldRect, rect);
+ setWindowGeometry(dfbWindow, oldRect, rect);
#else
if (mode == Primary) {
if (dfbSurface && dfbSurface != primarySurface)
@@ -271,12 +266,12 @@ bool QDirectFBWindowSurface::scroll(const QRegion &region, int dx, int dy)
return false;
dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
if (region.numRects() == 1) {
- ::scrollSurface(dfbSurface, region.boundingRect(), dx, dy);
+ scrollSurface(dfbSurface, region.boundingRect(), dx, dy);
} else {
const QVector<QRect> rects = region.rects();
const int n = rects.size();
for (int i=0; i<n; ++i) {
- ::scrollSurface(dfbSurface, rects.at(i), dx, dy);
+ scrollSurface(dfbSurface, rects.at(i), dx, dy);
}
}
return true;
@@ -420,7 +415,9 @@ void QDirectFBWindowSurface::beginPaint(const QRegion &)
void QDirectFBWindowSurface::endPaint(const QRegion &)
{
- unlockDirectFB();
+#ifdef QT_NO_DIRECTFB_SUBSURFACE
+ unlockSurface();
+#endif
}
IDirectFBSurface *QDirectFBWindowSurface::directFBSurface() const
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 371b845..9683efd 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -685,6 +685,28 @@ static QString idFromUrl(const QString &url)
return id;
}
+static inline QStringRef trimRef(const QStringRef &str)
+{
+ if (str.isEmpty())
+ return QStringRef();
+ const QChar *s = str.string()->constData() + str.position();
+ int end = str.length() - 1;
+ if (!s[0].isSpace() && !s[end].isSpace())
+ return str;
+
+ int start = 0;
+ while (start<=end && s[start].isSpace()) // skip white space from start
+ start++;
+ if (start <= end) { // only white space
+ while (s[end].isSpace()) // skip white space from end
+ end--;
+ }
+ int l = end - start + 1;
+ if (l <= 0)
+ return QStringRef();
+ return QStringRef(str.string(), str.position() + start, l);
+}
+
/**
* returns true when successfuly set the color. false signifies
* that the color should be inherited
@@ -903,12 +925,16 @@ static void parseBrush(QSvgNode *node,
-static QMatrix parseTransformationMatrix(const QString &value)
+static QMatrix parseTransformationMatrix(const QStringRef &value)
{
+ if (value.isEmpty())
+ return QMatrix();
+
QMatrix matrix;
const QChar *str = value.constData();
+ const QChar *end = str + value.length();
- while (*str != QLatin1Char(0)) {
+ while (str < end) {
if (str->isSpace() || *str == QLatin1Char(',')) {
++str;
continue;
@@ -973,7 +999,7 @@ static QMatrix parseTransformationMatrix(const QString &value)
}
- while (str->isSpace())
+ while (str < end && str->isSpace())
++str;
if (*str != QLatin1Char('('))
goto error;
@@ -1212,10 +1238,7 @@ static void parseTransform(QSvgNode *node,
{
if (attributes.transform.isEmpty())
return;
- QString value = attributes.transform.toString().trimmed();
- if (value.isEmpty())
- return;
- QMatrix matrix = parseTransformationMatrix(value);
+ QMatrix matrix = parseTransformationMatrix(trimRef(attributes.transform));
if (!matrix.isIdentity()) {
node->appendStyleProperty(new QSvgTransformStyle(QTransform(matrix)), someId(attributes));
@@ -1391,24 +1414,29 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
QChar pathElem = *str;
++str;
QChar endc = *end;
- *const_cast<QChar *>(end) = 0; // parseNumbersList requires 0-termination that QStringRef cannot guarantee
- QVector<qreal> arg = parseNumbersList(str);
+ *const_cast<QChar *>(end) = 0; // parseNumbersArray requires 0-termination that QStringRef cannot guarantee
+ QVarLengthArray<qreal, 8> arg;
+ parseNumbersArray(str, arg);
*const_cast<QChar *>(end) = endc;
if (pathElem == QLatin1Char('z') || pathElem == QLatin1Char('Z'))
arg.append(0);//dummy
- while (!arg.isEmpty()) {
+ const qreal *num = arg.constData();
+ int count = arg.count();
+ while (count > 0) {
qreal offsetX = x; // correction offsets
qreal offsetY = y; // for relative commands
switch (pathElem.unicode()) {
case 'm': {
- if (arg.count() < 2) {
- arg.pop_front();
+ if (count < 2) {
+ num++;
+ count--;
break;
}
- x = x0 = arg[0] + offsetX;
- y = y0 = arg[1] + offsetY;
+ x = x0 = num[0] + offsetX;
+ y = y0 = num[1] + offsetY;
+ num += 2;
+ count -= 2;
path.moveTo(x0, y0);
- arg.pop_front(); arg.pop_front();
// As per 1.2 spec 8.3.2 The "moveto" commands
// If a 'moveto' is followed by multiple pairs of coordinates without explicit commands,
@@ -1417,15 +1445,16 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
}
break;
case 'M': {
- if (arg.count() < 2) {
- arg.pop_front();
+ if (count < 2) {
+ num++;
+ count--;
break;
}
- x = x0 = arg[0];
- y = y0 = arg[1];
-
+ x = x0 = num[0];
+ y = y0 = num[1];
+ num += 2;
+ count -= 2;
path.moveTo(x0, y0);
- arg.pop_front(); arg.pop_front();
// As per 1.2 spec 8.3.2 The "moveto" commands
// If a 'moveto' is followed by multiple pairs of coordinates without explicit commands,
@@ -1437,96 +1466,104 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
case 'Z': {
x = x0;
y = y0;
+ count--; // skip dummy
+ num++;
path.closeSubpath();
- arg.pop_front();//pop dummy
}
break;
case 'l': {
- if (arg.count() < 2) {
- arg.pop_front();
+ if (count < 2) {
+ num++;
+ count--;
break;
}
- x = arg.front() + offsetX;
- arg.pop_front();
- y = arg.front() + offsetY;
- arg.pop_front();
+ x = x0 = num[0] + offsetX;
+ y = y0 = num[1] + offsetY;
+ num += 2;
+ count -= 2;
path.lineTo(x, y);
}
break;
case 'L': {
- if (arg.count() < 2) {
- arg.pop_front();
+ if (count < 2) {
+ num++;
+ count--;
break;
}
- x = arg.front(); arg.pop_front();
- y = arg.front(); arg.pop_front();
+ x = x0 = num[0];
+ y = y0 = num[1];
+ num += 2;
+ count -= 2;
path.lineTo(x, y);
}
break;
case 'h': {
- x = arg.front() + offsetX; arg.pop_front();
+ x = num[0] + offsetX;
+ num++;
+ count--;
path.lineTo(x, y);
}
break;
case 'H': {
- x = arg[0];
+ x = num[0];
+ num++;
+ count--;
path.lineTo(x, y);
- arg.pop_front();
}
break;
case 'v': {
- y = arg[0] + offsetY;
+ y = num[0] + offsetY;
+ num++;
+ count--;
path.lineTo(x, y);
- arg.pop_front();
}
break;
case 'V': {
- y = arg[0];
+ y = num[0];
+ num++;
+ count--;
path.lineTo(x, y);
- arg.pop_front();
}
break;
case 'c': {
- if (arg.count() < 6) {
- while (arg.count())
- arg.pop_front();
+ if (count < 6) {
+ num += count;
+ count = 0;
break;
}
- QPointF c1(arg[0]+offsetX, arg[1]+offsetY);
- QPointF c2(arg[2]+offsetX, arg[3]+offsetY);
- QPointF e(arg[4]+offsetX, arg[5]+offsetY);
+ QPointF c1(num[0] + offsetX, num[1] + offsetY);
+ QPointF c2(num[2] + offsetX, num[3] + offsetY);
+ QPointF e(num[4] + offsetX, num[5] + offsetY);
+ num += 6;
+ count -= 6;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
break;
}
case 'C': {
- if (arg.count() < 6) {
- while (arg.count())
- arg.pop_front();
+ if (count < 6) {
+ num += count;
+ count = 0;
break;
}
- QPointF c1(arg[0], arg[1]);
- QPointF c2(arg[2], arg[3]);
- QPointF e(arg[4], arg[5]);
+ QPointF c1(num[0], num[1]);
+ QPointF c2(num[2], num[3]);
+ QPointF e(num[4], num[5]);
+ num += 6;
+ count -= 6;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
break;
}
case 's': {
- if (arg.count() < 4) {
- while (arg.count())
- arg.pop_front();
+ if (count < 4) {
+ num += count;
+ count = 0;
break;
}
QPointF c1;
@@ -1535,20 +1572,20 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
c1 = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c1 = QPointF(x, y);
- QPointF c2(arg[0]+offsetX, arg[1]+offsetY);
- QPointF e(arg[2]+offsetX, arg[3]+offsetY);
+ QPointF c2(num[0] + offsetX, num[1] + offsetY);
+ QPointF e(num[2] + offsetX, num[3] + offsetY);
+ num += 4;
+ count -= 4;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
break;
}
case 'S': {
- if (arg.count() < 4) {
- while (arg.count())
- arg.pop_front();
+ if (count < 4) {
+ num += count;
+ count = 0;
break;
}
QPointF c1;
@@ -1557,55 +1594,57 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
c1 = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c1 = QPointF(x, y);
- QPointF c2(arg[0], arg[1]);
- QPointF e(arg[2], arg[3]);
+ QPointF c2(num[0], num[1]);
+ QPointF e(num[2], num[3]);
+ num += 4;
+ count -= 4;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
break;
}
case 'q': {
- if (arg.count() < 4) {
- while (arg.count())
- arg.pop_front();
+ if (count < 4) {
+ num += count;
+ count = 0;
break;
}
- QPointF c(arg[0]+offsetX, arg[1]+offsetY);
- QPointF e(arg[2]+offsetX, arg[3]+offsetY);
+ QPointF c(num[0] + offsetX, num[1] + offsetY);
+ QPointF e(num[2] + offsetX, num[3] + offsetY);
+ num += 4;
+ count -= 4;
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
break;
}
case 'Q': {
- if (arg.count() < 4) {
- while (arg.count())
- arg.pop_front();
+ if (count < 4) {
+ num += count;
+ count = 0;
break;
}
- QPointF c(arg[0], arg[1]);
- QPointF e(arg[2], arg[3]);
+ QPointF c(num[0], num[1]);
+ QPointF e(num[2], num[3]);
+ num += 4;
+ count -= 4;
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
break;
}
case 't': {
- if (arg.count() < 2) {
- while (arg.count())
- arg.pop_front();
+ if (count < 2) {
+ num += count;
+ count = 0;
break;
}
- QPointF e(arg[0]+offsetX, arg[1]+offsetY);
+ QPointF e(num[0] + offsetX, num[1] + offsetY);
+ num += 2;
+ count -= 2;
QPointF c;
if (lastMode == 'q' || lastMode == 'Q' ||
lastMode == 't' || lastMode == 'T')
@@ -1616,16 +1655,17 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
ctrlPt = c;
x = e.x();
y = e.y();
- arg.pop_front(); arg.pop_front();
break;
}
case 'T': {
- if (arg.count() < 2) {
- while (arg.count())
- arg.pop_front();
+ if (count < 2) {
+ num += count;
+ count = 0;
break;
}
- QPointF e(arg[0], arg[1]);
+ QPointF e(num[0], num[1]);
+ num += 2;
+ count -= 2;
QPointF c;
if (lastMode == 'q' || lastMode == 'Q' ||
lastMode == 't' || lastMode == 'T')
@@ -1636,22 +1676,22 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
ctrlPt = c;
x = e.x();
y = e.y();
- arg.pop_front(); arg.pop_front();
break;
}
case 'a': {
- if (arg.count() < 7) {
- while (arg.count())
- arg.pop_front();
+ if (count < 7) {
+ num += count;
+ count = 0;
break;
}
- qreal rx = arg[0];
- qreal ry = arg[1];
- qreal xAxisRotation = arg[2];
- qreal largeArcFlag = arg[3];
- qreal sweepFlag = arg[4];
- qreal ex = arg[5] + offsetX;
- qreal ey = arg[6] + offsetY;
+ qreal rx = (*num++);
+ qreal ry = (*num++);
+ qreal xAxisRotation = (*num++);
+ qreal largeArcFlag = (*num++);
+ qreal sweepFlag = (*num++);
+ qreal ex = (*num++) + offsetX;
+ qreal ey = (*num++) + offsetY;
+ count -= 7;
qreal curx = x;
qreal cury = y;
pathArc(path, rx, ry, xAxisRotation, int(largeArcFlag),
@@ -1659,36 +1699,29 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
x = ex;
y = ey;
-
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
- arg.pop_front();
}
break;
case 'A': {
- if (arg.count() < 7) {
- while (arg.count())
- arg.pop_front();
+ if (count < 7) {
+ num += count;
+ count = 0;
break;
}
- qreal rx = arg[0];
- qreal ry = arg[1];
- qreal xAxisRotation = arg[2];
- qreal largeArcFlag = arg[3];
- qreal sweepFlag = arg[4];
- qreal ex = arg[5];
- qreal ey = arg[6];
+ qreal rx = (*num++);
+ qreal ry = (*num++);
+ qreal xAxisRotation = (*num++);
+ qreal largeArcFlag = (*num++);
+ qreal sweepFlag = (*num++);
+ qreal ex = (*num++);
+ qreal ey = (*num++);
+ count -= 7;
qreal curx = x;
qreal cury = y;
pathArc(path, rx, ry, xAxisRotation, int(largeArcFlag),
int(sweepFlag), ex, ey, curx, cury);
+
x = ex;
y = ey;
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
- arg.pop_front(); arg.pop_front();
- arg.pop_front();
}
break;
default:
@@ -2583,7 +2616,7 @@ static void parseBaseGradient(QSvgNode *node,
QSvgHandler *handler)
{
QString link = attributes.value(QLatin1String("xlink:href")).toString();
- QString trans = attributes.value(QLatin1String("gradientTransform")).toString();
+ QStringRef trans = attributes.value(QLatin1String("gradientTransform"));
QString spread = attributes.value(QLatin1String("spreadMethod")).toString();
QString units = attributes.value(QLatin1String("gradientUnits")).toString();