From b78ec7dcd8b13a76703baefff1731d3f345392cc Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 8 Nov 2010 11:10:53 +0100 Subject: fix memleak in test --- tests/auto/qtextdocument/tst_qtextdocument.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp index 808299b..23f6a6c 100644 --- a/tests/auto/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp @@ -2054,6 +2054,7 @@ void tst_QTextDocument::clonePreservesIndentWidth() doc->setIndentWidth(42); QTextDocument *clone = doc->clone(); QCOMPARE(clone->indentWidth(), qreal(42)); + delete clone; } void tst_QTextDocument::blockCount() -- cgit v0.12 From 2da8d40ac2c7de25d811bac0befaef577a696065 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 8 Nov 2010 14:02:28 +0100 Subject: QNAM: Remove dead waitForDownstreamReadyRead() code Reviewed-by: Thiago Macieira --- src/network/access/qnetworkaccessbackend_p.h | 1 - src/network/access/qnetworkaccesscachebackend.cpp | 6 ------ src/network/access/qnetworkaccesscachebackend_p.h | 1 - .../access/qnetworkaccessdebugpipebackend.cpp | 6 ------ .../access/qnetworkaccessdebugpipebackend_p.h | 1 - src/network/access/qnetworkaccessfilebackend.cpp | 6 ------ src/network/access/qnetworkaccessfilebackend_p.h | 1 - src/network/access/qnetworkaccessftpbackend.cpp | 17 ----------------- src/network/access/qnetworkaccessftpbackend_p.h | 1 - src/network/access/qnetworkaccesshttpbackend.cpp | 20 -------------------- src/network/access/qnetworkaccesshttpbackend_p.h | 1 - 11 files changed, 61 deletions(-) diff --git a/src/network/access/qnetworkaccessbackend_p.h b/src/network/access/qnetworkaccessbackend_p.h index 4fe6de6..7faa5cb 100644 --- a/src/network/access/qnetworkaccessbackend_p.h +++ b/src/network/access/qnetworkaccessbackend_p.h @@ -115,7 +115,6 @@ public: virtual bool start(); #endif virtual void closeDownstreamChannel() = 0; - virtual bool waitForDownstreamReadyRead(int msecs) = 0; // slot-like: virtual void downstreamReadyWrite(); diff --git a/src/network/access/qnetworkaccesscachebackend.cpp b/src/network/access/qnetworkaccesscachebackend.cpp index 73491a9..597cbef 100644 --- a/src/network/access/qnetworkaccesscachebackend.cpp +++ b/src/network/access/qnetworkaccesscachebackend.cpp @@ -132,12 +132,6 @@ void QNetworkAccessCacheBackend::closeUpstreamChannel() Q_ASSERT_X(false, Q_FUNC_INFO, "This function show not have been called!"); } -bool QNetworkAccessCacheBackend::waitForDownstreamReadyRead(int) -{ - Q_ASSERT_X(false, Q_FUNC_INFO , "This function show not have been called!"); - return false; -} - bool QNetworkAccessCacheBackend::waitForUpstreamBytesWritten(int) { Q_ASSERT_X(false, Q_FUNC_INFO, "This function show not have been called!"); diff --git a/src/network/access/qnetworkaccesscachebackend_p.h b/src/network/access/qnetworkaccesscachebackend_p.h index df001ab..995c875 100644 --- a/src/network/access/qnetworkaccesscachebackend_p.h +++ b/src/network/access/qnetworkaccesscachebackend_p.h @@ -69,7 +69,6 @@ public: void open(); void closeDownstreamChannel(); void closeUpstreamChannel(); - bool waitForDownstreamReadyRead(int msecs); bool waitForUpstreamBytesWritten(int msecs); void upstreamReadyRead(); diff --git a/src/network/access/qnetworkaccessdebugpipebackend.cpp b/src/network/access/qnetworkaccessdebugpipebackend.cpp index cd077e7..5f99f84 100644 --- a/src/network/access/qnetworkaccessdebugpipebackend.cpp +++ b/src/network/access/qnetworkaccessdebugpipebackend.cpp @@ -278,12 +278,6 @@ void QNetworkAccessDebugPipeBackend::socketConnected() { } -bool QNetworkAccessDebugPipeBackend::waitForDownstreamReadyRead(int ms) -{ - Q_UNUSED(ms); - qCritical("QNetworkAccess: Debug pipe backend does not support waitForReadyRead()"); - return false; -} #endif diff --git a/src/network/access/qnetworkaccessdebugpipebackend_p.h b/src/network/access/qnetworkaccessdebugpipebackend_p.h index 58a4fd0..918a813 100644 --- a/src/network/access/qnetworkaccessdebugpipebackend_p.h +++ b/src/network/access/qnetworkaccessdebugpipebackend_p.h @@ -71,7 +71,6 @@ public: virtual void open(); virtual void closeDownstreamChannel(); - virtual bool waitForDownstreamReadyRead(int msecs); virtual void downstreamReadyWrite(); diff --git a/src/network/access/qnetworkaccessfilebackend.cpp b/src/network/access/qnetworkaccessfilebackend.cpp index 4560153..65f19ca 100644 --- a/src/network/access/qnetworkaccessfilebackend.cpp +++ b/src/network/access/qnetworkaccessfilebackend.cpp @@ -203,12 +203,6 @@ void QNetworkAccessFileBackend::closeDownstreamChannel() } } -bool QNetworkAccessFileBackend::waitForDownstreamReadyRead(int) -{ - Q_ASSERT(operation() == QNetworkAccessManager::GetOperation); - return readMoreFromFile(); -} - void QNetworkAccessFileBackend::downstreamReadyWrite() { Q_ASSERT_X(operation() == QNetworkAccessManager::GetOperation, "QNetworkAccessFileBackend", diff --git a/src/network/access/qnetworkaccessfilebackend_p.h b/src/network/access/qnetworkaccessfilebackend_p.h index 6df8710..d1dbe8d 100644 --- a/src/network/access/qnetworkaccessfilebackend_p.h +++ b/src/network/access/qnetworkaccessfilebackend_p.h @@ -69,7 +69,6 @@ public: virtual void open(); virtual void closeDownstreamChannel(); - virtual bool waitForDownstreamReadyRead(int msecs); virtual void downstreamReadyWrite(); diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp index 1a59011..d1a18d3 100644 --- a/src/network/access/qnetworkaccessftpbackend.cpp +++ b/src/network/access/qnetworkaccessftpbackend.cpp @@ -182,23 +182,6 @@ void QNetworkAccessFtpBackend::closeDownstreamChannel() #endif } -bool QNetworkAccessFtpBackend::waitForDownstreamReadyRead(int ms) -{ - if (!ftp) - return false; - - if (ftp->bytesAvailable()) { - ftpReadyRead(); - return true; - } - - if (ms == 0) - return false; - - qCritical("QNetworkAccess: FTP backend does not support waitForReadyRead()"); - return false; -} - void QNetworkAccessFtpBackend::downstreamReadyWrite() { if (state == Transferring && ftp && ftp->bytesAvailable()) diff --git a/src/network/access/qnetworkaccessftpbackend_p.h b/src/network/access/qnetworkaccessftpbackend_p.h index 737fa72..8a2bfc3 100644 --- a/src/network/access/qnetworkaccessftpbackend_p.h +++ b/src/network/access/qnetworkaccessftpbackend_p.h @@ -87,7 +87,6 @@ public: virtual void open(); virtual void closeDownstreamChannel(); - virtual bool waitForDownstreamReadyRead(int msecs); virtual void downstreamReadyWrite(); diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 2a0daf8..80b05a4 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -674,26 +674,6 @@ void QNetworkAccessHttpBackend::closeDownstreamChannel() // this indicates that the user closed the stream while the reply isn't finished yet } -bool QNetworkAccessHttpBackend::waitForDownstreamReadyRead(int msecs) -{ - Q_ASSERT(http); - - if (httpReply->bytesAvailable()) { - readFromHttp(); - return true; - } - - if (msecs == 0) { - // no bytes available in the socket and no waiting - return false; - } - - // ### FIXME - qCritical("QNetworkAccess: HTTP backend does not support waitForReadyRead()"); - return false; -} - - void QNetworkAccessHttpBackend::downstreamReadyWrite() { readFromHttp(); diff --git a/src/network/access/qnetworkaccesshttpbackend_p.h b/src/network/access/qnetworkaccesshttpbackend_p.h index 568b2ee..5de3429 100644 --- a/src/network/access/qnetworkaccesshttpbackend_p.h +++ b/src/network/access/qnetworkaccesshttpbackend_p.h @@ -79,7 +79,6 @@ public: virtual void open(); virtual void closeDownstreamChannel(); - virtual bool waitForDownstreamReadyRead(int msecs); virtual void downstreamReadyWrite(); virtual void setDownstreamLimited(bool b); -- cgit v0.12 From a3a84a872bb731d375a431626ccfcde5a660dd72 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 8 Nov 2010 14:08:13 +0100 Subject: QNAM: Remove dead waitForUpstreamBytesWritten() code --- src/network/access/qnetworkaccesscachebackend.cpp | 6 ------ src/network/access/qnetworkaccesscachebackend_p.h | 1 - 2 files changed, 7 deletions(-) diff --git a/src/network/access/qnetworkaccesscachebackend.cpp b/src/network/access/qnetworkaccesscachebackend.cpp index 597cbef..e78694e 100644 --- a/src/network/access/qnetworkaccesscachebackend.cpp +++ b/src/network/access/qnetworkaccesscachebackend.cpp @@ -132,12 +132,6 @@ void QNetworkAccessCacheBackend::closeUpstreamChannel() Q_ASSERT_X(false, Q_FUNC_INFO, "This function show not have been called!"); } -bool QNetworkAccessCacheBackend::waitForUpstreamBytesWritten(int) -{ - Q_ASSERT_X(false, Q_FUNC_INFO, "This function show not have been called!"); - return false; -} - void QNetworkAccessCacheBackend::upstreamReadyRead() { Q_ASSERT_X(false, Q_FUNC_INFO, "This function show not have been called!"); diff --git a/src/network/access/qnetworkaccesscachebackend_p.h b/src/network/access/qnetworkaccesscachebackend_p.h index 995c875..32581d5 100644 --- a/src/network/access/qnetworkaccesscachebackend_p.h +++ b/src/network/access/qnetworkaccesscachebackend_p.h @@ -69,7 +69,6 @@ public: void open(); void closeDownstreamChannel(); void closeUpstreamChannel(); - bool waitForUpstreamBytesWritten(int msecs); void upstreamReadyRead(); void downstreamReadyWrite(); -- cgit v0.12 From 626f13421baf258407f03e3bf21ed67138d55ea4 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 8 Nov 2010 15:03:05 +0100 Subject: Don't crash if QScriptClass property getter returns an invalid value It's possible that a class claims to have a property of a given name (i.e. queryProperty() returns true), but returns an invalid value for that property. In that case we should silently convert the value to undefined, otherwise the value may wreak havoc in JS. This is a regression from Qt 4.5 (pre-JavaScriptCore-based), which had this check. Task-number: QTBUG-15079 Reviewed-by: Jedrzej Nowacki --- src/script/bridge/qscriptclassobject.cpp | 12 ++++++++++++ tests/auto/qscriptclass/tst_qscriptclass.cpp | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/script/bridge/qscriptclassobject.cpp b/src/script/bridge/qscriptclassobject.cpp index dd229f1..228e755 100644 --- a/src/script/bridge/qscriptclassobject.cpp +++ b/src/script/bridge/qscriptclassobject.cpp @@ -78,6 +78,12 @@ bool ClassObjectDelegate::getOwnPropertySlot(QScriptObject* object, scriptObject, scriptName, QScriptClass::HandlesReadAccess, &id); if (flags & QScriptClass::HandlesReadAccess) { QScriptValue value = m_scriptClass->property(scriptObject, scriptName, id); + if (!value.isValid()) { + // The class claims to have the property, but returned an invalid + // value. Silently convert to undefined to avoid the invalid value + // "escaping" into JS. + value = QScriptValue(QScriptValue::UndefinedValue); + } slot.setValue(engine->scriptValueToJSCValue(value)); return true; } @@ -119,6 +125,12 @@ bool ClassObjectDelegate::getOwnPropertyDescriptor(QScriptObject *object, attribs |= pflags & QScriptValue::UserRange; // Rather than calling the getter, we could return an access descriptor here. QScriptValue value = m_scriptClass->property(scriptObject, scriptName, id); + if (!value.isValid()) { + // The class claims to have the property, but returned an invalid + // value. Silently convert to undefined to avoid the invalid value + // "escaping" into JS. + value = QScriptValue(QScriptValue::UndefinedValue); + } descriptor.setDescriptor(engine->scriptValueToJSCValue(value), attribs); return true; } diff --git a/tests/auto/qscriptclass/tst_qscriptclass.cpp b/tests/auto/qscriptclass/tst_qscriptclass.cpp index b4dbe73..da6c76f 100644 --- a/tests/auto/qscriptclass/tst_qscriptclass.cpp +++ b/tests/auto/qscriptclass/tst_qscriptclass.cpp @@ -66,6 +66,7 @@ public: private slots: void newInstance(); void getAndSetProperty(); + void getProperty_invalidValue(); void enumerate(); void extension(); }; @@ -741,6 +742,26 @@ void tst_QScriptClass::getAndSetProperty() QVERIFY(!obj1.property(bar).isValid()); } +void tst_QScriptClass::getProperty_invalidValue() +{ + QScriptEngine eng; + TestClass cls(&eng); + cls.addCustomProperty(eng.toStringHandle("foo"), QScriptClass::HandlesReadAccess, + /*id=*/0, QScriptValue::ReadOnly, QScriptValue()); + QScriptValue obj = eng.newObject(&cls); + + QVERIFY(obj.property("foo").isUndefined()); + + eng.globalObject().setProperty("obj", obj); + QVERIFY(eng.evaluate("obj.hasOwnProperty('foo'))").toBool()); + // The JS environment expects that a valid value is returned, + // otherwise we could crash. + QVERIFY(eng.evaluate("obj.foo").isUndefined()); + QVERIFY(eng.evaluate("obj.foo + ''").isString()); + QVERIFY(eng.evaluate("Object.getOwnPropertyDescriptor(obj, 'foo').value").isUndefined()); + QVERIFY(eng.evaluate("Object.getOwnPropertyDescriptor(obj, 'foo').value +''").isString()); +} + void tst_QScriptClass::enumerate() { QScriptEngine eng; -- cgit v0.12 From a98b9daa4cd1341ee0ce6d2cf859666db9ebda59 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 8 Nov 2010 17:23:27 +0100 Subject: QNAM: Do not need QNetworkSession in AlwaysCache load mode Move the creation code to the top of QNAM::createRequest() to avoid setting up a QNetworkSession when it is not needed. Reviewed-by: ogoffart --- src/network/access/qnetworkaccessbackend.cpp | 12 ------------ src/network/access/qnetworkaccessmanager.cpp | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp index 0a0987a..05eb6cb 100644 --- a/src/network/access/qnetworkaccessbackend.cpp +++ b/src/network/access/qnetworkaccessbackend.cpp @@ -88,18 +88,6 @@ QNetworkAccessBackendFactory::~QNetworkAccessBackendFactory() QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessManager::Operation op, const QNetworkRequest &request) { - QNetworkRequest::CacheLoadControl mode = - static_cast( - request.attribute(QNetworkRequest::CacheLoadControlAttribute, - QNetworkRequest::PreferNetwork).toInt()); - if (mode == QNetworkRequest::AlwaysCache - && (op == QNetworkAccessManager::GetOperation - || op == QNetworkAccessManager::HeadOperation)) { - QNetworkAccessBackend *backend = new QNetworkAccessCacheBackend; - backend->manager = this; - return backend; - } - if (!factoryDataShutdown) { QMutexLocker locker(&factoryData()->mutex); QNetworkAccessBackendFactoryData::ConstIterator it = factoryData()->constBegin(), diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index e5f4d5a..effd79e 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -54,6 +54,7 @@ #include "qnetworkaccessfilebackend_p.h" #include "qnetworkaccessdatabackend_p.h" #include "qnetworkaccessdebugpipebackend_p.h" +#include "qnetworkaccesscachebackend_p.h" #include "qfilenetworkreply_p.h" #include "QtCore/qbuffer.h" @@ -970,6 +971,26 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera return new QFileNetworkReply(this, req, op); } + // A request with QNetworkRequest::AlwaysCache does not need any bearer management + QNetworkRequest::CacheLoadControl mode = + static_cast( + req.attribute(QNetworkRequest::CacheLoadControlAttribute, + QNetworkRequest::PreferNetwork).toInt()); + if (mode == QNetworkRequest::AlwaysCache + && (op == QNetworkAccessManager::GetOperation + || op == QNetworkAccessManager::HeadOperation)) { + // FIXME Implement a QNetworkReplyCacheImpl instead, see QTBUG-15106 + QNetworkReplyImpl *reply = new QNetworkReplyImpl(this); + QNetworkReplyImplPrivate *priv = reply->d_func(); + priv->manager = this; + priv->backend = new QNetworkAccessCacheBackend(); + priv->backend->manager = this->d_func(); + priv->backend->setParent(reply); + priv->backend->reply = priv; + priv->setup(op, req, outgoingData); + return reply; + } + #ifndef QT_NO_BEARERMANAGEMENT // Return a disabled network reply if network access is disabled. // Except if the scheme is empty or file://. -- cgit v0.12 From 38f7873d8f3104ede6f7e70392f2e1ba2970b508 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 8 Nov 2010 16:56:39 +0000 Subject: Fix some painting issues in QDirectFBPaintEngine Inspired/rewrite of Denis Oliver Kropp's merge request (http://qt.gitorious.org/qt/qt/merge_requests/874) When blitting premultiplied source surfaces one has to set DSBLIT_SRC_PREMULTIPLY. This also reverts the erroneous 6acbf6dce98903310023284e27a65c19f9a829bc Merge-request: 903 Reviewed-by: Donald Carr --- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 4869eba..d5697e0 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -55,6 +55,7 @@ #include #include + QT_BEGIN_NAMESPACE class SurfaceCache; @@ -112,7 +113,7 @@ public: static inline int cacheCost(const QImage &img) { return img.width() * img.height() * img.depth() / 8; } #endif - void prepareForBlit(bool alpha); + void prepareForBlit(IDirectFBSurface *surface); IDirectFBSurface *surface; @@ -616,7 +617,7 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image, #if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE bool release; IDirectFBSurface *imgSurface = d->getSurface(image, &release); - d->prepareForBlit(QDirectFBScreen::hasAlphaChannel(imgSurface)); + d->prepareForBlit(imgSurface); CLIPPED_PAINT(d->blit(r, imgSurface, sr)); if (release) { #if (Q_DIRECTFB_VERSION >= 0x010000) @@ -655,8 +656,8 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, QRasterPaintEngine::drawImage(r, *img, sr); } else { QDirectFBPaintEnginePrivate::unlock(dfbData); - d->prepareForBlit(pixmap.hasAlphaChannel()); IDirectFBSurface *s = dfbData->directFBSurface(); + d->prepareForBlit(s); CLIPPED_PAINT(d->blit(r, s, sr)); } } @@ -978,7 +979,7 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m break; case QPainter::CompositionMode_SourceOver: compositionModeStatus &= ~PorterDuff_AlwaysBlend; - surface->SetPorterDuff(surface, DSPD_NONE); + surface->SetPorterDuff(surface, DSPD_SRC_OVER); break; case QPainter::CompositionMode_DestinationOver: surface->SetPorterDuff(surface, DSPD_DST_OVER); @@ -1031,13 +1032,18 @@ void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints) } } -void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha) +void QDirectFBPaintEnginePrivate::prepareForBlit(IDirectFBSurface *s) { - DFBSurfaceBlittingFlags blittingFlags = alpha ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX; + DFBSurfaceBlittingFlags blittingFlags = DSBLIT_NOFX; + if (QDirectFBScreen::isPremultiplied(QDirectFBScreen::getImageFormat(s))) + blittingFlags |= DSBLIT_SRC_PREMULTIPLY; + if (QDirectFBScreen::hasAlphaChannel(s)) + blittingFlags |= DSBLIT_BLEND_ALPHACHANNEL; if (opacity != 255) { blittingFlags |= DSBLIT_BLEND_COLORALPHA; + surface->SetColor(surface, 0xff, 0xff, 0xff, opacity); } - surface->SetColor(surface, 0xff, 0xff, 0xff, opacity); + surface->SetBlittingFlags(surface, blittingFlags); } @@ -1154,13 +1160,13 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix QPointF offset = off; Q_ASSERT(transform.type() <= QTransform::TxScale); - prepareForBlit(pixmap.hasAlphaChannel()); QPixmapData *data = pixmap.pixmapData(); Q_ASSERT(data->classId() == QPixmapData::DirectFBClass); QDirectFBPixmapData *dfbData = static_cast(data); + IDirectFBSurface *sourceSurface = dfbData->directFBSurface(); + prepareForBlit(sourceSurface); QDirectFBPaintEnginePrivate::unlock(dfbData); const QSize pixmapSize = dfbData->size(); - IDirectFBSurface *sourceSurface = dfbData->directFBSurface(); if (transform.isScaling()) { Q_ASSERT(supportsStretchBlit()); Q_ASSERT(qMin(transform.m11(), transform.m22()) >= 0); -- cgit v0.12 From 551a8648b93055afa92c2938af5cede7495fd7f5 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Mon, 8 Nov 2010 19:26:13 +0300 Subject: fix build on mingw > data.cpp:2: error: 'ushort' does not name a type > data.cpp:1133: error: 'ushort' does not name a type and lot of > data.cpp:1276: error: too many initializers for 'StringCollection' when the issue with ushort is fixed (by including qglobal.h, for example) a bunch of some new build errors occurs: > data.cpp:4: error: 'stringCollectionData' was declared 'extern' and later 'static' > data.h:54: error: previous declaration of 'stringCollectionData' > data.cpp:1131: error: redefinition of 'struct StringCollection' > data.h:48: error: previous definition of 'struct StringCollection' > data.cpp:1136: error: invalid type in declaration before '=' token > data.cpp:1136: error: conflicting declaration 'int stringCollection []' > data.h:55: error: 'stringCollection' has a previous declaration as 'StringCollection stringCollection [] > data.cpp:1279: error: 'stringCollectionCount' was declared 'extern' and later 'static' > data.h:56: error: previous declaration of 'stringCollectionCount' Merge-request: 910 Reviewed-By: Thiago Macieira --- tests/benchmarks/corelib/tools/qstring/data.cpp | 18 +++++++----------- tests/benchmarks/corelib/tools/qstring/data.h | 7 ++++++- tests/benchmarks/corelib/tools/qstring/generatelist.pl | 5 ++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/benchmarks/corelib/tools/qstring/data.cpp b/tests/benchmarks/corelib/tools/qstring/data.cpp index 6d1a069..a674336 100644 --- a/tests/benchmarks/corelib/tools/qstring/data.cpp +++ b/tests/benchmarks/corelib/tools/qstring/data.cpp @@ -1,5 +1,7 @@ +#include "data.h" + // This is a generated file - DO NOT EDIT -static const ushort stringCollectionData[] __attribute__((aligned(16))) = { +const ushort stringCollectionData[] __attribute__((aligned(16))) = { // #0 65535, 99, 111, 109, 112, 105, 108, 101, 114, 32, 118, 101, 114, 115, 105, 111, 110, 115, 47, @@ -1123,15 +1125,9 @@ static const ushort stringCollectionData[] __attribute__((aligned(16))) = { 65535, 84, 69, 65, 77, 66, 85, 73, 76, 68, 69, 82, 61, 65535,65534,65533, // 5216 - - }; -static struct StringCollection -{ - int len; - int offset1, offset2; - ushort align1, align2; -} stringCollection[] = { + +const struct StringCollection stringCollection[] = { {18, 1, 29, 3666, 106}, // #0 {18, 53, 77, 106, 1978}, // #1 {20, 97, 125, 2850, 3210}, // #2 @@ -1274,8 +1270,8 @@ static struct StringCollection {12, 5153, 5169, 130, 2930}, // #139 {12, 5185, 5201, 242, 2930}, // #140 }; -static const int stringCollectionCount = 141; -static const int stringCollectionMaxLen = 51; +const int stringCollectionCount = 141; +const int stringCollectionMaxLen = 51; // average comparison length: 12.0922 // cache-line crosses: 6 (2.1%) // alignment histogram: diff --git a/tests/benchmarks/corelib/tools/qstring/data.h b/tests/benchmarks/corelib/tools/qstring/data.h index c7a7467..ce733fb 100644 --- a/tests/benchmarks/corelib/tools/qstring/data.h +++ b/tests/benchmarks/corelib/tools/qstring/data.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef DATA_H +#define DATA_H + #include struct StringCollection @@ -49,5 +52,7 @@ struct StringCollection }; extern const ushort stringCollectionData[]; -extern StringCollection stringCollection[]; +extern const StringCollection stringCollection[]; extern const int stringCollectionCount; + +#endif // DATA_H diff --git a/tests/benchmarks/corelib/tools/qstring/generatelist.pl b/tests/benchmarks/corelib/tools/qstring/generatelist.pl index d027adb..8c8eb20 100644 --- a/tests/benchmarks/corelib/tools/qstring/generatelist.pl +++ b/tests/benchmarks/corelib/tools/qstring/generatelist.pl @@ -160,11 +160,10 @@ while (1) { $totalsize += $len; $maxlen = $len if $len > $maxlen; } -print "\n};\n"; +print "};\n"; close IN; -print "struct StringCollection stringCollection[] = {\n"; - +print "const struct StringCollection stringCollection[] = {\n"; for $i (0..$count-1) { print " {", $data[$i]->{len}, ", ", -- cgit v0.12 From e00af84cc9230df411981d2f3b9296b61d5d1c50 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 8 Nov 2010 14:12:25 -0800 Subject: DFB: Make sure QPixmap::hasAlpha is respected An IDirectFBSurface can have an alpha channel for an opaque QPixmap. This change will make sure we don't blend unless QPixmap::hasAlpha returns true. Merge-request: 913 Reviewed-by: Donald Carr --- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 34 +++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index d5697e0..c16a242 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -113,7 +113,11 @@ public: static inline int cacheCost(const QImage &img) { return img.width() * img.height() * img.depth() / 8; } #endif - void prepareForBlit(IDirectFBSurface *surface); + enum BlitFlag { + HasAlpha = 0x1, + Premultiplied = 0x2 + }; + void prepareForBlit(uint blitFlags); IDirectFBSurface *surface; @@ -617,7 +621,12 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image, #if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE bool release; IDirectFBSurface *imgSurface = d->getSurface(image, &release); - d->prepareForBlit(imgSurface); + uint blitFlags = 0; + if (image.hasAlphaChannel()) + blitFlags |= QDirectFBPaintEnginePrivate::HasAlpha; + if (QDirectFBScreen::isPremultiplied(image.format())) + blitFlags |= QDirectFBPaintEnginePrivate::Premultiplied; + d->prepareForBlit(blitFlags); CLIPPED_PAINT(d->blit(r, imgSurface, sr)); if (release) { #if (Q_DIRECTFB_VERSION >= 0x010000) @@ -657,7 +666,13 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, } else { QDirectFBPaintEnginePrivate::unlock(dfbData); IDirectFBSurface *s = dfbData->directFBSurface(); - d->prepareForBlit(s); + uint blitFlags = 0; + if (pixmap.hasAlphaChannel()) + blitFlags |= QDirectFBPaintEnginePrivate::HasAlpha; + if (QDirectFBScreen::isPremultiplied(dfbData->pixelFormat())) + blitFlags |= QDirectFBPaintEnginePrivate::Premultiplied; + + d->prepareForBlit(blitFlags); CLIPPED_PAINT(d->blit(r, s, sr)); } } @@ -1032,12 +1047,12 @@ void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints) } } -void QDirectFBPaintEnginePrivate::prepareForBlit(IDirectFBSurface *s) +void QDirectFBPaintEnginePrivate::prepareForBlit(uint flags) { DFBSurfaceBlittingFlags blittingFlags = DSBLIT_NOFX; - if (QDirectFBScreen::isPremultiplied(QDirectFBScreen::getImageFormat(s))) + if (flags & Premultiplied) blittingFlags |= DSBLIT_SRC_PREMULTIPLY; - if (QDirectFBScreen::hasAlphaChannel(s)) + if (flags & HasAlpha) blittingFlags |= DSBLIT_BLEND_ALPHACHANNEL; if (opacity != 255) { blittingFlags |= DSBLIT_BLEND_COLORALPHA; @@ -1164,7 +1179,12 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix Q_ASSERT(data->classId() == QPixmapData::DirectFBClass); QDirectFBPixmapData *dfbData = static_cast(data); IDirectFBSurface *sourceSurface = dfbData->directFBSurface(); - prepareForBlit(sourceSurface); + uint blitFlags = 0; + if (dfbData->hasAlphaChannel()) + blitFlags |= HasAlpha; + if (QDirectFBScreen::isPremultiplied(dfbData->pixelFormat())) + blitFlags |= Premultiplied; + prepareForBlit(blitFlags); QDirectFBPaintEnginePrivate::unlock(dfbData); const QSize pixmapSize = dfbData->size(); if (transform.isScaling()) { -- cgit v0.12 From a55c13c52822f337cc4ad708881fd54d3a1bbb1d Mon Sep 17 00:00:00 2001 From: juhvu Date: Tue, 9 Nov 2010 10:45:18 +1000 Subject: Removed implicity QtGui linking from icd.pro as it is not needed. Task-number: QTBUG-15059 --- src/plugins/bearer/icd/icd.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bearer/icd/icd.pro b/src/plugins/bearer/icd/icd.pro index 464cc1c..6700cda 100644 --- a/src/plugins/bearer/icd/icd.pro +++ b/src/plugins/bearer/icd/icd.pro @@ -1,7 +1,7 @@ TARGET = qicdbearer include(../../qpluginbase.pri) -QT += network dbus +QT = core network dbus QMAKE_CXXFLAGS *= $$QT_CFLAGS_DBUS $$QT_CFLAGS_CONNSETTINGS LIBS += $$QT_LIBS_CONNSETTINGS -- cgit v0.12 From bb8f085611f4cb91b7bde7220d407948edcc572c Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Tue, 9 Nov 2010 11:19:01 +1000 Subject: get rid of dependency on QtGui Task-number: QTBUG-15059 Reviewed-by: trustme --- src/plugins/bearer/corewlan/corewlan.pro | 2 +- src/plugins/bearer/corewlan/qcorewlanengine.mm | 85 +++++++++++++++----------- 2 files changed, 51 insertions(+), 36 deletions(-) diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro index 922a501..9cb3955 100644 --- a/src/plugins/bearer/corewlan/corewlan.pro +++ b/src/plugins/bearer/corewlan/corewlan.pro @@ -1,7 +1,7 @@ TARGET = qcorewlanbearer include(../../qpluginbase.pri) -QT = core gui network +QT = core network LIBS += -framework Foundation -framework SystemConfiguration contains(QT_CONFIG, corewlan) { diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index 844e38b..9946b17 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -64,12 +64,17 @@ #include #include -#include #include "private/qcore_mac_p.h" #include #include +inline QString qt_NSStringToQString(const NSString *nsstr) +{ return QCFString::toQString(reinterpret_cast(nsstr)); } + +inline NSString *qt_QStringToNSString(const QString &qstr) +{ return [reinterpret_cast(QCFString::toCFStringRef(qstr)) autorelease]; } + @interface QT_MANGLE_NAMESPACE(QNSListener) : NSObject { @@ -93,11 +98,12 @@ - (id) init { [locker lock]; - QMacCocoaAutoReleasePool pool; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; notificationCenter = [NSNotificationCenter defaultCenter]; currentInterface = [CWInterface interfaceWithName:nil]; [notificationCenter addObserver:self selector:@selector(notificationHandler:) name:kCWPowerDidChangeNotification object:nil]; [locker unlock]; + [autoreleasepool release]; return self; } @@ -161,10 +167,10 @@ void QScanThread::quit() void QScanThread::run() { - QMacCocoaAutoReleasePool pool; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; QStringList found; mutex.lock(); - CWInterface *currentInterface = [CWInterface interfaceWithName:qt_mac_QStringToNSString(interfaceName)]; + CWInterface *currentInterface = [CWInterface interfaceWithName:qt_QStringToNSString(interfaceName)]; mutex.unlock(); if([currentInterface power]) { @@ -182,14 +188,14 @@ void QScanThread::run() for(uint row=0; row < [apArray count]; row++ ) { apNetwork = [apArray objectAtIndex:row]; - const QString networkSsid = qt_mac_NSStringToQString([apNetwork ssid]); + const QString networkSsid = qt_NSStringToQString([apNetwork ssid]); const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkSsid)); found.append(id); QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined; bool known = isKnownSsid(networkSsid); if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) { - if( networkSsid == qt_mac_NSStringToQString( [currentInterface ssid])) { + if( networkSsid == qt_NSStringToQString( [currentInterface ssid])) { state = QNetworkConfiguration::Active; } } @@ -232,7 +238,7 @@ void QScanThread::run() } if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) { - if( networkSsid == qt_mac_NSStringToQString([currentInterface ssid])) { + if( networkSsid == qt_NSStringToQString([currentInterface ssid])) { state = QNetworkConfiguration::Active; } } @@ -251,6 +257,7 @@ void QScanThread::run() } } emit networksChanged(); + [autoreleasepool release]; } QStringList QScanThread::foundNetwork(const QString &id, const QString &name, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose) @@ -290,7 +297,7 @@ void QScanThread::getUserConfigurations() { QMutexLocker locker(&mutex); - QMacCocoaAutoReleasePool pool; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; userProfiles.clear(); NSArray *wifiInterfaces = [CWInterface supportedInterfaces]; @@ -310,10 +317,10 @@ void QScanThread::getUserConfigurations() NSArray *thisSsidarray = [prefNetDict valueForKey:@"SSID_STR"]; for(NSString *ssidkey in thisSsidarray) { - QString thisSsid = qt_mac_NSStringToQString(ssidkey); + QString thisSsid = qt_NSStringToQString(ssidkey); if(!userProfiles.contains(thisSsid)) { QMap map; - map.insert(thisSsid, qt_mac_NSStringToQString(nsInterfaceName)); + map.insert(thisSsid, qt_NSStringToQString(nsInterfaceName)); userProfiles.insert(thisSsid, map); } } @@ -322,7 +329,7 @@ void QScanThread::getUserConfigurations() // 802.1X user profiles QString userProfilePath = QDir::homePath() + "/Library/Preferences/com.apple.eap.profiles.plist"; - NSDictionary* eapDict = [[[NSDictionary alloc] initWithContentsOfFile:qt_mac_QStringToNSString(userProfilePath)] autorelease]; + NSDictionary* eapDict = [[[NSDictionary alloc] initWithContentsOfFile:qt_QStringToNSString(userProfilePath)] autorelease]; if(eapDict != nil) { NSString *profileStr= @"Profiles"; NSString *nameStr = @"UserDefinedName"; @@ -341,15 +348,15 @@ void QScanThread::getUserConfigurations() QString ssid; for(int i = 0; i < dictSize; i++) { if([nameStr isEqualToString:keys[i]]) { - networkName = qt_mac_NSStringToQString(objects[i]); + networkName = qt_NSStringToQString(objects[i]); } if([networkSsidStr isEqualToString:keys[i]]) { - ssid = qt_mac_NSStringToQString(objects[i]); + ssid = qt_NSStringToQString(objects[i]); } if(!userProfiles.contains(networkName) && !ssid.isEmpty()) { QMap map; - map.insert(ssid, qt_mac_NSStringToQString(nsInterfaceName)); + map.insert(ssid, qt_NSStringToQString(nsInterfaceName)); userProfiles.insert(networkName, map); } } @@ -358,6 +365,7 @@ void QScanThread::getUserConfigurations() } } } + [autoreleasepool release]; } QString QScanThread::getSsidFromNetworkName(const QString &name) @@ -434,7 +442,7 @@ QCoreWlanEngine::~QCoreWlanEngine() void QCoreWlanEngine::initialize() { QMutexLocker locker(&mutex); - QMacCocoaAutoReleasePool pool; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; if([[CWInterface supportedInterfaces] count] > 0 && !listener) { listener = [[QT_MANGLE_NAMESPACE(QNSListener) alloc] init]; @@ -446,6 +454,7 @@ void QCoreWlanEngine::initialize() storeSession = NULL; startNetworkChangeLoop(); + [autoreleasepool release]; } @@ -466,11 +475,11 @@ bool QCoreWlanEngine::hasIdentifier(const QString &id) void QCoreWlanEngine::connectToId(const QString &id) { QMutexLocker locker(&mutex); - QMacCocoaAutoReleasePool pool; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; QString interfaceString = getInterfaceFromId(id); CWInterface *wifiInterface = - [CWInterface interfaceWithName: qt_mac_QStringToNSString(interfaceString)]; + [CWInterface interfaceWithName: qt_QStringToNSString(interfaceString)]; if ([wifiInterface power]) { NSError *err = nil; @@ -488,9 +497,9 @@ void QCoreWlanEngine::connectToId(const QString &id) NSArray *array = [CW8021XProfile allUser8021XProfiles]; for (NSUInteger i = 0; i < [array count]; ++i) { - const QString networkNameHashCheck = QString::number(qHash(QLatin1String("corewlan:") + qt_mac_NSStringToQString([[array objectAtIndex:i] userDefinedName]))); + const QString networkNameHashCheck = QString::number(qHash(QLatin1String("corewlan:") + qt_NSStringToQString([[array objectAtIndex:i] userDefinedName]))); - const QString ssidHash = QString::number(qHash(QLatin1String("corewlan:") + qt_mac_NSStringToQString([[array objectAtIndex:i] ssid]))); + const QString ssidHash = QString::number(qHash(QLatin1String("corewlan:") + qt_NSStringToQString([[array objectAtIndex:i] ssid]))); if (id == networkNameHashCheck || id == ssidHash) { const QString thisName = scanThread->getSsidFromNetworkName(id); @@ -523,7 +532,7 @@ void QCoreWlanEngine::connectToId(const QString &id) [NSNumber numberWithBool:YES], kCWScanKeyMerge, [NSNumber numberWithInt:kCWScanTypeFast], kCWScanKeyScanType, [NSNumber numberWithInteger:100], kCWScanKeyRestTime, - qt_mac_QStringToNSString(wantedSsid), kCWScanKeySSID, + qt_QStringToNSString(wantedSsid), kCWScanKeySSID, nil]; NSArray *scanArray = [wifiInterface scanForNetworksWithParameters:scanParameters error:&err]; @@ -532,7 +541,7 @@ void QCoreWlanEngine::connectToId(const QString &id) for(uint row=0; row < [scanArray count]; row++ ) { CWNetwork *apNetwork = [scanArray objectAtIndex:row]; - if(wantedSsid == qt_mac_NSStringToQString([apNetwork ssid])) { + if(wantedSsid == qt_NSStringToQString([apNetwork ssid])) { if(!using8021X) { SecKeychainAttribute attributes[3]; @@ -599,18 +608,19 @@ void QCoreWlanEngine::connectToId(const QString &id) return; } } else { - qDebug() <<"associate ERROR"<< qt_mac_NSStringToQString([err localizedDescription ]); + qDebug() <<"associate ERROR"<< qt_NSStringToQString([err localizedDescription ]); } } } //end scan network } else { - qDebug() <<"scan ERROR"<< qt_mac_NSStringToQString([err localizedDescription ]); + qDebug() <<"scan ERROR"<< qt_NSStringToQString([err localizedDescription ]); } emit connectionError(id, InterfaceLookupError); } locker.unlock(); emit connectionError(id, InterfaceLookupError); + [autoreleasepool release]; } void QCoreWlanEngine::disconnectFromId(const QString &id) @@ -618,10 +628,10 @@ void QCoreWlanEngine::disconnectFromId(const QString &id) QMutexLocker locker(&mutex); QString interfaceString = getInterfaceFromId(id); - QMacCocoaAutoReleasePool pool; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; CWInterface *wifiInterface = - [CWInterface interfaceWithName: qt_mac_QStringToNSString(interfaceString)]; + [CWInterface interfaceWithName: qt_QStringToNSString(interfaceString)]; [wifiInterface disassociate]; if ([[wifiInterface interfaceState]intValue] != kCWInterfaceStateInactive) { @@ -629,6 +639,7 @@ void QCoreWlanEngine::disconnectFromId(const QString &id) emit connectionError(id, DisconnectionError); locker.relock(); } + [autoreleasepool release]; } void QCoreWlanEngine::requestUpdate() @@ -641,27 +652,30 @@ void QCoreWlanEngine::doRequestUpdate() { QMutexLocker locker(&mutex); - QMacCocoaAutoReleasePool pool; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; NSArray *wifiInterfaces = [CWInterface supportedInterfaces]; for (uint row = 0; row < [wifiInterfaces count]; ++row) { - scanThread->interfaceName = qt_mac_NSStringToQString([wifiInterfaces objectAtIndex:row]); + scanThread->interfaceName = qt_NSStringToQString([wifiInterfaces objectAtIndex:row]); scanThread->start(); } locker.unlock(); + [autoreleasepool release]; } bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName) { QMutexLocker locker(&mutex); - + bool haswifi = false; if(hasWifi) { - QMacCocoaAutoReleasePool pool; - CWInterface *defaultInterface = [CWInterface interfaceWithName: qt_mac_QStringToNSString(wifiDeviceName)]; - if([defaultInterface power]) - return true; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + CWInterface *defaultInterface = [CWInterface interfaceWithName: qt_QStringToNSString(wifiDeviceName)]; + if([defaultInterface power]) { + haswifi = true; + } + [autoreleasepool release]; } - return false; + return haswifi; } @@ -853,7 +867,7 @@ quint64 QCoreWlanEngine::bytesReceived(const QString &id) quint64 QCoreWlanEngine::startTime(const QString &id) { QMutexLocker locker(&mutex); - QMacCocoaAutoReleasePool pool; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; quint64 timestamp = 0; NSString *filePath = @"/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist"; @@ -884,7 +898,7 @@ quint64 QCoreWlanEngine::startTime(const QString &id) bool ok = false; for(int i = 0; i < dictSize; i++) { if([ssidStr isEqualToString:keys[i]]) { - const QString ident = QString::number(qHash(QLatin1String("corewlan:") + qt_mac_NSStringToQString(objects[i]))); + const QString ident = QString::number(qHash(QLatin1String("corewlan:") + qt_NSStringToQString(objects[i]))); if(ident == id) { ok = true; } @@ -900,6 +914,7 @@ quint64 QCoreWlanEngine::startTime(const QString &id) } } } + [autoreleasepool release]; return timestamp; } -- cgit v0.12 From 8aee86b8ce4700f48b8a30752cb2293860957bb7 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 9 Nov 2010 09:20:36 +0100 Subject: Fix GC-related crash in QScriptValue::setData() Yet another missing API shim. When converting the QScriptValue to JSC, a JSCell may be allocated, which can cause the GC to trigger. If an identifier (JSC::Identifier) is then garbage collected, the destructor will try to remove itself from the currentIdentifierTable(). Because the API shim was missing, the identifier table was 0. It's difficult to create a bulletproof test for this case, but the attached test is a best effort (it crashes on my machine without the fix). Task-number: QTBUG-15144 Reviewed-by: Jedrzej Nowacki --- src/script/api/qscriptvalue.cpp | 1 + tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 13 +++++++++++++ tests/auto/qscriptvalue/tst_qscriptvalue.h | 1 + 3 files changed, 15 insertions(+) diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index f494106..e40458b 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -2036,6 +2036,7 @@ void QScriptValue::setData(const QScriptValue &data) Q_D(QScriptValue); if (!d || !d->isObject()) return; + QScript::APIShim shim(d->engine); JSC::JSValue other = d->engine->scriptValueToJSCValue(data); if (d->jscValue.inherits(&QScriptObject::info)) { QScriptObject *scriptObject = static_cast(JSC::asObject(d->jscValue)); diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index 639df36..53e2699 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -2253,6 +2253,19 @@ void tst_QScriptValue::getSetData() QVERIFY(!object.data().isValid()); } +void tst_QScriptValue::setData_QTBUG15144() +{ + QScriptEngine eng; + QScriptValue obj = eng.newObject(); + for (int i = 0; i < 10000; ++i) { + // Create an object with property 'fooN' on it, and immediately kill + // the reference to the object so it and the property name become garbage. + eng.evaluate(QString::fromLatin1("o = {}; o.foo%0 = 10; o = null;").arg(i)); + // Setting the data will cause a JS string to be allocated, which could + // trigger a GC. This should not cause a crash. + obj.setData("foodfight"); + } +} class TestScriptClass : public QScriptClass { public: diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.h b/tests/auto/qscriptvalue/tst_qscriptvalue.h index 462749a..aa6bc6c 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.h +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.h @@ -216,6 +216,7 @@ private slots: void getSetProperty(); void arrayElementGetterSetter(); void getSetData(); + void setData_QTBUG15144(); void getSetScriptClass(); void call(); void construct(); -- cgit v0.12 From 0a56b91991a4cce23634173eda4c5bafcd53230b Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 9 Nov 2010 12:39:14 +0100 Subject: Make operator QRectF const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows us to convert a QGLRect to a QRectF also in const functions. Function is inline and private, no ABI break. Reviewed-by: Samuel Rødal --- src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h index 46029b9..b8c1018 100644 --- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h +++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h @@ -93,7 +93,7 @@ struct QGLRect GLfloat right; GLfloat bottom; - operator QRectF() {return QRectF(left, top, right-left, bottom-top);} + operator QRectF() const {return QRectF(left, top, right-left, bottom-top);} }; class QGL2PEXVertexArray -- cgit v0.12 From 2ec60d5a71a560460c884be36de8fbad467fb69d Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 9 Nov 2010 17:32:15 +0100 Subject: Clear X11 structure before use This squelches valgrind warnings about uninitialized reads Task-number: QT-3973 Reviewed-by: Robert Griebl --- src/gui/kernel/qmotifdnd_x11.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qmotifdnd_x11.cpp b/src/gui/kernel/qmotifdnd_x11.cpp index 3334455..3b79129 100644 --- a/src/gui/kernel/qmotifdnd_x11.cpp +++ b/src/gui/kernel/qmotifdnd_x11.cpp @@ -385,7 +385,10 @@ static void DndReadSourceProperty(Display * dpy, static void DndWriteReceiverProperty(Display * dpy, Window window, unsigned char protocol_style) { - DndReceiverProp receiver_prop ; + DndReceiverProp receiver_prop; + + // squelch potential valgrind errors about uninitialized reads + memset(&receiver_prop, 0, sizeof(receiver_prop)); receiver_prop.byte_order = DndByteOrder() ; receiver_prop.protocol_version = DND_PROTOCOL_VERSION; -- cgit v0.12 From cd1a69ec3e27a4b6c0df692ec5bdbc9b789c74b4 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 10 Nov 2010 14:26:08 +1000 Subject: Flickable does not reposition its content when it is resized. Call fixup() after Flickable resize to ensure contents are within bounds. Task-number: QTBUG-15173 Reviewed-by: Bea Lam --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 01a8585..90cf9ed 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1029,6 +1029,13 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry, d->contentItem->setWidth(width()); emit contentWidthChanged(); } + // Make sure that we're entirely in view. + if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; + d->fixupX(); + d->fixupDuration = oldDuration; + } } if (newGeometry.height() != oldGeometry.height()) { if (yflick()) @@ -1037,6 +1044,13 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry, d->contentItem->setHeight(height()); emit contentHeightChanged(); } + // Make sure that we're entirely in view. + if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; + d->fixupY(); + d->fixupDuration = oldDuration; + } } if (changed) -- cgit v0.12 From 339f3d9ca43987dc2dba022ec964fa43c702cb12 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 10 Nov 2010 10:50:50 +0100 Subject: Fixed a shell syntax error in configure When you have EPOCROOT environment variable, but compiling for desktop Linux, the configure script showed a shell syntax error and failed to set the install prefix, making "install" target to install to the build directory. Task-number: QTBUG-15008 Reviewed-by: axis Reviewed-by: Oswald Buddenhagen --- configure | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 1b2abf4..a238300 100755 --- a/configure +++ b/configure @@ -3314,12 +3314,9 @@ if [ -z "$QT_INSTALL_PREFIX" ]; then if [ "$PLATFORM" != "$XPLATFORM" ]; then QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}" fi - elif [ -d "$EPOCROOT" ]; then - case "$XPLATFORM" in *symbian*) - QT_INSTALL_PREFIX="$EPOCROOT/epoc32/" - QT_INSTALL_LIBS="$EPOCROOT/epoc32/release/armv5/lib/" - ;; - esac + elif [ -d "$EPOCROOT" ] && echo $XPLATFORM | grep symbian > /dev/null; then + QT_INSTALL_PREFIX="$EPOCROOT/epoc32/" + QT_INSTALL_LIBS="$EPOCROOT/epoc32/release/armv5/lib/" else QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION fi -- cgit v0.12 From 7e1a598296e89e498fd0c27fc0951f059d1e6ffe Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Nov 2010 11:10:00 +0100 Subject: fix tst_headers Fix the generator and the generated file to ensure that the string "generated" appears in the first line. --- tests/benchmarks/corelib/tools/qstring/data.cpp | 3 ++- tests/benchmarks/corelib/tools/qstring/generatelist.pl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/benchmarks/corelib/tools/qstring/data.cpp b/tests/benchmarks/corelib/tools/qstring/data.cpp index a674336..d44a796 100644 --- a/tests/benchmarks/corelib/tools/qstring/data.cpp +++ b/tests/benchmarks/corelib/tools/qstring/data.cpp @@ -1,6 +1,7 @@ +// This is a generated file - DO NOT EDIT + #include "data.h" -// This is a generated file - DO NOT EDIT const ushort stringCollectionData[] __attribute__((aligned(16))) = { // #0 65535, diff --git a/tests/benchmarks/corelib/tools/qstring/generatelist.pl b/tests/benchmarks/corelib/tools/qstring/generatelist.pl index 8c8eb20..48a8518 100644 --- a/tests/benchmarks/corelib/tools/qstring/generatelist.pl +++ b/tests/benchmarks/corelib/tools/qstring/generatelist.pl @@ -103,9 +103,10 @@ sub printUshortArray($$$) { return ($offset + $headpadding, $offset + $headpadding + $len + $tailpadding); } +print "// This is a generated file - DO NOT EDIT\n\n"; + print "#include \"data.h\"\n\n"; -print "// This is a generated file - DO NOT EDIT\n"; print "const ushort stringCollectionData[] __attribute__((aligned(64))) = {\n"; $count = 0; $offset = 0; -- cgit v0.12 From 722d25d7a4fb0bc64d5bceae40019c7a8f3a9251 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 9 Nov 2010 16:44:55 +0000 Subject: Use $${EPOCROOT} variable rather than absolute paths in .pro files Task-number: QTBUG-15156 Reviewed-by: Miikka Heikkinen --- src/plugins/phonon/mmf/mmf.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index ac11188..691fc80 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -18,7 +18,7 @@ symbian { # This is necessary because both epoc32/include and Phonon contain videoplayer.h. # By making /epoc32/include the first SYSTEMINCLUDE, we ensure that # '#include ' picks up the Symbian header, as intended. - PREPEND_INCLUDEPATH = /epoc32/include + PREPEND_INCLUDEPATH = $${EPOCROOT}epoc32/include PREPEND_INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty -- cgit v0.12 From 7cc777265b5d6c5e87c86283b4061f2632952a8c Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Wed, 10 Nov 2010 14:42:24 +0100 Subject: QDeclarativeDebug: Keep source information when changing an expression Copy over the source code location of an expression when it is changed throu the debugging facilities. This enables JavaScript breakpoints to be hit even after the source code of the function has changed. Task-number: QTCREATORBUG-2824 Reviewed-by: Kai Koehne --- src/declarative/qml/qdeclarativeenginedebug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index ed28185..bffe681 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -502,7 +502,8 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId, property.write(expression); } else if (hasValidSignal(object, propertyName)) { QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString()); - QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression); + QDeclarativeExpression *oldExpression = QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression); + declarativeExpression->setSourceLocation(oldExpression->sourceFile(), oldExpression->lineNumber()); } else if (property.isProperty()) { QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context); binding->setTarget(property); -- cgit v0.12 From d3a6103783b161d6d35a00cb50fef50e73b6a4b6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 10 Nov 2010 22:35:50 +0100 Subject: remove pointless assignment of deprecated variable --- tools/qconfig/qconfig.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/qconfig/qconfig.pro b/tools/qconfig/qconfig.pro index efbfcf2..171924f 100644 --- a/tools/qconfig/qconfig.pro +++ b/tools/qconfig/qconfig.pro @@ -6,5 +6,4 @@ build_all:!build_pass { } HEADERS = feature.h featuretreemodel.h graphics.h SOURCES = main.cpp feature.cpp featuretreemodel.cpp -INTERFACES = TARGET = qconfig -- cgit v0.12 From 9637cb4f7c88594d5018c97072f77a19d737a302 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Thu, 11 Nov 2010 08:25:08 +0100 Subject: Trailing whitespace fixes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 2502 Reviewed-by: Samuel Rødal --- src/plugins/graphicssystems/meego/qmeegoextensions.cpp | 12 ++++++------ src/plugins/graphicssystems/meego/qmeegographicssystem.cpp | 12 ++++++------ src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp index 611c962..44c1eee 100644 --- a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp +++ b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp @@ -78,7 +78,7 @@ EGLNativeSharedImageTypeNOK QMeeGoExtensions::eglCreateSharedImageNOK(EGLDisplay { if (! hasImageShared) qFatal("EGL_NOK_image_shared not found but trying to use capability!"); - + return _eglCreateSharedImageNOK(dpy, image, props); } @@ -128,7 +128,7 @@ void QMeeGoExtensions::initialize() { QGLContext *ctx = (QGLContext *) QGLContext::currentContext(); qt_resolve_eglimage_gl_extensions(ctx); - + if (QEgl::hasExtension("EGL_NOK_image_shared")) { qDebug("MeegoGraphics: found EGL_NOK_image_shared"); _eglQueryImageNOK = (eglQueryImageNOKFunc) eglGetProcAddress("eglQueryImageNOK"); @@ -136,15 +136,15 @@ void QMeeGoExtensions::initialize() _eglDestroySharedImageNOK = (eglDestroySharedImageNOKFunc) eglGetProcAddress("eglDestroySharedImageNOK"); _eglLockSurfaceKHR = (eglLockSurfaceKHRFunc) eglGetProcAddress("eglLockSurfaceKHR"); _eglUnlockSurfaceKHR = (eglUnlockSurfaceKHRFunc) eglGetProcAddress("eglUnlockSurfaceKHR"); - + Q_ASSERT(_eglQueryImageNOK && _eglCreateSharedImageNOK && _eglDestroySharedImageNOK); hasImageShared = true; } - + if (QEgl::hasExtension("EGL_NOK_surface_scaling")) { qDebug("MeegoGraphics: found EGL_NOK_surface_scaling"); _eglSetSurfaceScalingNOK = (eglSetSurfaceScalingNOKFunc) eglGetProcAddress("eglSetSurfaceScalingNOK"); - + Q_ASSERT(_eglSetSurfaceScalingNOK); hasSurfaceScaling = true; } @@ -153,7 +153,7 @@ void QMeeGoExtensions::initialize() qDebug("MeegoGraphics: found EGL_KHR_lock_surface2"); _eglLockSurfaceKHR = (eglLockSurfaceKHRFunc) eglGetProcAddress("eglLockSurfaceKHR"); _eglUnlockSurfaceKHR = (eglUnlockSurfaceKHRFunc) eglGetProcAddress("eglUnlockSurfaceKHR"); - + Q_ASSERT(_eglLockSurfaceKHR && _eglUnlockSurfaceKHR); hasLockSurface = true; } diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp index 67d760c..02e1143 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp @@ -87,7 +87,7 @@ QPixmapData *QMeeGoGraphicsSystem::createPixmapData(QPixmapData::PixelType type) // explain here... not to mention fix without going crazy. // MDK QGLShareContextScope ctx(qt_gl_share_widget()->context()); - + return new QRasterPixmapData(type); } @@ -103,8 +103,8 @@ QPixmapData *QMeeGoGraphicsSystem::createPixmapData(QPixmapData *origin) if (QMeeGoPixmapData::sharedImagesMap.contains(rawResource)) return new QMeeGoPixmapData(); - } - + } + return new QRasterPixmapData(origin->pixelType()); } @@ -155,7 +155,7 @@ QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handl qFatal("For egl shared images, the soft image has to be ARGB32_Premultiplied or RGB32"); return NULL; } - + if (QMeeGoGraphicsSystem::meeGoRunning()) { QMeeGoPixmapData *pmd = new QMeeGoPixmapData; pmd->fromEGLSharedImage(handle, softImage); @@ -177,9 +177,9 @@ QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handl void QMeeGoGraphicsSystem::updateEGLSharedImagePixmap(QPixmap *pixmap) { QMeeGoPixmapData *pmd = (QMeeGoPixmapData *) pixmap->pixmapData(); - + // Basic sanity check to make sure this is really a QMeeGoPixmapData... - if (pmd->classId() != QPixmapData::OpenGLClass) + if (pmd->classId() != QPixmapData::OpenGLClass) qFatal("Trying to updated EGLSharedImage pixmap but it's not really a shared image pixmap!"); pmd->updateFromSoftImage(); diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h index 1d647f0..cb123da 100644 --- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h +++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h @@ -50,16 +50,16 @@ public: QMeeGoLivePixmapData(int w, int h, QImage::Format format); QMeeGoLivePixmapData(Qt::HANDLE h); ~QMeeGoLivePixmapData(); - + QPixmapData *createCompatiblePixmapData() const; bool scroll(int dx, int dy, const QRect &rect); void initializeThroughEGLImage(); - + QImage* lock(); bool release(QImage *img); Qt::HANDLE handle(); - + EGLSurface getSurfaceForBackingPixmap(); void destroySurfaceForPixmapData(QPixmapData* pmd); -- cgit v0.12 From d964fa923394ba50fa26d36c2c39bf4ac1fda78f Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Thu, 11 Nov 2010 08:25:09 +0100 Subject: Added MeeGo graphicssystem entry points for KHR_fence_sync. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 2502 Reviewed-by: Samuel Rødal --- .../graphicssystems/meego/qmeegoextensions.cpp | 56 +++++++++++++++++++++- .../graphicssystems/meego/qmeegoextensions.h | 22 +++++++++ 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp index 44c1eee..fd17d491d 100644 --- a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp +++ b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp @@ -47,6 +47,7 @@ bool QMeeGoExtensions::initialized = false; bool QMeeGoExtensions::hasImageShared = false; bool QMeeGoExtensions::hasSurfaceScaling = false; bool QMeeGoExtensions::hasLockSurface = false; +bool QMeeGoExtensions::hasFenceSync = false; /* Extension funcs */ @@ -54,8 +55,12 @@ typedef EGLBoolean (EGLAPIENTRY *eglQueryImageNOKFunc)(EGLDisplay, EGLImageKHR, typedef EGLNativeSharedImageTypeNOK (EGLAPIENTRY *eglCreateSharedImageNOKFunc)(EGLDisplay, EGLImageKHR, EGLint*); typedef EGLBoolean (EGLAPIENTRY *eglDestroySharedImageNOKFunc)(EGLDisplay, EGLNativeSharedImageTypeNOK); typedef EGLBoolean (EGLAPIENTRY *eglSetSurfaceScalingNOKFunc)(EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint); -typedef EGLBoolean (EGLAPIENTRY *eglLockSurfaceKHRFunc)(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRY *eglUnlockSurfaceKHRFunc)(EGLDisplay display, EGLSurface surface); +typedef EGLBoolean (EGLAPIENTRY *eglLockSurfaceKHRFunc)(EGLDisplay, EGLSurface, const EGLint*); +typedef EGLBoolean (EGLAPIENTRY *eglUnlockSurfaceKHRFunc)(EGLDisplay, EGLSurface); +typedef EGLSyncKHR (EGLAPIENTRY *eglCreateSyncKHRFunc)(EGLDisplay, EGLenum, const EGLint*); +typedef EGLBoolean (EGLAPIENTRY *eglDestroySyncKHRFunc)(EGLDisplay, EGLSyncKHR); +typedef EGLint (EGLAPIENTRY *eglClientWaitSyncKHRFunc)(EGLDisplay, EGLSyncKHR, EGLint, EGLTimeKHR); +typedef EGLBoolean (EGLAPIENTRY *eglGetSyncAttribKHRFunc)(EGLDisplay, EGLSyncKHR, EGLint, EGLint*); static eglQueryImageNOKFunc _eglQueryImageNOK = 0; static eglCreateSharedImageNOKFunc _eglCreateSharedImageNOK = 0; @@ -63,6 +68,10 @@ static eglDestroySharedImageNOKFunc _eglDestroySharedImageNOK = 0; static eglSetSurfaceScalingNOKFunc _eglSetSurfaceScalingNOK = 0; static eglLockSurfaceKHRFunc _eglLockSurfaceKHR = 0; static eglUnlockSurfaceKHRFunc _eglUnlockSurfaceKHR = 0; +static eglCreateSyncKHRFunc _eglCreateSyncKHR = 0; +static eglDestroySyncKHRFunc _eglDestroySyncKHR = 0; +static eglClientWaitSyncKHRFunc _eglClientWaitSyncKHR = 0; +static eglGetSyncAttribKHRFunc _eglGetSyncAttribKHR = 0; /* Public */ @@ -122,6 +131,38 @@ bool QMeeGoExtensions::eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surfac return _eglUnlockSurfaceKHR(display, surface); } +EGLSyncKHR QMeeGoExtensions::eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list) +{ + if (! hasFenceSync) + qFatal("EGL_KHR_fence_sync not found but trying to use capability!"); + + return _eglCreateSyncKHR(dpy, type, attrib_list); +} + +bool QMeeGoExtensions::eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) +{ + if (! hasFenceSync) + qFatal("EGL_KHR_fence_sync not found but trying to use capability!"); + + return _eglDestroySyncKHR(dpy, sync); +} + +EGLint QMeeGoExtensions::eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) +{ + if (! hasFenceSync) + qFatal("EGL_KHR_fence_sync not found but trying to use capability!"); + + return _eglClientWaitSyncKHR(dpy, sync, flags, timeout); +} + +EGLBoolean QMeeGoExtensions::eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value) +{ + if (! hasFenceSync) + qFatal("EGL_KHR_fence_sync not found but trying to use capability!"); + + return _eglGetSyncAttribKHR(dpy, sync, attribute, value); +} + /* Private */ void QMeeGoExtensions::initialize() @@ -157,5 +198,16 @@ void QMeeGoExtensions::initialize() Q_ASSERT(_eglLockSurfaceKHR && _eglUnlockSurfaceKHR); hasLockSurface = true; } + + if (QEgl::hasExtension("EGL_KHR_fence_sync")) { + qDebug("MeegoGraphics: found EGL_KHR_fence_sync"); + _eglCreateSyncKHR = (eglCreateSyncKHRFunc) eglGetProcAddress("eglCreateSyncKHR"); + _eglDestroySyncKHR = (eglDestroySyncKHRFunc) eglGetProcAddress("eglDestroySyncKHR"); + _eglClientWaitSyncKHR = (eglClientWaitSyncKHRFunc) eglGetProcAddress("eglClientWaitSyncKHR"); + _eglGetSyncAttribKHR = (eglGetSyncAttribKHRFunc) eglGetProcAddress("eglGetSyncAttribKHR"); + + Q_ASSERT(_eglCreateSyncKHR && _eglDestroySyncKHR && _eglClientWaitSyncKHR && _eglGetSyncAttribKHR); + hasFenceSync = true; + } } diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.h b/src/plugins/graphicssystems/meego/qmeegoextensions.h index 9e78caf..49a1e30 100644 --- a/src/plugins/graphicssystems/meego/qmeegoextensions.h +++ b/src/plugins/graphicssystems/meego/qmeegoextensions.h @@ -77,6 +77,23 @@ typedef void* EGLNativeSharedImageTypeNOK; #define EGL_WRITE_SURFACE_BIT_KHR 0x0002 #endif +#ifndef EGL_SYNC_FENCE_KHR +#define EGL_SYNC_FENCE_KHR 0x30F9 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) +typedef void* EGLSyncKHR; +typedef khronos_utime_nanoseconds_t EGLTimeKHR; +#endif + /* Class */ class QMeeGoExtensions @@ -90,6 +107,10 @@ public: static bool eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surface, int x, int y, int width, int height); static bool eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); static bool eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface); + static EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); + static bool eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync); + static EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); + static EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); private: static void initialize(); @@ -98,6 +119,7 @@ private: static bool hasImageShared; static bool hasSurfaceScaling; static bool hasLockSurface; + static bool hasFenceSync; }; #endif -- cgit v0.12 From 8d6c8e95f47e6be3f8db85adc2412d55a6915ac4 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Thu, 11 Nov 2010 08:25:09 +0100 Subject: Plugin-side support for creating/destroying/waiting on fence sync. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 2502 Reviewed-by: Samuel Rødal --- .../graphicssystems/meego/qmeegographicssystem.cpp | 38 ++++++++++++++++++---- .../graphicssystems/meego/qmeegographicssystem.h | 9 +++-- .../graphicssystems/meego/qmeegolivepixmapdata.cpp | 12 +++++-- .../graphicssystems/meego/qmeegolivepixmapdata.h | 3 +- 4 files changed, 49 insertions(+), 13 deletions(-) diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp index 02e1143..063af13 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp @@ -82,9 +82,9 @@ QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const QPixmapData *QMeeGoGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const { - // Long story short: without this it's possible to hit an - // uninitialized paintDevice due to a Qt bug too complex to even - // explain here... not to mention fix without going crazy. + // Long story short: without this it's possible to hit an + // unitialized paintDevice due to a Qt bug too complex to even + // explain here... not to mention fix without going crazy. // MDK QGLShareContextScope ctx(qt_gl_share_widget()->context()); @@ -218,10 +218,10 @@ QPixmapData* QMeeGoGraphicsSystem::pixmapDataFromLiveTextureHandle(Qt::HANDLE ha return new QMeeGoLivePixmapData(handle); } -QImage* QMeeGoGraphicsSystem::lockLiveTexture(QPixmap* pixmap) +QImage* QMeeGoGraphicsSystem::lockLiveTexture(QPixmap* pixmap, void* fenceSync) { QMeeGoLivePixmapData *pixmapData = static_cast(pixmap->data_ptr().data()); - return pixmapData->lock(); + return pixmapData->lock(fenceSync); } bool QMeeGoGraphicsSystem::releaseLiveTexture(QPixmap *pixmap, QImage *image) @@ -236,6 +236,20 @@ Qt::HANDLE QMeeGoGraphicsSystem::getLiveTextureHandle(QPixmap *pixmap) return pixmapData->handle(); } +void* QMeeGoGraphicsSystem::createFenceSync() +{ + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + QMeeGoExtensions::ensureInitialized(); + return QMeeGoExtensions::eglCreateSyncKHR(QEgl::display(), EGL_SYNC_FENCE_KHR, NULL); +} + +void QMeeGoGraphicsSystem::destroyFenceSync(void *fenceSync) +{ + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + QMeeGoExtensions::ensureInitialized(); + QMeeGoExtensions::eglDestroySyncKHR(QEgl::display(), fenceSync); +} + /* C API */ int qt_meego_image_to_egl_shared_image(const QImage &image) @@ -288,9 +302,9 @@ QPixmapData* qt_meego_pixmapdata_from_live_texture_handle(Qt::HANDLE handle) return QMeeGoGraphicsSystem::pixmapDataFromLiveTextureHandle(handle); } -QImage* qt_meego_live_texture_lock(QPixmap *pixmap) +QImage* qt_meego_live_texture_lock(QPixmap *pixmap, void *fenceSync) { - return QMeeGoGraphicsSystem::lockLiveTexture(pixmap); + return QMeeGoGraphicsSystem::lockLiveTexture(pixmap, fenceSync); } bool qt_meego_live_texture_release(QPixmap *pixmap, QImage *image) @@ -302,3 +316,13 @@ Qt::HANDLE qt_meego_live_texture_get_handle(QPixmap *pixmap) { return QMeeGoGraphicsSystem::getLiveTextureHandle(pixmap); } + +void* qt_meego_create_fence_sync(void) +{ + return QMeeGoGraphicsSystem::createFenceSync(); +} + +void qt_meego_destroy_fence_sync(void* fs) +{ + return QMeeGoGraphicsSystem::destroyFenceSync(fs); +} diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.h b/src/plugins/graphicssystems/meego/qmeegographicssystem.h index 2697f0f..1e50f00 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.h +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.h @@ -69,10 +69,13 @@ public: static QPixmapData *pixmapDataWithNewLiveTexture(int w, int h, QImage::Format format); static QPixmapData *pixmapDataFromLiveTextureHandle(Qt::HANDLE handle); - static QImage *lockLiveTexture(QPixmap* pixmap); + static QImage *lockLiveTexture(QPixmap* pixmap, void* fenceSync); static bool releaseLiveTexture(QPixmap *pixmap, QImage *image); static Qt::HANDLE getLiveTextureHandle(QPixmap *pixmap); + static void* createFenceSync(); + static void destroyFenceSync(void* fenceSync); + private: static bool meeGoRunning(); static EGLSurface getSurfaceForLiveTexturePixmap(QPixmap *pixmap); @@ -95,9 +98,11 @@ extern "C" { Q_DECL_EXPORT void qt_meego_set_translucent(bool translucent); Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_with_new_live_texture(int w, int h, QImage::Format format); Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_from_live_texture_handle(Qt::HANDLE handle); - Q_DECL_EXPORT QImage* qt_meego_live_texture_lock(QPixmap *pixmap); + Q_DECL_EXPORT QImage* qt_meego_live_texture_lock(QPixmap *pixmap, void *fenceSync); Q_DECL_EXPORT bool qt_meego_live_texture_release(QPixmap *pixmap, QImage *image); Q_DECL_EXPORT Qt::HANDLE qt_meego_live_texture_get_handle(QPixmap *pixmap); + Q_DECL_EXPORT void* qt_meego_create_fence_sync(void); + Q_DECL_EXPORT void qt_meego_destroy_fence_sync(void* fs); } #endif diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp index 405b765..3ef35e1 100644 --- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp +++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include "qmeegolivepixmapdata.h" -#include "qmeegoextensions.h" #include "qmeegorasterpixmapdata.h" #include #include @@ -171,11 +170,18 @@ QPixmapData *QMeeGoLivePixmapData::createCompatiblePixmapData() const return new QMeeGoRasterPixmapData(pixelType()); } -QImage* QMeeGoLivePixmapData::lock() +QImage* QMeeGoLivePixmapData::lock(EGLSyncKHR fenceSync) { QGLShareContextScope ctx(qt_gl_share_widget()->context()); QMeeGoExtensions::ensureInitialized(); + if (fenceSync) { + QMeeGoExtensions::eglClientWaitSyncKHR(QEgl::display(), + fenceSync, + EGL_SYNC_FLUSH_COMMANDS_BIT_KHR, + EGL_FOREVER_KHR); + } + void *data = 0; int pitch = 0; EGLSurface surface = 0; @@ -229,7 +235,7 @@ Qt::HANDLE QMeeGoLivePixmapData::handle() bool QMeeGoLivePixmapData::scroll(int dx, int dy, const QRect &rect) { - lock(); + lock(NULL); if (!lockedImage.isNull()) qt_scrollRectInImage(lockedImage, rect, QPoint(dx, dy)); diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h index cb123da..2c6854e 100644 --- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h +++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h @@ -43,6 +43,7 @@ #define MLIVEPIXMAPDATA_H #include +#include "qmeegoextensions.h" class QMeeGoLivePixmapData : public QGLPixmapData { @@ -56,7 +57,7 @@ public: void initializeThroughEGLImage(); - QImage* lock(); + QImage* lock(EGLSyncKHR fenceSync); bool release(QImage *img); Qt::HANDLE handle(); -- cgit v0.12 From 4e7eb76cb231fc5a8b0deb67a87c45f6760e44bb Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Thu, 11 Nov 2010 08:25:10 +0100 Subject: Helper-side support for QMeeGoFenceSync. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 2502 Reviewed-by: Samuel Rødal --- .../qmeegographicssystemhelper/qmeegofencesync.cpp | 79 ++++++++++++++++ tools/qmeegographicssystemhelper/qmeegofencesync.h | 101 +++++++++++++++++++++ .../qmeegographicssystemhelper/qmeegofencesync_p.h | 60 ++++++++++++ .../qmeegographicssystemhelper.pro | 4 +- .../qmeegolivepixmap.cpp | 9 +- .../qmeegographicssystemhelper/qmeegolivepixmap.h | 7 +- tools/qmeegographicssystemhelper/qmeegoruntime.cpp | 29 +++++- tools/qmeegographicssystemhelper/qmeegoruntime.h | 4 +- 8 files changed, 282 insertions(+), 11 deletions(-) create mode 100644 tools/qmeegographicssystemhelper/qmeegofencesync.cpp create mode 100644 tools/qmeegographicssystemhelper/qmeegofencesync.h create mode 100644 tools/qmeegographicssystemhelper/qmeegofencesync_p.h diff --git a/tools/qmeegographicssystemhelper/qmeegofencesync.cpp b/tools/qmeegographicssystemhelper/qmeegofencesync.cpp new file mode 100644 index 0000000..499e102 --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegofencesync.cpp @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmeegofencesync.h" +#include "qmeegofencesync_p.h" +#include "qmeegoruntime.h" + +/* QMeeGoFenceSyncPrivate */ + +QMeeGoFenceSyncPrivate::QMeeGoFenceSyncPrivate() : syncObject(NULL) +{ +} + +QMeeGoFenceSyncPrivate::~QMeeGoFenceSyncPrivate() +{ + if (syncObject) { + QMeeGoRuntime::destroyFenceSync(syncObject); + syncObject = NULL; + } +} + +/* QMeeGoFenceSync */ + +QMeeGoFenceSync::QMeeGoFenceSync(QWidget *parent) : QObject(parent), d_ptr(new QMeeGoFenceSyncPrivate()) +{ + Q_D(QMeeGoFenceSync); + d->q_ptr = this; +} + +QMeeGoFenceSync::~QMeeGoFenceSync() +{ +} + +void QMeeGoFenceSync::setSyncPoint() +{ + Q_D(QMeeGoFenceSync); + if (d->syncObject) + QMeeGoRuntime::destroyFenceSync(d->syncObject); + + d->syncObject = QMeeGoRuntime::createFenceSync(); +} diff --git a/tools/qmeegographicssystemhelper/qmeegofencesync.h b/tools/qmeegographicssystemhelper/qmeegofencesync.h new file mode 100644 index 0000000..2d3f5c5 --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegofencesync.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMEEGOFENCESYNC_H +#define QMEEGOFENCESYNC_H + +#include + +class QMeeGoFenceSyncPrivate; + +//! A synchronization helper for GL pipeline. +/*! + Fence syncs provide a mechanism for synchronizing access to certain GL primitives + and make it possible for the application developer to be sure that a certain point + in the GL processing pipeline has been already executed before continuing operation. + + Currently fence syncs are only useful in conjunction with QMeeGoLivePixmaps. + \code + ... + // In your paint/expose event: + QImage *image = livePixmap->lock(&someGlobalFenceSync); + // Modify the image... + livePixmap->release(image); + + painter->drawPixmap(0, 0, *livePixmap); + someGlobalFenceSync.setSyncPoint(); + ... + \endcode + + Assuming the paint/expose events come repeatedly, the lock operation + will block till the previous event completed painting the livePixmap. +*/ + +class Q_DECL_EXPORT QMeeGoFenceSync : public QObject +{ +public: + //! Constructs a new fence sync. + /*! + The fence sync is created without a sync point. You need to set the sync point manually. + */ + QMeeGoFenceSync(QWidget *parent = 0); + + //! Destructor for the fence sync. + virtual ~QMeeGoFenceSync(); + + //! Sets the fence sync. + /*! + The fence sync synchronization point should be set after all drawing has been scheduled. + Setting a synchronization point always overrides the previous point -- whetver is was + used (waited upon) or not. + */ + void setSyncPoint(); + +private: + Q_DISABLE_COPY(QMeeGoFenceSync) + Q_DECLARE_PRIVATE(QMeeGoFenceSync) + +protected: + QScopedPointer d_ptr; //! Private bits. + friend class QMeeGoLivePixmap; +}; + +#endif diff --git a/tools/qmeegographicssystemhelper/qmeegofencesync_p.h b/tools/qmeegographicssystemhelper/qmeegofencesync_p.h new file mode 100644 index 0000000..8a5d26e --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegofencesync_p.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmeegofencesync.h" + +#ifndef QMEEGOFENCESYNC_P_H +#define QMEEGOFENCESYNC_P_H + +class QMeeGoFenceSyncPrivate +{ +public: + Q_DECLARE_PUBLIC(QMeeGoFenceSync); + QMeeGoFenceSyncPrivate(); + + virtual ~QMeeGoFenceSyncPrivate(); + + void* syncObject; + + QMeeGoFenceSync *q_ptr; +}; + +#endif diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro index 7412fc3..161a31b 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro @@ -6,5 +6,5 @@ include(../../src/qbase.pri) QT += gui INCLUDEPATH += '../../src/plugins/graphicssystems/meego' -HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h -SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h +HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h +SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegofencesync.cpp diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp index d43efe2..9700581f 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp @@ -41,6 +41,7 @@ #include "qmeegolivepixmap.h" #include "qmeegolivepixmap_p.h" +#include "qmeegofencesync_p.h" #include "qmeegoruntime.h" /* QMeeGoLivePixmapPrivate */ @@ -102,10 +103,12 @@ QMeeGoLivePixmap::~QMeeGoLivePixmap() { } -QImage* QMeeGoLivePixmap::lock() +QImage* QMeeGoLivePixmap::lock(QMeeGoFenceSync *fenceSync) { - return QMeeGoRuntime::lockLiveTexture(this); - + if (fenceSync) + return QMeeGoRuntime::lockLiveTexture(this, fenceSync->d_func()->syncObject); + else + return QMeeGoRuntime::lockLiveTexture(this, NULL); } void QMeeGoLivePixmap::release(QImage *img) diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h index 7be2c4b..51b5976 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h @@ -43,6 +43,7 @@ #define QMEEGOLIVEPIXMAP_H #include +#include "qmeegofencesync.h" class QMeeGoLivePixmapPrivate; class QSharedMemory; @@ -82,8 +83,12 @@ public: //! Locks the access to the pixmap. /*! The returned image can be used for direct access. + You can optionally specify a fence sync to wait upon before unlocking. When + you specify a fence sync, you can be sure that this function will return only + when the previsouly set QMeeGoFenceSync synchronization point has been executed/passed + by the GL processing pipeline. */ - QImage* lock(); + QImage* lock(QMeeGoFenceSync *fenceSync = NULL); //! Unlocks the access to the pixmap. /*! diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp index ac627e5..2d3ee3c 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp @@ -60,9 +60,11 @@ typedef void (*QMeeGoSetSurfaceScalingFunc) (int x, int y, int w, int h); typedef void (*QMeeGoSetTranslucentFunc) (bool translucent); typedef QPixmapData* (*QMeeGoPixmapDataWithNewLiveTextureFunc) (int w, int h, QImage::Format format); typedef QPixmapData* (*QMeeGoPixmapDataFromLiveTextureHandleFunc) (Qt::HANDLE h); -typedef QImage* (*QMeeGoLiveTextureLockFunc) (QPixmap*); +typedef QImage* (*QMeeGoLiveTextureLockFunc) (QPixmap*, void* fenceSync); typedef bool (*QMeeGoLiveTextureReleaseFunc) (QPixmap*, QImage *i); typedef Qt::HANDLE (*QMeeGoLiveTextureGetHandleFunc) (QPixmap*); +typedef void* (*QMeeGoCreateFenceSyncFunc) (void); +typedef void (*QMeeGoDestroyFenceSyncFunc) (void *fs); static QMeeGoImageToEglSharedImageFunc qt_meego_image_to_egl_shared_image = NULL; static QMeeGoPixmapDataFromEglSharedImageFunc qt_meego_pixmapdata_from_egl_shared_image = NULL; @@ -77,6 +79,8 @@ static QMeeGoPixmapDataFromLiveTextureHandleFunc qt_meego_pixmapdata_from_live_t static QMeeGoLiveTextureLockFunc qt_meego_live_texture_lock = NULL; static QMeeGoLiveTextureReleaseFunc qt_meego_live_texture_release = NULL; static QMeeGoLiveTextureGetHandleFunc qt_meego_live_texture_get_handle = NULL; +static QMeeGoCreateFenceSyncFunc qt_meego_create_fence_sync = NULL; +static QMeeGoDestroyFenceSyncFunc qt_meego_destroy_fence_sync = NULL; void QMeeGoRuntime::initialize() { @@ -103,12 +107,15 @@ void QMeeGoRuntime::initialize() qt_meego_live_texture_lock = (QMeeGoLiveTextureLockFunc) library.resolve("qt_meego_live_texture_lock"); qt_meego_live_texture_release = (QMeeGoLiveTextureReleaseFunc) library.resolve("qt_meego_live_texture_release"); qt_meego_live_texture_get_handle = (QMeeGoLiveTextureGetHandleFunc) library.resolve("qt_meego_live_texture_get_handle"); + qt_meego_create_fence_sync = (QMeeGoCreateFenceSyncFunc) library.resolve("qt_meego_create_fence_sync"); + qt_meego_destroy_fence_sync = (QMeeGoDestroyFenceSyncFunc) library.resolve("qt_meego_destroy_fence_sync"); if (qt_meego_image_to_egl_shared_image && qt_meego_pixmapdata_from_egl_shared_image && qt_meego_pixmapdata_with_gl_texture && qt_meego_destroy_egl_shared_image && qt_meego_update_egl_shared_image_pixmap && qt_meego_set_surface_fixed_size && qt_meego_set_surface_scaling && qt_meego_set_translucent && qt_meego_pixmapdata_with_new_live_texture && qt_meego_pixmapdata_from_live_texture_handle && - qt_meego_live_texture_lock && qt_meego_live_texture_release && qt_meego_live_texture_get_handle) + qt_meego_live_texture_lock && qt_meego_live_texture_release && qt_meego_live_texture_get_handle && + qt_meego_create_fence_sync && qt_meego_destroy_fence_sync) { qDebug("Successfully resolved MeeGo graphics system: %s %s\n", qPrintable(libraryPrivate->fileName), qPrintable(libraryPrivate->fullVersion)); } else { @@ -191,11 +198,11 @@ QPixmapData* QMeeGoRuntime::pixmapDataFromLiveTextureHandle(Qt::HANDLE h) return qt_meego_pixmapdata_from_live_texture_handle(h); } -QImage* QMeeGoRuntime::lockLiveTexture(QPixmap *p) +QImage* QMeeGoRuntime::lockLiveTexture(QPixmap *p, void* fenceSync) { ENSURE_INITIALIZED; Q_ASSERT(qt_meego_live_texture_lock); - return qt_meego_live_texture_lock(p); + return qt_meego_live_texture_lock(p, fenceSync); } bool QMeeGoRuntime::releaseLiveTexture(QPixmap *p, QImage *i) @@ -211,3 +218,17 @@ Qt::HANDLE QMeeGoRuntime::getLiveTextureHandle(QPixmap *pixmap) Q_ASSERT(qt_meego_live_texture_get_handle); return qt_meego_live_texture_get_handle(pixmap); } + +void* QMeeGoRuntime::createFenceSync() +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_create_fence_sync); + return qt_meego_create_fence_sync(); +} + +void QMeeGoRuntime::destroyFenceSync(void *fs) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_destroy_fence_sync); + qt_meego_destroy_fence_sync(fs); +} diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.h b/tools/qmeegographicssystemhelper/qmeegoruntime.h index 6b34836..be6ff6b 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.h +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.h @@ -57,9 +57,11 @@ public: static void setTranslucent(bool translucent); static QPixmapData* pixmapDataWithNewLiveTexture(int w, int h, QImage::Format format); static QPixmapData* pixmapDataFromLiveTextureHandle(Qt::HANDLE h); - static QImage* lockLiveTexture(QPixmap *pixmap); + static QImage* lockLiveTexture(QPixmap *pixmap, void *fenceSync); static bool releaseLiveTexture(QPixmap *pixmap, QImage *image); static Qt::HANDLE getLiveTextureHandle(QPixmap *pixmap); + static void* createFenceSync(); + static void destroyFenceSync(void *fs); private: static bool initialized; -- cgit v0.12 From 86d39d4a6bfe1c7371b2a27a996db1c5ee601e91 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Thu, 11 Nov 2010 08:25:11 +0100 Subject: Removed call to glFinish, obsoleted by fence syncs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 2502 Reviewed-by: Samuel Rødal --- src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp index 3ef35e1..16096c9 100644 --- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp +++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp @@ -220,7 +220,6 @@ bool QMeeGoLivePixmapData::release(QImage* /*img*/) if (QMeeGoExtensions::eglUnlockSurfaceKHR(QEgl::display(), getSurfaceForBackingPixmap())) { lockedImage = QImage(); - glFinish(); return true; } else { lockedImage = QImage(); -- cgit v0.12 From 6ff64751994001f90bc82cb7fd25a0c20e8966eb Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Thu, 11 Nov 2010 08:25:11 +0100 Subject: Coding style: bang cleanup. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 2502 Reviewed-by: Samuel Rødal --- .../graphicssystems/meego/qmeegoextensions.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp index fd17d491d..dff80a4 100644 --- a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp +++ b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp @@ -85,7 +85,7 @@ void QMeeGoExtensions::ensureInitialized() EGLNativeSharedImageTypeNOK QMeeGoExtensions::eglCreateSharedImageNOK(EGLDisplay dpy, EGLImageKHR image, EGLint *props) { - if (! hasImageShared) + if (!hasImageShared) qFatal("EGL_NOK_image_shared not found but trying to use capability!"); return _eglCreateSharedImageNOK(dpy, image, props); @@ -93,7 +93,7 @@ EGLNativeSharedImageTypeNOK QMeeGoExtensions::eglCreateSharedImageNOK(EGLDisplay bool QMeeGoExtensions::eglQueryImageNOK(EGLDisplay dpy, EGLImageKHR image, EGLint prop, EGLint *v) { - if (! hasImageShared) + if (!hasImageShared) qFatal("EGL_NOK_image_shared not found but trying to use capability!"); return _eglQueryImageNOK(dpy, image, prop, v); @@ -101,7 +101,7 @@ bool QMeeGoExtensions::eglQueryImageNOK(EGLDisplay dpy, EGLImageKHR image, EGLin bool QMeeGoExtensions::eglDestroySharedImageNOK(EGLDisplay dpy, EGLNativeSharedImageTypeNOK img) { - if (! hasImageShared) + if (!hasImageShared) qFatal("EGL_NOK_image_shared not found but trying to use capability!"); return _eglDestroySharedImageNOK(dpy, img); @@ -109,7 +109,7 @@ bool QMeeGoExtensions::eglDestroySharedImageNOK(EGLDisplay dpy, EGLNativeSharedI bool QMeeGoExtensions::eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surface, int x, int y, int width, int height) { - if (! hasSurfaceScaling) + if (!hasSurfaceScaling) qFatal("EGL_NOK_surface_scaling not found but trying to use capability!"); return _eglSetSurfaceScalingNOK(dpy, surface, x, y, width, height); @@ -117,7 +117,7 @@ bool QMeeGoExtensions::eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surfac bool QMeeGoExtensions::eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list) { - if (! hasLockSurface) + if (!hasLockSurface) qFatal("EGL_KHR_lock_surface2 not found but trying to use capability!"); return _eglLockSurfaceKHR(display, surface, attrib_list); @@ -125,7 +125,7 @@ bool QMeeGoExtensions::eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, bool QMeeGoExtensions::eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface) { - if (! hasLockSurface) + if (!hasLockSurface) qFatal("EGL_KHR_lock_surface2 not found but trying to use capability!"); return _eglUnlockSurfaceKHR(display, surface); @@ -133,7 +133,7 @@ bool QMeeGoExtensions::eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surfac EGLSyncKHR QMeeGoExtensions::eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list) { - if (! hasFenceSync) + if (!hasFenceSync) qFatal("EGL_KHR_fence_sync not found but trying to use capability!"); return _eglCreateSyncKHR(dpy, type, attrib_list); @@ -141,7 +141,7 @@ EGLSyncKHR QMeeGoExtensions::eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, cons bool QMeeGoExtensions::eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) { - if (! hasFenceSync) + if (!hasFenceSync) qFatal("EGL_KHR_fence_sync not found but trying to use capability!"); return _eglDestroySyncKHR(dpy, sync); @@ -149,7 +149,7 @@ bool QMeeGoExtensions::eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) EGLint QMeeGoExtensions::eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) { - if (! hasFenceSync) + if (!hasFenceSync) qFatal("EGL_KHR_fence_sync not found but trying to use capability!"); return _eglClientWaitSyncKHR(dpy, sync, flags, timeout); @@ -157,7 +157,7 @@ EGLint QMeeGoExtensions::eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, E EGLBoolean QMeeGoExtensions::eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value) { - if (! hasFenceSync) + if (!hasFenceSync) qFatal("EGL_KHR_fence_sync not found but trying to use capability!"); return _eglGetSyncAttribKHR(dpy, sync, attribute, value); -- cgit v0.12 From 5feca34327eb661cc84e1d6f79052dcdbc1a09c4 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 10 Nov 2010 15:19:14 +0000 Subject: SSL: Fix crashes/hangs when retrieving CA certificates Added error handling to the certificate retrieval thread Made the certificate retrieval thread process critical (so if it crashes the process will crash instead of hang) Filter the certificate list to only fetch CA certificates which are in X.509 format (symbian also allows WAP formats, but Qt does not support these). Put the TPtr8 for asynch function parameter in the class data so it does not go out of scope while the function is in progress. Previously it was on the stack so it could be corrupted before the certificate server had finished using it. Task-number: QTBUG-15005 Task-number: QTBUG-15126 Reviewed-by: Markus Goetz --- src/network/ssl/qsslsocket_openssl.cpp | 75 ++++++++++++++++++++++++++-------- src/network/ssl/qsslsocket_openssl_p.h | 1 + 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 2910538..426b07a 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -574,7 +575,7 @@ void QSslSocketPrivate::resetDefaultCiphers() #if defined(Q_OS_SYMBIAN) CSymbianCertificateRetriever::CSymbianCertificateRetriever() : CActive(CActive::EPriorityStandard), - iSequenceError(KErrNone) + iCertificatePtr(0,0,0), iSequenceError(KErrNone) { } @@ -618,6 +619,11 @@ void CSymbianCertificateRetriever::doThreadEntryL() iCertStore = CUnifiedCertStore::NewLC(qt_s60GetRFs(), EFalse); iCertFilter = CCertAttributeFilter::NewLC(); + // only interested in CA certs + iCertFilter->SetOwnerType(ECACertificate); + // only interested in X.509 format (we don't support WAP formats) + iCertFilter->SetFormat(EX509Certificate); + // Kick off the sequence by initializing the cert store iState = Initializing; iCertStore->Initialize(iStatus); @@ -637,6 +643,7 @@ void CSymbianCertificateRetriever::doThreadEntryL() TInt CSymbianCertificateRetriever::ThreadEntryPoint(TAny* aParams) { + User::SetCritical(User::EProcessCritical); CTrapCleanup* cleanupStack = CTrapCleanup::New(); CSymbianCertificateRetriever* self = (CSymbianCertificateRetriever*) aParams; @@ -658,7 +665,17 @@ void CSymbianCertificateRetriever::ConstructL() void CSymbianCertificateRetriever::DoCancel() { - // We never cancel the sequence + switch(iState) { + case Initializing: + iCertStore->CancelInitialize(); + break; + case Listing: + iCertStore->CancelList(); + break; + case RetrievingCertificates: + iCertStore->CancelGetCert(); + break; + } } TInt CSymbianCertificateRetriever::RunError(TInt aError) @@ -671,37 +688,51 @@ TInt CSymbianCertificateRetriever::RunError(TInt aError) void CSymbianCertificateRetriever::GetCertificateL() { - CCTCertInfo* certInfo = iCertInfos[iCurrentCertIndex]; - iCertificateData.resize(certInfo->Size()); - TPtr8 des((TUint8*)iCertificateData.data(), 0, iCertificateData.size()); - iCertStore->Retrieve(*certInfo, des, iStatus); - iState = RetrievingCertificates; - SetActive(); + if (iCurrentCertIndex < iCertInfos.Count()) { + CCTCertInfo* certInfo = iCertInfos[iCurrentCertIndex++]; + iCertificateData = QByteArray(); + QT_TRYCATCH_LEAVING(iCertificateData.resize(certInfo->Size())); + iCertificatePtr.Set((TUint8*)iCertificateData.data(), 0, iCertificateData.size()); +#ifdef QSSLSOCKET_DEBUG + qDebug() << "getting " << qt_TDesC2QString(certInfo->Label()) << " size=" << certInfo->Size(); + qDebug() << "format=" << certInfo->CertificateFormat(); + qDebug() << "ownertype=" << certInfo->CertificateOwnerType(); + qDebug() << "type=" << hex << certInfo->Type().iUid; +#endif + iCertStore->Retrieve(*certInfo, iCertificatePtr, iStatus); + iState = RetrievingCertificates; + SetActive(); + } else { + //reached end of list + CActiveScheduler::Stop(); + } } void CSymbianCertificateRetriever::RunL() { +#ifdef QSSLSOCKET_DEBUG + qDebug() << "CSymbianCertificateRetriever::RunL status " << iStatus.Int() << " count " << iCertInfos.Count() << " index " << iCurrentCertIndex; +#endif switch (iState) { case Initializing: + User::LeaveIfError(iStatus.Int()); // initialise fail means pointless to continue iState = Listing; iCertStore->List(iCertInfos, *iCertFilter, iStatus); SetActive(); break; case Listing: + User::LeaveIfError(iStatus.Int()); // listing fail means pointless to continue iCurrentCertIndex = 0; GetCertificateL(); break; case RetrievingCertificates: - iCertificates->append(iCertificateData); - iCertificateData = QByteArray(); - iCurrentCertIndex++; - if (iCurrentCertIndex < iCertInfos.Count()) - GetCertificateL(); + if (iStatus.Int() == KErrNone) + iCertificates->append(iCertificateData); else - // Stop the scheduler to return to the thread entry function - CActiveScheduler::Stop(); + qWarning() << "CSymbianCertificateRetriever: failed to retreive a certificate, error " << iStatus.Int(); + GetCertificateL(); break; } } @@ -710,6 +741,10 @@ void CSymbianCertificateRetriever::RunL() QList QSslSocketPrivate::systemCaCertificates() { ensureInitialized(); +#ifdef QSSLSOCKET_DEBUG + QElapsedTimer timer; + timer.start(); +#endif QList systemCerts; #if defined(Q_OS_MAC) CFArrayRef cfCerts; @@ -808,10 +843,18 @@ QList QSslSocketPrivate::systemCaCertificates() retriever->GetCertificates(certs); foreach (const QByteArray &encodedCert, certs) { QSslCertificate cert(encodedCert, QSsl::Der); - if (!cert.isNull()) + if (!cert.isNull()) { +#ifdef QSSLSOCKET_DEBUG + qDebug() << "imported certificate: " << cert.issuerInfo(QSslCertificate::CommonName); +#endif systemCerts.append(cert); + } } #endif +#ifdef QSSLSOCKET_DEBUG + qDebug() << "systemCaCertificates retrieval time " << timer.elapsed() << "ms"; + qDebug() << "imported " << systemCerts.count() << " certificates"; +#endif return systemCerts; } diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h index dec98ae..b59a6c9 100644 --- a/src/network/ssl/qsslsocket_openssl_p.h +++ b/src/network/ssl/qsslsocket_openssl_p.h @@ -165,6 +165,7 @@ private: CCertAttributeFilter* iCertFilter; TInt iCurrentCertIndex; QByteArray iCertificateData; + TPtr8 iCertificatePtr; QList* iCertificates; TInt iSequenceError; }; -- cgit v0.12 From ea2caa8ce983f069eeeba0957b9db6b20baf82b2 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 10 Nov 2010 16:43:20 +0000 Subject: Doc: update symbian capabilities regarding SSL Testing shows some CA certs require ReadUserData depending which part of the database they are stored in. Updated docs to reflect this. Reviewed-by: Markus Goetz --- doc/src/platforms/platform-notes.qdoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index dbedc1d..9c5f3c8 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -739,6 +739,9 @@ \o \c AllFiles when \l{http://developer.symbian.org/wiki/index.php/Capabilities_%28Symbian_Signed%29/AllFiles_Capability}{accessing specific areas.} \row \o QtNetwork \o \c NetworkServices is basically always required for this module. + \o \c ReadUserData is required to include all the phone's SSL certificates in the system's default CA certificate list + (for example those added by the user or stored in the SIM card), + without this capability only the CA certs built into the phone are used. \row \o QtMultiMedia \o \c UserEnvironment if QAudioInput is used. \endtable -- cgit v0.12 From 644df27056fcd697713fe2338e6743e0fd067011 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 10 Nov 2010 16:45:29 +0000 Subject: SSL: Fix for capabilities in QSslCertificate auto test They were in wrong section of the file due to editing error and therefore ignored. Reviewed-by: Markus Goetz --- tests/auto/qsslcertificate/qsslcertificate.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/qsslcertificate/qsslcertificate.pro b/tests/auto/qsslcertificate/qsslcertificate.pro index d7671ea..b04dde3 100644 --- a/tests/auto/qsslcertificate/qsslcertificate.pro +++ b/tests/auto/qsslcertificate/qsslcertificate.pro @@ -24,5 +24,6 @@ wince*: { DEFINES += SRCDIR=\\\".\\\" } else:!symbian { DEFINES += SRCDIR=\\\"$$PWD/\\\" - TARGET.CAPABILITY = NetworkServices } + +symbian:TARGET.CAPABILITY = NetworkServices ReadUserData -- cgit v0.12