aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickspriteengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Run includemocs in qtdeclarativeThiago Macieira2017-04-261-0/+2
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port existing qmlInfo callers to qmlWarningRobin Burchell2017-01-111-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>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-5/+6
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * QQuickSpriteEngine: Optimistic speedup for updateSpritesRobin Burchell2016-12-081-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Switch from QList to QVector, and avoid using pop_front -- remove all in one operation instead. The idea here was to provide some gain to sprite-sequence in qmlbench, but any possible gain is pretty miniscule due to the lack of batching that example suffers. Still, we end up with less CPU time taken, which is a win of sorts. Change-Id: Ib7c101afa71ee617c3c4506b14701d6a4143ed3a Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Mark some methods as constAnton Kudryavtsev2016-10-061-2/+2
|/ | | | | | | These methods do not modify objects. Change-Id: I4909f382cc19c5ce6f07e0421fef68a63cfe518f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Quick: replace 'foreach' with 'range for'Anton Kudryavtsev2016-08-181-9/+10
| | | | | Change-Id: I3493b16a184fc811289db9e98eff37bb987113a3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Quick: use const (and const APIs) moreAnton Kudryavtsev2016-08-121-57/+57
| | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I270cdc6eb8c5946f5c20b379bbb7c60f0ba518eb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add QSGSpriteNode to the Scenegraph Adaptation LayerAndy Nichols2016-07-141-13/+1
| | | | | | | | | | | | Most core Qt Quick items use one of the nodes provided by the Scenegraph Adaptation Layer, however the two items that provide support for Sprites created their own custom nodes. There was significant redundancy in this, and it made it only possible to use the OpenGL adaptation. The AnimatedSprite and SpriteSequence items have been cleaned up, and now use the new QSGSpriteNode. Change-Id: Idc20b9c5da9dc1c94f6368021785382cdf7cec5a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-301-0/+9
|\ | | | | | | | | | | | | | | | | Conflicts: src/quick/items/context2d/qquickcanvasitem.cpp src/quickwidgets/qquickwidget.cpp tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp Change-Id: Idf279cb88e0df2a383489af5b6afdf04d04ae611
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-291-0/+9
| |\ | | | | | | | | | Change-Id: I70c0c672708522f7157849365cc53ee271d8e460
| | * QQuickSpriteEngine: avoid entering infinite loop in assembledImage()Daniel d'Andrada2016-06-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not allow a frame size larger than the image size, otherwise we would never leave "while (framesLeft > 0) {...}" as framesLeft is never decremented because "copied/frameWidth" in the expression "framesLeft -= copied/frameWidth;" always resolves to zero because copied < frameWidth. Task-number: QTBUG-53937 Change-Id: Ia777ec65d72562426b13533918efcaca5bcabdd7 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/scenegraphngLaszlo Agocs2016-05-071-1/+1
|\ \ \ | | | | | | | | | | | | Change-Id: Ifb69f73ac805afe5e3c8708fa975b7d3c13a4e48
| * | | Introduce delegating constructors.Friedemann Kleint2016-05-061-1/+1
| |/ / | | | | | | | | | | | | | | | | | | Reduce code duplication by chaining constructors. Change-Id: I8a0afd20ed13d4eb938536dcb05787ba2565a4cc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* / / Enable building Qt Quick module with QT_NO_OPENGL definedAndy Nichols2016-03-221-1/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the Qt Quick module depends on either the OpenGL or OpenGLES headers being available at build time. Since we are adding support for adaptations that do not depend on OpenGL, it should be possible to build Qt Quick in environments that do not have OpenGL development headers. This does present many challenges though because in some cases GL types, and classes that require OpenGL are part of the public APIs. However since these classes were never available when QT_NO_OPENGL was defined, it should be possible to redefine the function signatures under this scenario, since it's not possible to break binary compatibility if there never were any binaries to break compatibility with. One of the bigger changes that was necessary to facilitate this change is creating interfaces out of QSGContext and QSGRenderContext. Here the default behavior was usage of OpenGL directly, even though subclasses could override all OpenGL usage. Making them interfaces should bring QSGContext and QSGRenderContext more in line with the other classes present in the adaptation layer. Change-Id: Iaa54dc0f6cfd18d2da1d059548abf509bd71f200 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | 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>
* | QQuickStochasticEngine: use prefix ++ for iteratorAnton Kudryavtsev2015-12-071-6/+6
|/ | | | | | | because it's useful for non-primitive types Change-Id: I3c8338f35c9c7d8d25e98608d013aa99a2133ba3 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* 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>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-291-0/+4
|\ | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickaccessibleattached_p.h src/quick/items/qquickwindow.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp Change-Id: I8bf07487a75f9d1b0d6efa5914dd06875fc9654d
| * QQuickSpriteEngine do not use OpenGL without checking for GLContextAndy Nichols2014-10-211-0/+4
| | | | | | | | | | | | | | | | | | | | In the case that QQuickSpriteEngine::assembledImage() is called when there is no current OpenGL context, return a null QImage instead of crashing. This is needed for the Qt Quick 2d Renderer case. Change-Id: I75b9b1f31f05cc0800293435d660e498fecc4d20 Reviewed-by: aavit <eirik.aavitsland@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fixed AnimatedSprite to respect 'loops' properlyJan Arve Saether2014-10-061-0/+2
| | | | | | | | | | | | | | | | | | Previously, AnimatedSprite could stop before it had performed its desired number of loops. Task-number: QTBUG-36338 Change-Id: I9485886681f55d410786f27b4f6afdc72a058202 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Do not crash under certain conditions in AnimatedSpriteJan Arve Saether2014-10-061-8/+12
|/ | | | | | | | | | | | | | | | | | The code that tried to find the remaning number of frames on the last row was incorrect if the last row were full. It basically did totalNumberOfRows % framesPerRow, which doesn't always work, for instance: If the animation had 8 frames per row and a total of 16 frames the calculation to find the remaining number of frames became: 16 % 8 = 0 (correct result should have been 8) As you can see, it only didn't work in the cases where the last row were full. Change-Id: I9ff6ac7baa91538b01576b659ea6651992cfca0b Reviewed-by: Michael Brasser <michael.brasser@live.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>
* Avoid direct GL calls in QuickLaszlo Agocs2014-05-231-1/+2
| | | | | Change-Id: I9b8673fb3292c9d5ad2f9e8e63f56dc661699be6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Remove several uses of module includesAndrew Knight2014-03-101-1/+1
| | | | | | | | | | Module includes are discouraged because they may increase compilation time. While debugging a broken core module include header, a number of module include infractions were discovered in qtdeclarative. Replace them with their more specific counterparts. Change-Id: I614e9a6aa2177f396e5289f3cdb3c35faa0202c9 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Fix remote image loading for AnimatedSpriteAlan Alpert2013-03-121-0/+1
| | | | | | | | | The Sprite generated behind the scenes had no QmlEngine associated, and the engine is needed by QQuickPixmap for async loading. Task-number: QTBUG-28086 Change-Id: Ibf3b03c54b339fe8f44201dc6fcb507e5274bbec Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Use the optimal image format for the spritesGunnar Sletta2013-02-021-1/+1
| | | | | Change-Id: Ib6cfbc0e5c743d21c265fad926aac29a601f3b0a 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>
* doc: fix some typos in .cpp filesSergio Ahumada2012-09-071-1/+1
| | | | | Change-Id: Ica7685aefde84ec80d8af7a67541af454de4adce Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Print sprite errors only onceAlan Alpert2012-05-141-1/+4
| | | | | Change-Id: I1dfb829d47cfdb5c5af3f3bc5956483ea6ef6314 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Avoid accessing sprites until they finish loadingAlan Alpert2012-05-141-5/+21
| | | | | | | | | | Because sprite properties are not valid until image assembly finishes, some features of the sprite engine cannot work until sprite assembly is finished. In these circumstances, we shouldn't crash. Task-number: QTBUG-24797 Change-Id: I2701f9302620c2cfd5b7bc5ce1cb9f31be4d4e19 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Keep m_states and m_sprites synchronizedAlan Alpert2012-05-111-2/+9
| | | | | | | | | Previously you could have more states than sprites, which could lead to errors because the sprite engine assumes bounds checking was done by the state engine (which only knows the size of the states list). Change-Id: Ie6069caa96d01cc28cc79350e6db5ff4191831a8 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Debug mode for SpriteEngineAlan Alpert2012-05-111-1/+17
| | | | | | | | Outputs the assembled sheet, for manual verification. Compile in by uncommenting the ifdef. Change-Id: Ia21d008cf1fd5ff0a551409f75683599cbb465a1 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Silence warning with ICC about change of signal in integer conversionThiago Macieira2012-04-121-1/+1
| | | | | Change-Id: I7a9bc7de580dd37005d842d0ff5a000ba16f7c20 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Use pixmapCache in sprite assemblyAlan Alpert2012-03-281-1/+2
| | | | | Change-Id: Ibd4f5ea08a548e3c255db3e771b667f5850978e2 Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
* Fix Sprite AssemblyAlan Alpert2012-03-231-2/+2
| | | | | | | | | | | This optimization doesn't account for the width of the assembled image possibly being too small to fit the whole source image width. Since it meant copying more image data than we needed, I'm no longer convinced that it actually is an optimization over a simple cut (as this patch implements). Change-Id: I3fe502a75979e972f62d9dbf26f1ffec9069a102 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-1/+1
|\ | | | | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
* | Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-15/+15
|/ | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Use QDeclarativePixmap in the Particle SystemAlan Alpert2012-02-091-19/+57
| | | | | | | This allows for source URLs to come from network sources. Change-Id: I416edca010e77e507598eaf4eead4291f044f379 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Implement reverse mode for spritesAlan Alpert2012-01-271-27/+79
| | | | | Change-Id: I1e8c124e883b881938fce01aeb67ac369fe0bc28 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Implement randomStart for spritesAlan Alpert2012-01-271-1/+20
| | | | | | | | Most useful in the particle system, so that sprites aren't temporally aligned at the start (ruining the random look). Change-Id: I1cbf6c2187e412fcb8b31cab0d87bcde275c9281 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Implement proper sprite sheet functionalityAlan Alpert2012-01-271-2/+3
| | | | | | | | | | Uses frameX/frameY from the new Sprite API. You can now specify your sprites as a single sprite sheet and just specify the offset for individual animations. Change-Id: I3a33d8329e6b9d65e5578669388e3115de992803 Reviewed-by: Alan Alpert <alan.alpert@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Update Sprite APIAlan Alpert2012-01-271-15/+15
| | | | | | | | | | | | | | | | | | | Added the following properties frameSync (replaces duration: -1) frameRate frameRateVariation frameDuration frameDurationVariation frameX (not yet implemented) frameY (not yet implemented) reverse (not yet implemented) Started the process of duration meaning animation duration instead of frameDuration, but some grace period is being allowed for the transition Change-Id: I0771a55d1708ba999483f76796f0323043b8a4db Reviewed-by: Alan Alpert <alan.alpert@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add some internal docs for the particle system and sprite engineAlan Alpert2012-01-231-0/+28
| | | | | | | | They're both large internal structures with extensive logic. Should have at least a basic attempt at documentation (beyond inline comments). Change-Id: I7d48ebf821fa759c11fa35889dbff8971644d23e Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Per-frame Sprites patch threeAlan Alpert2012-01-231-25/+102
| | | | | | | | | interpolation bools work with the new sprite rendering approach. Giant sprite images that get split into multiple rows now work with the new sprite rendering approach (or even at all). Change-Id: I7f3e09684622f523564802c7634361b6fe363676 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Remove unecessary assertsAlan Alpert2012-01-231-2/+0
| | | | | | | | They would also trigger when the user gives invalid input, which is not an assert worthy circumstance. Change-Id: Ifa5697d411793a55b6895945e751a73841b1ba3f Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Per-frame Sprites patch oneAlan Alpert2012-01-231-50/+56
| | | | | | | | | | | | | | | | | | To allow for sprites to be advanced by the rendering framerate, two minor redesigns were needed. A) Sprite texture location is now calculated on the CPU and passed to the GPU per frame. B) Stochastic State engine now supports states that do not advance on a timer, and states can be advanced manually. This patch implements B and A for ImageParticle. A for SpriteImage will be done in a separate patch. Task-number: QTBUG-22236 Change-Id: If1c54a6a03fa48b95bb1e672283292859656457b Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>