aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles
Commit message (Collapse)AuthorAgeFilesLines
* V4: allow inlining of ExecutionEngine::{qml,js}Engine()Erik Verbruggen2016-05-201-1/+1
| | | | | | | | All other changes are just to be able to include qv8engine_p.h in qv4engine_p.h Change-Id: I71ba2ec42cdc20d5c7d97a74b99b4d1ada1a5ed8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Particles: Invalidate all group IDs when groups are reset.Erik Verbruggen2016-04-282-3/+9
| | | | | | Task-number: QTBUG-52325 Change-Id: I38d90b6fb0d7468fb0916bd6dfd1cf07ace4389b Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-271-2/+0
|\ | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickimagebase.cpp src/imports/layouts/plugin.cpp Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
| * Drop the class name from shader effect material keysUlf Hermann2016-04-201-2/+0
| | | | | | | | | | | | | | | | | | | | Shader effects with equal program source code can use the same compiled shaders. There is no need to duplicate the data for each QML component. Task-number: QTBUG-42055 Change-Id: Iae86890ebf0ad6ef34a63565b8a01d0fcd903fbc Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-081-0/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change also fixes the build of two benchmarks, tst_affectors and tst_emission. Conflicts: src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro src/qml/qml/ftw/qhashfield_p.h tests/benchmarks/particles/affectors/tst_affectors.cpp tests/benchmarks/particles/emission/tst_emission.cpp tests/benchmarks/qml/pointers/pointers.pro tests/benchmarks/qml/pointers/tst_pointers.cpp tests/benchmarks/qml/qmltime/qmltime.pro tests/benchmarks/qml/qquickwindow/qquickwindow.pro Change-Id: I595309d1e183c18371cb9b07af6e4681059de3b2
| * Purge sRGB chunks from PNG.Edward Welbourne2016-03-241-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | Subjects src/particles/particleresources/noise.png to: pngcrush -ow -brute -rem allb -reduce Various tools grumble about sRGB tables in PNG images; and our handling of them doesn't pay attention to these, so purging them makes the images smaller with no loss to the images. Change-Id: I534f7c16830912fe0ee17159e50094e490b62b70 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Replace qQNaN() and friends with qt_qnan().Erik Verbruggen2016-04-051-2/+3
| | | | | | | | | | | | | | | | These constexpr functions can be inlined, and the compiler can be a bit smarter with code generation. Change-Id: I4ea87c794dd8e375749e18d273d01bb848231113 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Particles: half the number of calls to emittersChanged.Erik Verbruggen2016-03-083-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | When a particle emitter is not yet complete, calling emittersChanged through both groupChanged and systemChanged is unnecessary. Only connect to those signals once after the component is complete, and then call emittersChanged. Also do not call emittersChanged when the particle system component is not complete yet. Change-Id: I67543ce80c9235bd5f72d95352ec96e97a1cf66b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Particles: factor out t^2.Erik Verbruggen2016-03-081-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | According to IEEE754 a * t * t is not the same as a * (t * t), hence the compiler won't lift t^2 out as common expression when in another place 'a' is replaced with 'b'. Now for the particles this doesn't matter as it doesn't need super high precision, nor should any of the calculations come in overflow territory. So by manually introducing t_sq(uare), the compiler can remove duplicate t^2 calculations after inlining. Change-Id: Ibfdb054e34945d7e78eb993fdcedfae886472e83 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Particles: consistently use floats for particle data calculations.Erik Verbruggen2016-03-082-64/+64
| | | | | | | | | | | | | | | | This removes float<->double conversions, which makes the auto-vectorized code even smaller. Change-Id: Ic4319b11a3248e3034b65e7be047d99cba84716b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Particles: make many QQuickParticleData members inlinable.Erik Verbruggen2016-03-082-109/+105
| | | | | | | | | | | | | | | | | | | | Calls to these functions often occur in sets of two (x, y) or even more (x, y, vx, vy, etc). By allowing the compiler to inline, it allows for many CSE opportunities. Also, if your compiler is reasonably good, it will also auto-vectorize the operations. Change-Id: I4bffe4826671dd60683b941a569fc6a7b4b34da7 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Particles: replace a QSet<int> with a bit vector for group data.Erik Verbruggen2016-03-082-10/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reusableIndexes represented a "free-list". Now the allocation behavior in QQuickParticleGroupData::setSize was to grow by (large) chunks. That means that as soon setSize was called, a (big) number of hash entries was created, which are drained over time. This memory would stay around (and probably unused) as long as the group was alive. By using a bit vector, the amount of memory is much more compressed, and finding an entry takes less time. The FreeList "caches" the next free entry, because allocation and de-allocation behavior is that they occur bunches: allocate a number of particles, use them, allocate the same number. Test case: samegame, 1 player, click 1 set of 3 stones, quit. QQuickParticleSystem::emittersChanged(), before patch: - 21 instr. inclusive, 15M in QQuickParticleGroupData::setSize - 23,000 calls to QHashData::allocateNode after: - 13M instr. inclusive, 7M in QQuickParticleGroupData::setSize - 0 calls to QHashData::allocateNode Change-Id: If35ea5ed9b29129f210638f6f59275a24eb6afdc Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Particles: Shrink QQuickParticleData by 2 pointers.Erik Verbruggen2016-03-0818-186/+183
| | | | | | | | | | | | | | | | Samegame creates about 23,000 particles, so this reduces the memory by ~180kb on 32bit, so ~360kb on 64bit. Change-Id: I0581524ab232b474c5d43abeabd7ebf6174e740f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Particles: reduce excessive hash accesses to a more passable level.Erik Verbruggen2016-03-0410-92/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By caching the group id in the particle emitter, and groups in the painter. Test case: samegame, 1 player, click 1 set of 3 stones, quit. QQuickParticleSystem::emittersChanged(), before patch: - 64M instr. inclusive - 145,880 calls to findNode (29M instr.) after: - 21M instr. inclusive - 0 calls to findNode - 25 calls to QQuickParticlePainter::recalculateGroupIds (9800 instr. inclusive). Change-Id: I4aba9d50100513c6b7cdd230e30b3aecaf84485a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Particles: inline 4 methods.Erik Verbruggen2016-03-044-46/+27
| | | | | | | | | | | | | | | | | | | | | | And when in the area, remove 3 unused functions. Benchmark: start samegame, click '1 player', quit. Valgrind result: removes/inlines ~90,000 calls. Change-Id: If911b19b46bf163f7fe678623c068f960296f17e Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Particles: code clean-up.Erik Verbruggen2016-03-046-36/+69
| | | | | | | | | | | | | | | | | | | | | | Replace QHash<int, QQuickParticleGroupData*> groupData with a QVarLengthArray, and make sure that those integers (== indices) are continuous, re-used, and start at zero. That way a whole bunch of qhash calls, hash node creatrion/deletion, and other overhead is removed. Change-Id: Ie74fab8a3e3c7b6efa15b7b9ceff1d1a3e9820e9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-011-3/+3
|\| | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro Change-Id: I3ca8f0422828191b7e19539c25f31f2d048e9f18
| * standardize statement order in project files a bitOswald Buddenhagen2016-02-251-2/+1
| | | | | | | | | | Change-Id: Ie9541cb83397fe2eccd69cd09cf8d9217e6905e2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-02-251-1/+2
| | | | | | | | | | | | | | | | this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: I5928f853a1d13b6a73533f9c6f6eae9da0e52a26 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-121-1/+1
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I356ec83cf687bd2833f9a7c5e820d56b1efa8979
| * Fix negative emitRate causing app to hangMitch Curtis2016-02-041-1/+1
| | | | | | | | | | | | Change-Id: Ieb74ab1a1369ca8c70243002e6b6deec86c03dd6 Task-number: QTBUG-50250 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-1961-854/+1220
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Particles: fix expensive iteration over QHash::keys()Anton Kudryavtsev2016-01-182-5/+9
| | | | | | | | | | Change-Id: I02755796e3a5c5a3bb39e125a45d968a750e58e1 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-101-2/+2
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h tests/auto/quick/qquicklistview/tst_qquicklistview.cpp tests/auto/quick/qquicktextedit/qquicktextedit.pro tests/auto/quick/qquicktextinput/qquicktextinput.pro Change-Id: I95d2c20a8619e5b8fa361c941a16dd8dce3e04e7
| * Fix typos in ParticleSystem documentationMitch Curtis2016-01-041-2/+2
| | | | | | | | | | Change-Id: I417250992dbba3b67e891b0e929c09f2c95da299 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | QtDeclarative: use prefix ++/-- for iterator typesAnton Kudryavtsev2016-01-091-1/+1
| | | | | | | | | | | | | | | | ... because it's useful for non-primitive types. These were the only two remaining instances in QtDeclarative. Change-Id: I52eba66313e953762d87313ccbd7ee0be9039be1 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-181-5/+5
|\| | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I9588a3e2c7d590e031dd4c66905a79f0d74d3ac8
| * Particle Turbulence image now reads correctly from QRC or local filesAriel Molina2015-12-081-1/+2
| | | | | | | | | | | | | | | | Turbulence was always reading from local files and never reading from QRC files. Change-Id: I93501f136a6934764422e2a914c01f359b054b2e Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Turbulence was accidentally deactivated on geometry changedAriel Molina2015-12-081-1/+0
| | | | | | | | | | | | | | | | Geometry changes triggered a grid initialization which removed the reference to the Particle System thus deactivating the Affector, fixed. Change-Id: I56446ae2116a9645d2e4b51c42358cdfb360ee82 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Correct heightmap values for TurbulenceAriel Molina2015-12-071-3/+3
| | | | | | | | | | | | | | | | Turbulence was only taking into account the red component, and it was wrongly using the image sideways. Change-Id: I7f50e44a198993b9ea2ac0a66c1952bf9c7e92fb Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Replace all occurrences of qSNaN() with qQNaN()Ulf Hermann2015-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | We generally don't want to produce signalling NaNs as those cannot be used in any further arithmetic operations. In particular -(qSNaN()) claims it's not a double. Task-number: QTBUG-49753 Change-Id: I23cec4fec2ddf08c02a7d53db7f3b9ba46b6c288 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Private export the ParticleSystem and AffectorAriel Molina R2015-11-242-5/+7
|/ | | | | | | | | | | | | | | | There are several special cases where the particle system is very useful for generating more than just eye candy. An example is a recreation of world weather/wind conditions as seen in http://earth.nullschool.net/ this patch allows for the implementation of similar systems. This patch does not adds features, just adds the macro Q_QUICK_PRIVATE_EXPORT in order to link the classes and derive custom C++ affectors for Qt Quick usage. Task-number: QTBUG-41502 Change-Id: I809d74676b3be73221840c694d7ca3eebe553c02 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-0631-0/+341
| | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Move remaining objects to new constructor syntaxLars Knoll2015-09-221-4/+3
| | | | | | | Also disable the old way of constructing objects. Change-Id: Ib4e69087cd563ae1481da116d6caf97876239798 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
| * Doc: replace Mac OS X with OS XNico Vertriest2015-07-151-1/+1
| | | | | | | | | | | | Task-number: QTBUG-40759 Change-Id: If21b4551eb95af3370cc21edd7a6721fc06e1346 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Port from Q_ENUMS to new macro Q_ENUM.Friedemann Kleint2015-06-195-7/+7
| | | | | | | | | | | | | | | | | | | | | | Remove Q_ENUMS in favor of the new Q_ENUM macro which provides registration as meta enum and a debug stream operator. QQuickXmlListModel::Status is left unmodified as porting it creates a link error in tst_qquickxmllistmodel. Change-Id: Id5e6192c9f85e7c94332508fbd91873ddda31e1a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Add 28 QList::reserve() callsSérgio Martins2015-06-082-1/+4
| | | | | | | | | | Change-Id: Id4820ac458f48b10f2bf457144767efdef9e2c07 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix build with QT_STRICT_ITERATORSSérgio Martins2015-05-151-2/+2
| | | | | | | | | | Change-Id: I3df6ac107cb46b3a1b15b80f39d7c6015adcd9ac Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.hLars Knoll2015-04-241-1/+1
|/ | | | | | | | This is a cleaner separation and further reduces include dependencies in the definitions of our basic data structured. Change-Id: I18aa86cdea0c0dfbc16075d4d617af97e638811e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* qt quick particles: Fix const correctness in old style castsThiago Macieira2015-03-101-5/+5
| | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c958e1d7c929c0 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* QtQuick: Micro-optimize iterator loops.Friedemann Kleint2015-02-261-2/+5
| | | | | | | Avoid repeated instantiation of end() in loops, use variable instead. Change-Id: I6ab1fe2b82406d5ee91710a0333587ffb82c04d4 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Cleanup math function includes and usageAllan Sandfeld Jensen2015-02-194-20/+14
| | | | | | | | Use std::math on floats and doubles, and qMath on qreals, and only include the math headers actually needed. Change-Id: I1d511d7b1bac0050eaa947c7baee760b736858bf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QQuickParticleData: Reorganise fields to drop size from 208 to 200 bytes on ↵Robin Burchell2015-02-122-5/+10
| | | | | | | x86_64. Change-Id: Ide7a70baecf6d1ff3ec8160a2cb47f0bd9955e45 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Update copyright headersJani Heikkinen2015-02-1261-427/+427
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* QQuickItemParticle: Only delete owned particlesAlan Alpert2015-02-042-11/+54
| | | | | | | | | | | | | | | | | A common pattern for ItemParticle (as shown in the particleview.qml example) is to use it to manage movement of a model's delegates. In such a case item management is handled by the user code (which bridges the needs of the Model and the View) and deleting the items in ItemParticle quickly leads to crashes. This change maintains (and improves, due to handling resets) the deletion of delegates created by the ItemParticles, as shown in delegates.qml. This example was expanded with a click to reset feature so as to more clearly see the impact of resets. Task-number: QTBUG-37486 Change-Id: I9de935034c11a7dd2abdd60e7b3bd42867dede9c Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* CleanupsLars Knoll2015-01-231-15/+15
| | | | | | | | Simplify some code in BooleanObject Simplify access to call arguments and thisObject Change-Id: I2f8e844019bc587385608beb02f05b15f827535c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove all the setVTable() calls that aren't required anymoreLars Knoll2015-01-211-1/+0
| | | | | | | | The memory manager's allocation methods now set this up correctly for us :) Change-Id: I8492bf732df601f95a1a851fb3804127ffc83935 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QQuickParticleEmitter: Call particleCountChanged by hand on ↵Robin Burchell2015-01-171-2/+1
| | | | | | | | | | | maximumEmittedChanged. Analysis of QObject connections showed that a large number of connections were set up to the particles system. As this particular case is cheap, we can do it inline instead, and avoid the connection-per-instance. Change-Id: Iec2049fff2c257dc39662ef2b5a8ecd75bbd870d Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QQuickItemParticle: delete delegates once they are completed.Robin Burchell2015-01-161-1/+1
| | | | | | | | | | | | | This was one gigantic memory leak, if anyone tried to use this functionality, as evidenced by the bug. The comment notes that deletion was only to be done if the items were created by the ItemParticle, but I don't think this makes sense: take()'s documentation doesn't imply that the ownership of the item stays with the creator, and nor does this seem to be a particularly sensible API decision to make, so I'm not going to implement that. Change-Id: I307d77b70c2b4f7b34565865f8efcfe64817be2f Task-number: QTBUG-37486 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>