aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickimageparticle_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Do less work when there are no active ImageParticle particlesMichael Brasser2021-02-061-1/+2
| | | | | | | | | | | Don't mark geometry and material as dirty if there is nothing to change. Task-number: QTBUG-41867 Change-Id: I016d2d76f4ebf731f5bfc931ba616ee5d074bc65 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit e3cb305a6a19bf394c1068a7e483e1c95e11c22b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Take pixel ratio into account with point particlesKaj Grönholm2020-11-121-0/+1
| | | | | | | | | | | | Particles using DrawTriangles are taking pixel ratio into account, while particles using DrawPoints used raw pixel sizes. Change points to also scale based on dpr. This way particles with different backends and performance levels remain the same size. Task-number: QTBUG-88240 Change-Id: I3988a0ad8e741626a56a41b08aed0500e5be0c62 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix QQuickImageParticle resetting loopKaj Grönholm2020-11-111-0/+2
| | | | | | | | | | | Animating properties like color caused resetting loop because PerformanceLevel never reached new value before resetting again. Fix this by only resetting when we are already not targeting correct level. Task-number: QTBUG-88368 Change-Id: Id22ac03b6fbd716fba07a8c9b7e6942f58e25fc5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add simpler non point particle levelKaj Grönholm2020-11-111-2/+21
| | | | | | | | | | | | | | | Add one more PerformanceLevel which is similar to Color, except it draws using triangles instead of points. This is optimal for d3d11 which doesn't support VertexShaderPointSize. Also rename first levels to *Point to be clear. Testing this on my windows laptop shows ~15% decrease in RAM usage for imageparticle/colored example. Task-number: QTBUG-88294 Change-Id: Ib93bc9fd0d2ef4f1cb8e0d9dcba0db652f288398 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Optimize particles vertex dataKaj Grönholm2020-11-091-15/+17
| | | | | | | | | | | | | | | | | | Use uchar instead of float for vertex data that doesn't need float. Continue using floats in shaders. Also remove animY2, which is same as animY1. These changes reduce memory usage especially when the amount of particles increases. Testing on windows, memory reductions with emitters/trailemitter example were: - OpenGL: 82.7 MB -> 76.5 MB - Vulkan: 130.8 MB -> 126.3 MB - D3D11: 143.7 MB -> 135.8 MB Task-number: QTBUG-88124 Change-Id: I8f8dcb3845323b0e69fb99b5bff830cd0f151a47 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Cleanup and optimize particlesKaj Grönholm2020-11-051-2/+0
| | | | | | | | | | | | | | | Minor improvements while going through the particles sources: - Reduce getShadowDatum() calls - Remove unused m_lastLevel, reloadColor(), m_available m_velocityFromMovement, maximumAlive, m_pending, m_lastT, m_last_last_last_emitter, modelIndex - Color4ub structs can be assigned directly - Fix pri for shaders_ng files - Other minor refactoring Task-number: QTBUG-88124 Change-Id: I5768fed9f4b6379a698849c23436fa38169833a4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add major version to all Q_REVISIONsUlf Hermann2020-02-191-0/+1
| | | | | Change-Id: Id72fbe10c16de61bd847773d0055d83cfe03f63c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-161-0/+1
|\ | | | | | | Change-Id: I6e69a235f50472b8f7ac19e133a3c071ea8c4d7a
| * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-151-0/+1
| |\ | | | | | | | | | Change-Id: I7759f6b60f8fda6525b239c7ee2e034194d4ab85
| | * Fix image particle flickering due to broken state machine logicLaszlo Agocs2019-10-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A null QSGNode cannot be returned since that leads to not showing anything in the next frame. That is unacceptable in case there are already particles displayed and we are merely regenerating due to the increased number of particles. Task-number: QTBUG-54673 Change-Id: If610c56f6d82d35a8de6b435fd8b18ceb7adf2e7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Specify parameters of type registration in class declarationsUlf Hermann2019-09-261-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using this technique we can automatically register all necessary revisions and minor versions of a type, using the metaobject system. This greatly reduces the potential for mistakes and resulting incompatibilities between versions of imports. We assume that for each type we need to register all revisions of its super types and its attached type, and that the revisions match. That is, if you import version X of type A, you will also get version X of its attached type and of any super types. As we previously didn't take these dependencies into account when manually registering the types, a number of extra revisions are now registered for some types. Potentially, we can now generate the qmltypes files at compile time, using moc. Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* / Make ImageParticle functional when rendering via the RHILaszlo Agocs2019-08-221-8/+21
|/ | | | | | | | | Involves a trivial (albeit time consuming) rework of the existing materials as well since their reliance on QSGSimpleMaterial makes them problematic to live side-by-side with the RHI variants. Change-Id: Ie12b7949904434b3a831588518c8268e917ce92f Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Particles: add missing 'override'Anton Kudryavtsev2016-10-061-5/+5
| | | | | | | ... and drop redundant 'virtual' Change-Id: Ie15cfd2358fde604029150a1097b19cc8d514551 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>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | 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>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-061-0/+11
| | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Port from Q_ENUMS to new macro Q_ENUM.Friedemann Kleint2015-06-191-2/+2
| | | | | | | | | | | 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>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | 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>
* Fix leaks in QQuickImageParticleJocelyn Turcotte2014-10-271-5/+4
| | | | | | | | | | | | | | | | Make sure that ImageData instances, m_shadowData as well as the QSGGeometry of particle nodes are destroyed together with their QQuickImageParticle. Also implement the assignment operator for QQuickParticleData to avoid its v8Datum pointer to be copied over to the shadow datum in getShadowDatum. This would cause a double delete of the QQuickV4ParticleData when trying to call clearShadows() in the destructor. Task-number: QTBUG-36782 Change-Id: Ie03f2be0415daeb7f4f6e5f92295a3ab26a62155 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Don't store the QSGNode pointerAlan Alpert2013-11-221-3/+3
| | | | | | | | | | | | | The QSGNode subtree may be cleared at any time. Get the subtree via the node pointer passed in updatePaintNode, to ensure that the subtree is still valid each update. Some references are still being stored but invalidated when a new subtree is created. QTBUG-34994 has been created to track fixing that. Task-number: QTBUG-33553 Change-Id: I2115aff931d42b613d207553c636be7d80c405bb Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Load image data on main threadAlan Alpert2013-10-301-1/+2
| | | | | | | | | QQuickPixmap use should be done on the main thread, if not it can lead to an exception when creating the file loading thread (owned by the engine). Change-Id: Id59cec4312ecdee537dcba85778bd90ea4433b2e Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Allow QtQuick private headers to be used with QT_NO_KEYWORDS.Jocelyn Turcotte2013-09-121-3/+3
| | | | | | | | | | | This is necessary for the QtWebEngine module. This also adds an empty nokeywords test using the same mechanism as qtbase/tests/auto/tools/moc/no-keywords.h to find conflicts at compile time. Change-Id: I9df541720797dd61f078178c2af68ead18ff8bfe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-281-3/+0
| | | | | | | | | | | The macro was made empty in qtbase/ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Ia07e99676e0134fde5e32880edb95e57c779a7ff Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Alan Alpert <aalpert@rim.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Rename speed -> velocity in the particle systemAlan Alpert2012-06-291-12/+12
| | | | | | | | Matches the convention set in the QtQuick module, for example by ListView and Flickable. Change-Id: I8df57ed1ced8128723d790c30c00cc1b2062787d Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Extract Particles code to an independent libraryMatthew Vogt2012-04-161-0/+446
QtQuick clients that do not use particles features should not have to load these classes. Task-number: QTBUG-25178 Change-Id: Ib15f7655dc4d821595e06f9160d2770375279027 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>