aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of the old way of defining builtin functionsLars Knoll2017-05-191-59/+48
| | | | | | | | | | The old calling convention used for builtin functions is very inefficient. It was still being used in a few places. Clean those up and convert them to the new and much more effiecient calling convention. Change-Id: I6b769c6185df7e9be1e80709330fc1ca868576c1 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Run includemocs in qtdeclarativeThiago Macieira2017-04-2628-0/+56
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Silence GCC 7 warnings about implicit fallthrough in Qt codeThiago Macieira2017-04-201-0/+7
| | | | | | | | | | | | | | | This only deals with Qt code. MASM has a lot of those left. We should just update from upstream instead to get the fixes. qv4regalloc.cpp:660:52: warning: this statement may fall through [-Wimplicit-fallthrough=] if (leftSource->type == DoubleType || rightSource->type == DoubleType) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qv4regalloc.cpp:666:13: note: here case OpBitAnd: ^~~~ Change-Id: I7814054a102a407d876ffffd14b6b0e2d6b03689 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QQuickParticleSystem: Fix crash when an Affector diesMartin T. H. Sandsmark2017-04-051-4/+10
| | | | | | | | | A guarded pointer wasn't checked before being de-referenced, that lead to a crash if an emitter was modified after an affector was deleted, but before updateCurrentTime() was called. Change-Id: I6cb605a711319fb77c1e2e87fa9f35427cd7797b Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-132-2/+14
|\ | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp Change-Id: I26f8d18fe8af664ee8573116f182fe12b71e089a
| * Fix build for -no-feature-quick-shadereffectStephan Binner2017-02-272-2/+14
| | | | | | | | | | Change-Id: I334603209818a8030ddb5b5b316cab596c328bf1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Replace usage of QSignalMapper by lambdaOlivier Goffart2017-02-143-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSignalMapper ought to be deprecated soon. It simplifies the code, too. There is still one use in QQuickGenericShaderEffect which is a bit complicated to get rid of. A very similar use of QSignalMapper was in use in QQuickOpenGLShaderEffectCommon but was removed in commit 8c745d80, the same should be done for QQuickGenericShaderEffect. (Note the QueuedConnection in qquickparticlesystem is there because the QSignalMapper used to be in the main thread, meaning a round-trip via the event loop) Change-Id: I331b787becbad37f717035bf119bafd7a7214630 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QQuickGravityAffector: Properly deprecate the acceleration property in docsRobin Burchell2017-01-171-7/+5
| | | | | | | | | | | | | | | | | | While we're here, deduplicate the implementation (just forward to the "right" setter), and change qWarning to qmlWarning to get context information on the source of the setter. Change-Id: I32acfee10dd34905bb2c472408e3abc6fa56a386 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickGravityAffector: Move implementations from header to cppRobin Burchell2017-01-172-37/+46
| | | | | | | | | | | | | | These are not performance-critical, so it's cleaner to do this. Change-Id: I6a876636d50e2bfe25f9e6e882d9a98dc032101e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Fix up some last un-fixed instances of qmlInfo that should be qmlWarningRobin Burchell2017-01-161-1/+1
| | | | | | | | | | | | | | Seems like I missed some hunks in 3057ec0447943fe022b66a2d19e13d94f9183a7c. Change-Id: I009c838cae856f3fc2e08c7fbc2d3273fc40e221 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove remnants of blackberry platform supportRobin Burchell2017-01-163-26/+2
| | | | | | | | | | | | | | | | The last remnants were removed from qtbase in 5.7 making this all dead code, so match here too. Change-Id: I10f3f1c614562f2a97ade7cdf5002065d6f79e07 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Port existing qmlInfo callers to qmlWarningRobin Burchell2017-01-112-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that qmlInfo actually reports info messages, we want to change existing callers to use warning-level messages to preserve the original message level. This was done through: perl -p -i -e "s/qmlInfo\(/qmlWarning\(/" **/*.{cpp,h,qdoc} .. with a little care taken to only add the hunks that should be changed. Change-Id: I511cee11ce0a26ec1048cd2b84c7536b812a0d89 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | particles: Fix up 16k warnings and apply them on non-ES tooLaszlo Agocs2016-12-212-5/+11
| | | | | | | | | | | | | | | | | | The isOpenGLES() condition is plain wrong: the code always uses ushort as the index type. Change-Id: Ibc5989227f61201913ff124485df4890b3490db5 Task-number: QTBUG-57515 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-11-231-2/+4
|\| | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4object_p.h Change-Id: Iff4d3aba7710a999b8befdc493cbe959e1ce02f9
| * Merge remote-tracking branch 'origin/5.7' into 5.8Simon Hausmann2016-11-151-2/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4string.cpp The conflict resolution for qv4tsring.cpp is to essentially omit the change of commit 64714ea431f2fd355ed27edc69dba4e992511e75 as the code in 5.8 already uses the add/mul_overflow functions. This merge also reverts commit f4ac007f4a19bc095ff15d415a6629986de78e49 as we can deal with dead store elimination now. Change-Id: Iee08c87cbe1a2ff23a73ce621d56262b4e007c56
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-151-2/+4
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qmldevtools/qmldevtools.pro tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp Change-Id: I12255c16716bd8a74e7047cdb1f9302a4d1ea827
| | | * Fix crash when using custom OpenGL functionsJesus Fernandez2016-11-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was using the ::glGetString function and this could fail if we are using a custom platform plugin. Change-Id: Idb9ccd178ea52255b9d6f0f6d3fd529094c15292 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-181-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4variantobject.cpp src/qml/types/qquickworkerscript.cpp src/quick/scenegraph/util/qsgdefaultpainternode_p.h tools/qmljs/qmljs.cpp Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
| * | | QML: Make Heap::Object and all subclasses trivialErik Verbruggen2016-10-061-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC6 might dead-store-eliminate out our secret write to Base::mmdata, because it expects all memory content to be "undefined" before constructor calls. Clang might take the same approach if the constructor of Heap::Object is removed. By making these structs trivial, it also makes them memcpy-able. Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Particles: add missing 'override'Anton Kudryavtsev2016-10-102-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and drop redundant 'virtual' Change-Id: Id70a0b74724d231bae9b3803fcfe0514adb9f642 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | | QQuickDirection: drop const from sample() result typeAnton Kudryavtsev2016-10-0610-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and add missing 'override' Change-Id: I00f04118fa5711a580d6d2b861b6dbda8df7a19d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | | Particles: add missing 'override'Anton Kudryavtsev2016-10-0622-44/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and drop redundant 'virtual' Change-Id: Ie15cfd2358fde604029150a1097b19cc8d514551 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | | Mark some methods as constAnton Kudryavtsev2016-10-065-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These methods do not modify objects. Change-Id: I4909f382cc19c5ce6f07e0421fef68a63cfe518f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | | QQuickImageParticle: mark getState() method as staticAnton Kudryavtsev2016-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This method does not use members. Change-Id: I00467a907a22be3cf5e08944ca6a9a807cd08f42 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | | QQuickLineExtruder: fix function name according to Qt code styleAnton Kudryavtsev2016-09-201-2/+2
|/ / / | | | | | | | | | | | | Change-Id: Ie1d6a50a796cf5d1faabebdfbd71ba88719c83cd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Merge dev into 5.8Oswald Buddenhagen2016-08-221-1/+2
|\ \ \ | | | | | | | | | | | | Change-Id: If0f273d3d33cec20edda539de6372337c2e4e969
| * | | Particles: fix incorrect usage of 'range for' with Qt containersAnton Kudryavtsev2016-08-201-1/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: Ibe750b068bc8d4c33272a65dafcc398239d7d591 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Have proper OpenGL checks in QQuickFBO and image particlesLaszlo Agocs2016-08-181-0/+10
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These use custom materials that can crash when running with the D3D12 backend. We prefer handling such situations gracefully, with the application surviving. Therefore check the backend in use, and skip creating a scenegraph node when the backend is not OpenGL. Task-number: QTBUG-55353 Change-Id: I0be326fd2eacb0be604a0f111fa916558376c75a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Private export the Particle EmitterAriel Molina2016-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Affectors were already private exported to allow for advanced particle uses. The Emitter was missing from those exports. No new features only exporting code already in place. Task-number: QTBUG-55265 Change-Id: Id2a54f45b10323101359898f844e938414457407 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | QtQuick: fix use-after-free of shader property connectionsErik Verbruggen2016-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A use-after-free would occur if the sender of a connection would disconnect (and destroy the slot object), and then the receiver would try to clean-up and access the slot object again. The fix is to have the receiver take out a reference to the slot object, because it will manage the life-time, and thus delete the slot object when it doesn't need it anymore. Change-Id: Ie2033cfb7212acceb2c2cd0bd9e7e45c2dd5e434 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | | QtQuick: clean up shader effect property connectionsErik Verbruggen2016-07-052-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't use a signal mapper, but handle the mapping using a custom slot object and a lambda to do the dispatching ourselves. - Don't do meta-calls by property name, but by index. - Cache the meta-object. - Resolve the property indices by using the QML property cache. For a shader with 6 property connections, the time spent goes from 320k instructions to 80k instructions (valgrind on x86_64). Task-number: QTBUG-53901 Change-Id: I2809198cf62f9716b3683798222203fc3e97fbb3 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | | Merge remote-tracking branch 'origin/dev' into HEADLaszlo Agocs2016-05-241-1/+1
|\| | | | | | | | | | | Change-Id: If91e0e28d004f1db978dcab393f189743bb69cd5
| * | 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>
* | | Merge remote-tracking branch 'origin/dev' into wip/scenegraphngLaszlo Agocs2016-05-243-5/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickopenglshadereffectnode.cpp src/quick/items/qquickshadereffect.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h src/quick/scenegraph/qsgdefaultglyphnode_p.h Change-Id: I3d6874b4e4231a89d2836c04fe8e7f2ef2d698c4
| * | 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>
* | | Add the skeleton for the new, more generic shader effect implLaszlo Agocs2016-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | which should route and place most of its work into the scenegraph. And fix a test. Change-Id: I04f29cba53c2bab62e41b3b524794d3c4d20a472 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* | | Prefix GL-specific shader effect codeLaszlo Agocs2016-04-132-21/+21
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the C++ sources and classes. The QML type name remains the same. No changes in functionality. The shader effect, node, material (and uniform animator and particles and bits and pieces here and there...) are highly interconnected and do not follow the usual design practices for Quick and the scenegraph and the adaptation layer. Therefore while we aim for keeping full compatibility for GL apps, other backends will likely get a different ShaderEffect item implementation. The C++ class QQuickShaderEffect itself is currently a dummy with an unchanged API. It is not in use for now but forms the basis for the implementation for other backends. This will be covered in future commits. Change-Id: Ia39ce4b303f8f33e2f241d11e35fa62423e43127 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* | 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>