From 8f13e749d4d93277ef2f0e259e5034017d61bb5d80b076206c09c6a573bbf517 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 18 Sep 2014 05:56:35 +0000 Subject: [PATCH] Accepting request 249654 from KDE:Qt5 Update to 5.3.2 final OBS-URL: https://build.opensuse.org/request/show/249654 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtdeclarative?expand=0&rev=19 --- ...-Fix-crash-with-cleanup-of-animators.patch | 115 +++++++++++++ ...ng-in-images-stored-in-atlas-texture.patch | 39 +++++ ...-calling-Array.sort-with-imperfect-s.patch | 155 ++++++++++++++++++ ...arse-.js-files-as-JavaScript-not-QML.patch | 94 +++++++++++ ...ash-with-foreach-on-arguments-object.patch | 126 ++++++++++++++ ...imer-measurment-to-the-correct-place.patch | 44 +++++ libqt5-qtdeclarative.changes | 16 ++ libqt5-qtdeclarative.spec | 17 +- qtdeclarative-opensource-src-5.3.2.tar.xz | 4 +- 9 files changed, 606 insertions(+), 4 deletions(-) create mode 100644 0001-Fix-crash-with-cleanup-of-animators.patch create mode 100644 0002-Support-padding-in-images-stored-in-atlas-texture.patch create mode 100644 0003-Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch create mode 100644 0004-QML-parse-.js-files-as-JavaScript-not-QML.patch create mode 100644 0005-Fix-crash-with-foreach-on-arguments-object.patch create mode 100644 0006-Move-syncTimer-measurment-to-the-correct-place.patch diff --git a/0001-Fix-crash-with-cleanup-of-animators.patch b/0001-Fix-crash-with-cleanup-of-animators.patch new file mode 100644 index 0000000..69a1b7f --- /dev/null +++ b/0001-Fix-crash-with-cleanup-of-animators.patch @@ -0,0 +1,115 @@ +From 8f3311276e4ca44acb69c8870ccfc3167682b898 Mon Sep 17 00:00:00 2001 +From: Gunnar Sletta +Date: Thu, 28 Aug 2014 11:27:02 +0200 +Subject: [PATCH 1/6] Fix crash with cleanup of animators. + +We had several separate issues relating to how the jobs were cleaned up. + +The first was that upon getting setWindow(0), the animator did not +reset m_controller to 0, leading to the starts() coming after that to +post null jobs to the controller. This would later crash in +beforeNodeSync as the starting job was null. + +The second issue was that during shutdown, QQuickAnimatorProxy +would try to delete jobs on the controller which was already +deleted. The controller is deleted on the GUI thread regardless +of render loop, so this was solved with a QPointer. + +The third was that we were a bit too aggressive in trying to clean up +jobs on the GUI thread, so we introduced a new bool which gets set to +true in startJob() so that Proxy::deleteJob() knows who owns the job. + +Task-number: QTBUG-37833 +Change-Id: I1b6221a2c1ce2bfd0758801b950cda00ff6899d0 +Reviewed-by: Michael Brasser +--- + src/quick/util/qquickanimatorcontroller.cpp | 1 + + src/quick/util/qquickanimatorjob.cpp | 14 ++++++++++---- + src/quick/util/qquickanimatorjob_p.h | 4 +++- + 3 files changed, 14 insertions(+), 5 deletions(-) + +diff --git a/src/quick/util/qquickanimatorcontroller.cpp b/src/quick/util/qquickanimatorcontroller.cpp +index 697c25b..f8e24bf 100644 +--- a/src/quick/util/qquickanimatorcontroller.cpp ++++ b/src/quick/util/qquickanimatorcontroller.cpp +@@ -262,6 +262,7 @@ void QQuickAnimatorController::requestSync() + // These functions are called on the GUI thread. + void QQuickAnimatorController::startJob(QQuickAnimatorProxyJob *proxy, QAbstractAnimationJob *job) + { ++ proxy->markJobManagedByController(); + m_starting[job] = proxy; + requestSync(); + } +diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp +index 9f81f28..d61066b 100644 +--- a/src/quick/util/qquickanimatorjob.cpp ++++ b/src/quick/util/qquickanimatorjob.cpp +@@ -57,6 +57,7 @@ QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObje + : m_controller(0) + , m_job(job) + , m_internalState(State_Stopped) ++ , m_jobManagedByController(false) + { + m_isRenderThreadProxy = true; + m_animation = qobject_cast(item); +@@ -101,7 +102,10 @@ void QQuickAnimatorProxyJob::deleteJob() + // so delete it through the controller to clean up properly. + if (m_controller) + m_controller->deleteJob(m_job); +- else ++ ++ // We explicitly delete the job if the animator controller has never touched ++ // it. If it has, it will have ownership as well. ++ else if (!m_jobManagedByController) + delete m_job; + m_job = 0; + } +@@ -149,11 +153,13 @@ void QQuickAnimatorProxyJob::controllerWasDeleted() + void QQuickAnimatorProxyJob::setWindow(QQuickWindow *window) + { + if (!window) { +- // Stop will trigger syncBackCurrentValues so best to do it before +- // we delete m_job. + stop(); + deleteJob(); +- return; ++ ++ // Upon leaving a window, we reset the controller. This means that ++ // animators will only enter the Starting phase and won't be making ++ // calls to QQuickAnimatorController::startjob(). ++ m_controller = 0; + + } else if (!m_controller && m_job) { + m_controller = QQuickWindowPrivate::get(window)->animationController; +diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h +index 03b13bc..1ebf12f 100644 +--- a/src/quick/util/qquickanimatorjob_p.h ++++ b/src/quick/util/qquickanimatorjob_p.h +@@ -77,6 +77,7 @@ public: + + void startedByController(); + void controllerWasDeleted(); ++ void markJobManagedByController() { m_jobManagedByController = true; } + + protected: + bool event(QEvent *); +@@ -95,7 +96,7 @@ private: + void setWindow(QQuickWindow *window); + static QObject *findAnimationContext(QQuickAbstractAnimation *); + +- QQuickAnimatorController *m_controller; ++ QPointer m_controller; + QQuickAbstractAnimation *m_animation; + QAbstractAnimationJob *m_job; + int m_duration; +@@ -108,6 +109,7 @@ private: + }; + + InternalState m_internalState; ++ bool m_jobManagedByController; + }; + + class Q_QUICK_PRIVATE_EXPORT QQuickAnimatorJob : public QAbstractAnimationJob +-- +2.1.0 + diff --git a/0002-Support-padding-in-images-stored-in-atlas-texture.patch b/0002-Support-padding-in-images-stored-in-atlas-texture.patch new file mode 100644 index 0000000..bf41506 --- /dev/null +++ b/0002-Support-padding-in-images-stored-in-atlas-texture.patch @@ -0,0 +1,39 @@ +From cf44ee7761f2e4175f9193b42ee7296a2f3b694a Mon Sep 17 00:00:00 2001 +From: Eskil Abrahamsen Blomfeldt +Date: Fri, 29 Aug 2014 15:40:52 +0200 +Subject: [PATCH 2/6] Support padding in images stored in atlas texture + +If the stride does not match the width of the image, we upload +it line-by-line instead of as one big rect. + +Change-Id: I5e08afcf5c35dc810fed25e45255d55d932b2a4c +Reviewed-by: Gunnar Sletta +--- + src/quick/scenegraph/util/qsgatlastexture.cpp | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp +index 782beca..53b3110 100644 +--- a/src/quick/scenegraph/util/qsgatlastexture.cpp ++++ b/src/quick/scenegraph/util/qsgatlastexture.cpp +@@ -319,7 +319,16 @@ void Atlas::uploadBgra(Texture *texture) + glTexSubImage2D(GL_TEXTURE_2D, 0, r.x() + iw + 1, r.y() + 1, 1, ih, m_externalFormat, GL_UNSIGNED_BYTE, dst); + + // Inner part of the image.... +- glTexSubImage2D(GL_TEXTURE_2D, 0, r.x() + 1, r.y() + 1, r.width() - 2, r.height() - 2, m_externalFormat, GL_UNSIGNED_BYTE, src); ++ if (bpl != iw) { ++ int sy = r.y() + 1; ++ int ey = sy + r.height() - 2; ++ for (int y = sy; y < ey; ++y) { ++ glTexSubImage2D(GL_TEXTURE_2D, 0, r.x() + 1, y, r.width() - 2, 1, m_externalFormat, GL_UNSIGNED_BYTE, src); ++ src += bpl; ++ } ++ } else { ++ glTexSubImage2D(GL_TEXTURE_2D, 0, r.x() + 1, r.y() + 1, r.width() - 2, r.height() - 2, m_externalFormat, GL_UNSIGNED_BYTE, src); ++ } + + } + +-- +2.1.0 + diff --git a/0003-Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch b/0003-Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch new file mode 100644 index 0000000..374c4d4 --- /dev/null +++ b/0003-Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch @@ -0,0 +1,155 @@ +From 210475565969ca5381174016b47cd32ddc96eaed Mon Sep 17 00:00:00 2001 +From: Lars Knoll +Date: Thu, 12 Jun 2014 14:35:53 +0200 +Subject: [PATCH 3/6] Fix crashes when calling Array.sort with imperfect sort + functions + +We can't use std::sort to implement Array.sort. The reason is that +std::sort expects a conformant compare function, and can do weird +things (esp. crash) when the sort function isn't conformant. + +Falling back to qSort is not possible, as the method has been +deprecated. So add a copy of the qSort implementation here, and +use that one instead. + +Fix the sortint test in tst_qqmlecmascript to have a consistent +sort function for strings, as the result of calling sort is +otherwise undefined according to the ecma standard. + +Task-number: QTBUG-39072 +Change-Id: I0602b3aa1ffa4de5006da58396f166805cf4a5e2 +Reviewed-by: Robin Burchell +Reviewed-by: Simon Hausmann +--- + src/qml/jsruntime/qv4arraydata.cpp | 56 +++++++++++++++++++++- + tests/auto/qml/qjsengine/tst_qjsengine.cpp | 19 ++++++++ + .../auto/qml/qqmlecmascript/data/sequenceSort.qml | 2 +- + 3 files changed, 75 insertions(+), 2 deletions(-) + +diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp +index 7d76a10..9627848 100644 +--- a/src/qml/jsruntime/qv4arraydata.cpp ++++ b/src/qml/jsruntime/qv4arraydata.cpp +@@ -674,6 +674,60 @@ bool ArrayElementLessThan::operator()(Value v1, Value v2) const + return p1s->toQString() < p2s->toQString(); + } + ++template ++void sortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan) ++{ ++top: ++ int span = int(end - start); ++ if (span < 2) ++ return; ++ ++ --end; ++ RandomAccessIterator low = start, high = end - 1; ++ RandomAccessIterator pivot = start + span / 2; ++ ++ if (lessThan(*end, *start)) ++ qSwap(*end, *start); ++ if (span == 2) ++ return; ++ ++ if (lessThan(*pivot, *start)) ++ qSwap(*pivot, *start); ++ if (lessThan(*end, *pivot)) ++ qSwap(*end, *pivot); ++ if (span == 3) ++ return; ++ ++ qSwap(*pivot, *end); ++ ++ while (low < high) { ++ while (low < high && lessThan(*low, *end)) ++ ++low; ++ ++ while (high > low && lessThan(*end, *high)) ++ --high; ++ ++ if (low < high) { ++ qSwap(*low, *high); ++ ++low; ++ --high; ++ } else { ++ break; ++ } ++ } ++ ++ if (lessThan(*low, *end)) ++ ++low; ++ ++ qSwap(*end, *low); ++ sortHelper(start, low, t, lessThan); ++ ++ start = low + 1; ++ ++end; ++ goto top; ++} ++ ++ + void ArrayData::sort(ExecutionContext *context, ObjectRef thisObject, const ValueRef comparefn, uint len) + { + if (!len) +@@ -765,7 +819,7 @@ void ArrayData::sort(ExecutionContext *context, ObjectRef thisObject, const Valu + ArrayElementLessThan lessThan(context, thisObject, comparefn); + + Value *begin = thisObject->arrayData->data; +- std::sort(begin, begin + len, lessThan); ++ sortHelper(begin, begin + len, *begin, lessThan); + + #ifdef CHECK_SPARSE_ARRAYS + thisObject->initSparseArray(); +diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp +index 51cd699..4b47e55 100644 +--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp ++++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp +@@ -135,6 +135,7 @@ private slots: + void reentrancy_objectCreation(); + void jsIncDecNonObjectProperty(); + void JSONparse(); ++ void arraySort(); + + void qRegExpInport_data(); + void qRegExpInport(); +@@ -2729,6 +2730,24 @@ void tst_QJSEngine::JSONparse() + QVERIFY(ret.isObject()); + } + ++void tst_QJSEngine::arraySort() ++{ ++ // tests that calling Array.sort with a bad sort function doesn't cause issues ++ // Using std::sort is e.g. not safe when used with a bad sort function and causes ++ // crashes ++ QJSEngine eng; ++ eng.evaluate("function crashMe() {" ++ " var data = [];" ++ " for (var i = 0; i < 50; i++) {" ++ " data[i] = 'whatever';" ++ " }" ++ " data.sort(function(a, b) {" ++ " return -1;" ++ " });" ++ "}" ++ "crashMe();"); ++} ++ + static QRegExp minimal(QRegExp r) { r.setMinimal(true); return r; } + + void tst_QJSEngine::qRegExpInport_data() +diff --git a/tests/auto/qml/qqmlecmascript/data/sequenceSort.qml b/tests/auto/qml/qqmlecmascript/data/sequenceSort.qml +index 5e2892a..b130408 100644 +--- a/tests/auto/qml/qqmlecmascript/data/sequenceSort.qml ++++ b/tests/auto/qml/qqmlecmascript/data/sequenceSort.qml +@@ -23,7 +23,7 @@ Item { + } + + function compareStrings(a, b) { +- return (a < b) ? 1 : -1; ++ return (a == b) ? 0 : ((a < b) ? 1 : -1); + } + + function compareNumbers(a, b) { +-- +2.1.0 + diff --git a/0004-QML-parse-.js-files-as-JavaScript-not-QML.patch b/0004-QML-parse-.js-files-as-JavaScript-not-QML.patch new file mode 100644 index 0000000..12e16e7 --- /dev/null +++ b/0004-QML-parse-.js-files-as-JavaScript-not-QML.patch @@ -0,0 +1,94 @@ +From f7c3035fa1d965dceb36892122683a5ceb6cab89 Mon Sep 17 00:00:00 2001 +From: Erik Verbruggen +Date: Thu, 28 Aug 2014 13:12:53 +0200 +Subject: [PATCH 4/6] QML: parse .js files as JavaScript, not QML. + +When importing a JS library into a QML file with the "import" keyword, +that JS file was parsed in QML mode, disallowing QML keywords like "as". + +Task-number: QTBUG-40143 +Change-Id: Ie98adceb27544732c2e96657d41170db36bff288 +Reviewed-by: Simon Hausmann +--- + src/qml/jsruntime/qv4script.cpp | 2 +- + .../qml/qqmlecmascript/data/importScriptsWithoutQmlMode.js | 7 +++++++ + .../qml/qqmlecmascript/data/importScriptsWithoutQmlMode.qml | 10 ++++++++++ + tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 11 +++++++++++ + 4 files changed, 29 insertions(+), 1 deletion(-) + create mode 100644 tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.js + create mode 100644 tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.qml + +diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp +index 36f61a1..4d6e069 100644 +--- a/src/qml/jsruntime/qv4script.cpp ++++ b/src/qml/jsruntime/qv4script.cpp +@@ -349,7 +349,7 @@ QV4::CompiledData::CompilationUnit *Script::precompile(IR::Module *module, Compi + + QQmlJS::Engine ee; + QQmlJS::Lexer lexer(&ee); +- lexer.setCode(source, /*line*/1, /*qml mode*/true); ++ lexer.setCode(source, /*line*/1, /*qml mode*/false); + QQmlJS::Parser parser(&ee); + + parser.parseProgram(); +diff --git a/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.js b/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.js +new file mode 100644 +index 0000000..aabcc9f +--- /dev/null ++++ b/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.js +@@ -0,0 +1,7 @@ ++.pragma library ++ ++var as = undefined ++function isLegal() { ++ var as = true; ++ return as; ++} +diff --git a/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.qml b/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.qml +new file mode 100644 +index 0000000..17d1219 +--- /dev/null ++++ b/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.qml +@@ -0,0 +1,10 @@ ++import QtQuick 2.0 ++ ++import "importScriptsWithoutQmlMode.js" as Export ++ ++Rectangle { ++ id: root ++ property bool success: false ++ ++ Component.onCompleted: success = Export.isLegal() ++} +diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +index 34413b2..7e9adea 100644 +--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp ++++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +@@ -321,6 +321,7 @@ private slots: + void lazyBindingEvaluation(); + void varPropertyAccessOnObjectWithInvalidContext(); + void importedScriptsAccessOnObjectWithInvalidContext(); ++ void importedScriptsWithoutQmlMode(); + void contextObjectOnLazyBindings(); + void garbageCollectionDuringCreation(); + +@@ -7609,6 +7610,16 @@ void tst_qqmlecmascript::importedScriptsAccessOnObjectWithInvalidContext() + QTRY_VERIFY(obj->property("success") == true); + } + ++void tst_qqmlecmascript::importedScriptsWithoutQmlMode() ++{ ++ QQmlComponent component(&engine, testFileUrl("importScriptsWithoutQmlMode.qml")); ++ QScopedPointer obj(component.create()); ++ if (obj.isNull()) ++ qDebug() << component.errors().first().toString(); ++ QVERIFY(!obj.isNull()); ++ QTRY_VERIFY(obj->property("success") == true); ++} ++ + void tst_qqmlecmascript::contextObjectOnLazyBindings() + { + QQmlComponent component(&engine, testFileUrl("contextObjectOnLazyBindings.qml")); +-- +2.1.0 + diff --git a/0005-Fix-crash-with-foreach-on-arguments-object.patch b/0005-Fix-crash-with-foreach-on-arguments-object.patch new file mode 100644 index 0000000..e31e192 --- /dev/null +++ b/0005-Fix-crash-with-foreach-on-arguments-object.patch @@ -0,0 +1,126 @@ +From 4d07bf91ed2d36aee9178ef48508c16277fbb318 Mon Sep 17 00:00:00 2001 +From: Simon Hausmann +Date: Thu, 21 Aug 2014 16:24:54 +0200 +Subject: [PATCH 5/6] Fix crash with foreach on arguments object + +We call fullyCreate() on the arguments object when it's initialized +on an foreach iterator. That itself however might trigger an allocation, +which in turn might collect the ForEachIteratorObject, which is missing +a "ProtectThis" in its constructor. + +Change-Id: Ib8f7e39201e727cde91cbbe8a82cba78aa980f0d +Task-number: QTBUG-40844 +Reviewed-by: Albert Astals Cid +Reviewed-by: Lars Knoll +--- + src/qml/jsruntime/qv4objectiterator.cpp | 40 +++++++++++++++++++++++++-------- + src/qml/jsruntime/qv4objectiterator_p.h | 11 ++++----- + 2 files changed, 37 insertions(+), 14 deletions(-) + +diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp +index e5f693c..0efd304 100644 +--- a/src/qml/jsruntime/qv4objectiterator.cpp ++++ b/src/qml/jsruntime/qv4objectiterator.cpp +@@ -54,13 +54,7 @@ ObjectIterator::ObjectIterator(Value *scratch1, Value *scratch2, const ObjectRef + , memberIndex(0) + , flags(flags) + { +- object = o.getPointer(); +- current = o.getPointer(); +- +- if (!!object && object->asArgumentsObject()) { +- Scope scope(object->engine()); +- Scoped (scope, object->asReturnedValue())->fullyCreate(); +- } ++ init(o); + } + + ObjectIterator::ObjectIterator(Scope &scope, const ObjectRef o, uint flags) +@@ -71,8 +65,26 @@ ObjectIterator::ObjectIterator(Scope &scope, const ObjectRef o, uint flags) + , memberIndex(0) + , flags(flags) + { +- object = o; +- current = o; ++ init(o); ++} ++ ++ObjectIterator::ObjectIterator(Value *scratch1, Value *scratch2, uint flags) ++ : object(ObjectRef::fromValuePointer(scratch1)) ++ , current(ObjectRef::fromValuePointer(scratch2)) ++ , arrayNode(0) ++ , arrayIndex(0) ++ , memberIndex(0) ++ , flags(flags) ++{ ++ object = (Object*)0; ++ current = (Object*)0; ++ // Caller needs to call init! ++} ++ ++void ObjectIterator::init(const ObjectRef o) ++{ ++ object = o.getPointer(); ++ current = o.getPointer(); + + if (!!object && object->asArgumentsObject()) { + Scope scope(object->engine()); +@@ -194,6 +206,16 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString() + + DEFINE_OBJECT_VTABLE(ForEachIteratorObject); + ++ForEachIteratorObject::ForEachIteratorObject(ExecutionContext *ctx, const ObjectRef o) ++ : Object(ctx->engine), it(workArea, workArea + 1, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) ++{ ++ Scope scope(ctx); ++ ScopedObject protectThis(scope, this); ++ ++ setVTable(staticVTable()); ++ it.init(o); ++} ++ + void ForEachIteratorObject::markObjects(Managed *that, ExecutionEngine *e) + { + ForEachIteratorObject *o = static_cast(that); +diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h +index c87f284..5ead1f5 100644 +--- a/src/qml/jsruntime/qv4objectiterator_p.h ++++ b/src/qml/jsruntime/qv4objectiterator_p.h +@@ -58,6 +58,7 @@ struct ExecutionContext; + struct Property; + struct String; + struct InternalClass; ++struct ForEachIteratorObject; + + struct Q_QML_EXPORT ObjectIterator + { +@@ -76,21 +77,21 @@ struct Q_QML_EXPORT ObjectIterator + + ObjectIterator(Value *scratch1, Value *scratch2, const ObjectRef o, uint flags); + ObjectIterator(Scope &scope, const ObjectRef o, uint flags); ++ void init(const ObjectRef o); + void next(StringRef name, uint *index, Property *pd, PropertyAttributes *attributes = 0); + ReturnedValue nextPropertyName(ValueRef value); + ReturnedValue nextPropertyNameAsString(ValueRef value); + ReturnedValue nextPropertyNameAsString(); ++private: ++ friend struct ForEachIteratorObject; ++ ObjectIterator(Value *scratch1, Value *scratch2, uint flags); // Constructor that requires calling init() + }; + + struct ForEachIteratorObject: Object { + V4_OBJECT + Q_MANAGED_TYPE(ForeachIteratorObject) + ObjectIterator it; +- ForEachIteratorObject(ExecutionContext *ctx, const ObjectRef o) +- : Object(ctx->engine), it(workArea, workArea + 1, +- o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) { +- setVTable(staticVTable()); +- } ++ ForEachIteratorObject(ExecutionContext *ctx, const ObjectRef o); + + ReturnedValue nextPropertyName() { return it.nextPropertyNameAsString(); } + +-- +2.1.0 + diff --git a/0006-Move-syncTimer-measurment-to-the-correct-place.patch b/0006-Move-syncTimer-measurment-to-the-correct-place.patch new file mode 100644 index 0000000..a07288d --- /dev/null +++ b/0006-Move-syncTimer-measurment-to-the-correct-place.patch @@ -0,0 +1,44 @@ +From 5a9f0131f8c0b7424a4d323b0f65237206be45ea Mon Sep 17 00:00:00 2001 +From: Josh Arenson +Date: Mon, 4 Aug 2014 09:42:27 -0700 +Subject: [PATCH 6/6] Move syncTimer measurment to the correct place. + +syncTimer was including the time spent waiting for VSYNC on unchanged +frames. This was causing the reported value to be much higher than expected. + +Task-number: QTBUG-40556 +Change-Id: Ife759b4e27faf2124ab330be8d1f42d15c4d2d33 +Reviewed-by: Gunnar Sletta +--- + src/quick/scenegraph/qsgthreadedrenderloop.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp +index c17eb91..1cfc689 100644 +--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp ++++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp +@@ -586,6 +586,10 @@ void QSGRenderThread::syncAndRender() + QSG_RT_DEBUG(" - update pending, doing sync"); + sync(); + } ++#ifndef QSG_NO_RENDER_TIMING ++ if (profileFrames) ++ syncTime = threadTimer.nsecsElapsed(); ++#endif + + if (!syncResultedInChanges && !(repaintRequested)) { + QSG_RT_DEBUG(" - no changes, rendering aborted"); +@@ -595,10 +599,6 @@ void QSGRenderThread::syncAndRender() + return; + } + +-#ifndef QSG_NO_RENDER_TIMING +- if (profileFrames) +- syncTime = threadTimer.nsecsElapsed(); +-#endif + QSG_RT_DEBUG(" - rendering starting"); + + QQuickWindowPrivate *d = QQuickWindowPrivate::get(window); +-- +2.1.0 + diff --git a/libqt5-qtdeclarative.changes b/libqt5-qtdeclarative.changes index c50c85f..e0143fc 100644 --- a/libqt5-qtdeclarative.changes +++ b/libqt5-qtdeclarative.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Tue Sep 16 11:27:49 UTC 2014 - hrvoje.senjan@gmail.com + +- Update to 5.3.2 final + * No changes since previous snapshot + * Use official tars +- Added patches from upstream 5.3 branch: + 0001-Fix-crash-with-cleanup-of-animators.patch (QTBUG#37833), + 0002-Support-padding-in-images-stored-in-atlas-texture.patch, + 0003-Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch + (QTBUG#39072), + 0004-QML-parse-.js-files-as-JavaScript-not-QML.patch (QTBUG#40143), + 0005-Fix-crash-with-foreach-on-arguments-object.patch (QTBUG#40844) + and 0006-Move-syncTimer-measurment-to-the-correct-place.patch + (QTBUG#40556) + ------------------------------------------------------------------- Thu Sep 4 20:37:34 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/libqt5-qtdeclarative.spec b/libqt5-qtdeclarative.spec index 9bd7612..2265664 100644 --- a/libqt5-qtdeclarative.spec +++ b/libqt5-qtdeclarative.spec @@ -16,12 +16,12 @@ # -%define qt5_snapshot 1 +%define qt5_snapshot 0 %define libname libQtQuick5 Name: libqt5-qtdeclarative -Version: 5.3.2~git20140904 +Version: 5.3.2 Release: 0 Summary: Qt 5 Declarative Library License: SUSE-LGPL-2.1-with-digia-exception-1.1 or GPL-3.0 @@ -33,6 +33,13 @@ Url: http://qt.digia.com %define tar_version qtdeclarative-opensource-src-%{real_version} Source: %{tar_version}.tar.xz Source1: baselibs.conf +# PATCHES FROM UPSTREAM 5.3 branch +Patch0: 0001-Fix-crash-with-cleanup-of-animators.patch +Patch1: 0002-Support-padding-in-images-stored-in-atlas-texture.patch +Patch2: 0003-Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch +Patch3: 0004-QML-parse-.js-files-as-JavaScript-not-QML.patch +Patch4: 0005-Fix-crash-with-foreach-on-arguments-object.patch +Patch5: 0006-Move-syncTimer-measurment-to-the-correct-place.patch BuildRequires: fdupes BuildRequires: libQt5Core-private-headers-devel >= %{version} BuildRequires: libQt5Gui-private-headers-devel >= %{version} @@ -62,6 +69,12 @@ handling. %prep %setup -q -n qtdeclarative-opensource-src-%{real_version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 %package -n %libname Summary: Qt 5 Declarative Library diff --git a/qtdeclarative-opensource-src-5.3.2.tar.xz b/qtdeclarative-opensource-src-5.3.2.tar.xz index fcd8848..688fb85 100644 --- a/qtdeclarative-opensource-src-5.3.2.tar.xz +++ b/qtdeclarative-opensource-src-5.3.2.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:02bd64b60824ac61e6e38c4ba3f2d00b757526ab420af225777cd1b5d5e01ba8 -size 18443472 +oid sha256:04108193b9642c0394c157e98b5c1d81f555f9f495289e07ebfb6f03448b2382 +size 18171760