aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickanimatedsprite.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Small performance improvements suggested by clang-tidyAlbert Astals Cid2019-10-071-1/+1
| | | | | | | | | mostly add const &, a few std::move and in particular case, remove const so the std::move being done over the variable actually has effect Change-Id: Id611cd31bc012f219d7a17d4626b1c2a5fbddd66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devUlf Hermann2018-06-251-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/quick/handlers/qquickhandlerpoint.cpp src/quick/handlers/qquicksinglepointhandler.cpp tests/auto/qml/ecmascripttests/test262 Change-Id: I8908ec8c6116ca626fbd269af7625d4c429429ca
| * Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-191-1/+1
| | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-271-1/+3
|\| | | | | | | Change-Id: I280d42b8926c0cada1f35d322b80aaf2b0ef0a73
| * Add handling of device pixel ratio to animated spritesAllan Sandfeld Jensen2018-04-261-1/+3
| | | | | | | | | | | | | | Change-Id: I472f61241d1875daf0de0a597bf27c019314f48f Task-number: QTBUG-50119 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-171-16/+16
|\| | | | | | | Change-Id: I2e3ba907a6afcaa69354a894259c7b7accf3e3ac
| * Improve AnimatedSprite's documentationMitch Curtis2018-03-161-16/+16
| | | | | | | | | | | | Change-Id: Icc86afe67fd5a432798ce3173da51275bed1bf64 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-031-3/+61
|\| | | | | | | Change-Id: I308b964d86ca01916f6af7d6e3f71557e3624eca
| * Doc: add code examples and GIFs of AnimatedSpriteMitch Curtis2018-02-281-3/+61
| | | | | | | | | | Change-Id: Ie1c7541e526e2777af83a46d6ff01b3f7a9a0d3e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-02-271-2/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4internalclass.cpp src/qml/parser/qqmljslexer.cpp src/qml/qml/v8/qv8engine.cpp src/qml/util/qqmladaptormodel_p.h src/quick/items/qquickanimatedsprite.cpp tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp Change-Id: I16702b7a0da29c2a332afee47728d6a6ebf4fb3f
| * AnimatedSprite: set implicit size based on implicit frame sizeMitch Curtis2018-02-261-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By doing so, users no longer need to set an implicit or explicit size for AnimatedSprite. [ChangeLog][QtQuick][AnimatedSprite] AnimatedSprite's implicitWidth and implicitHeight are now based on frameWidth and frameHeight, respectively. This means it is no longer necessary to explicitly size AnimatedSprite. Task-number: QTBUG-36341 Change-Id: I3eb87e9b1c6bb93b3c667123c345341f34e2eee8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Sprite, SpriteAnimation: document that frameDuration is in millisecondsMitch Curtis2018-02-261-1/+1
| | | | | | | | | | Change-Id: I849661f6bed1c5d15edb79ac05e0f74212ce1e02 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Add finished() signal to AnimatedSpriteMitch Curtis2018-02-261-0/+11
|/ | | | | | | | | | | | | | | | | | | | | It's nicer to respond to a sprite finishing its animation like this: onFinished: doStuff() than this: onRunningChanged: if (!running) doStuff() In addition, the latter will get executed even if the animation is manually stopped, whereas finished() is only emitted when the animation finishes naturally. [ChangeLog][QtQuick][AnimatedSprite] Added finished() signal to AnimatedSprite as a convenient way to react to an animation finishing. Change-Id: I558e8372b54bacacd5695cb0edf97d8b84b373f9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* 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-1/+1
| | | | | | | | | | | | | 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.7' into 5.8Liang Qi2016-10-101-12/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/quickwidgets/quickwidget/main.cpp src/qml/jsruntime/qv4jsonobject.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/jsruntime/qv4qobjectwrapper_p.h src/qml/qml/qqmlengine.cpp src/qml/qml/qqmlpropertycache.cpp src/qml/qml/qqmlpropertycache_p.h src/quick/items/qquickanimatedsprite.cpp src/quick/items/qquickitem.cpp src/quick/items/qquickitem.h src/quick/items/qquickitem_p.h src/quick/items/qquickview_p.h src/quick/scenegraph/qsgcontext.cpp src/quick/scenegraph/qsgdefaultrendercontext.cpp Change-Id: I172c6fbff97208f21ed4c8b6db3d1747a889f22b
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-301-12/+20
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktext/tst_qquicktext.cpp Change-Id: I241cd418bb7e7b95e0a0a2ee4c465d48be2a5582
| | * Quick: Do not send SG updates when AnimatedSprite is not visibleErik Verbruggen2016-09-231-12/+20
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-55935 Change-Id: I475c1bb3e7aae9499b1b07a52f3c10f54c8b3481 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | Add QSGSpriteNode to the Scenegraph Adaptation LayerAndy Nichols2016-07-141-299/+393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Enable building Qt Quick Sprite classes with QT_NO_OPENGLAndy Nichols2016-07-141-3/+9
|/ / | | | | | | | | Change-Id: Iaea1fa3bd17acee326ae8e299cb0c60d371ffb5b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-081-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Move Qt Quick resources under the :/qt-project.org/ directoryGiuseppe D'Angelo2016-04-011-2/+2
| | | | | | | | | | | | Change-Id: I7c7745264ff66b7db042e19f6d44124fa78bb86c Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-071-48/+44
|\| | | | | | | Change-Id: Icfa1d61fcc286c3418d4a625de11d2191336fa60
| * AnimatedSprite: don't access deleted scene graph nodesJ-P Nurmi2016-03-031-48/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | It’s a bad idea to store a scene graph paint node as a member variable. First of all, it should not access the node outside updatePaintNode(), that is, outside the render thread. Secondly, the node is owned by the scene graph and may be nuked whenever the scene graph feels so. Some creative re-parenting easily triggers a case where AnimatedSprite ends up accessing a node that was already deleted by the scene graph. Change-Id: I89205ac36333a2fcb094121afa61b6409fda5883 Task-number: QTBUG-51162 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-011-0/+1
|\| | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro Change-Id: I3ca8f0422828191b7e19539c25f31f2d048e9f18
| * QQuickAnimatedSprite: fix memory leakTim Blechmann2016-02-241-0/+1
| | | | | | | | | | | | | | | | the QSGGeometryNode owns the geometry, so we need to set the flag to avoid a memory leak Change-Id: Ifaf1e88c437b765a76d7ab4028c63d66413440bb Reviewed-by: Jan Arve Sæther <jan-arve.saether@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>
* AnimatedSprite: avoid unnecessary redrawsTim Blechmann2015-10-141-4/+16
| | | | | | | | | AnimatedSprite currently triggers a redraw for every update. however this should only be done, when the next frame will actually be different to the current one. Change-Id: I550bd32c02807e4c3f4847fb2608f5ad0cf0a59a Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Cleanup math function includes and usageAllan Sandfeld Jensen2015-02-191-1/+1
| | | | | | | | 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>
* 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 devSimon Hausmann2014-12-091-2/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
| * Fix multirow spritesheet rendering in paused stateJoni Poikelin2014-11-211-2/+19
| | | | | | | | | | | | Task-number: QTBUG-42777 Change-Id: I8027f100c593ae7c57df7c952e66cc2b3fae1dd9 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Animations with no frameSync should be synchronized to the start timeJan Arve Saether2014-10-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | (i.e. "start time" means the time when running was set to true) Unfortunately, we reset the timestamp *after* the image had been loaded and assembled in buildNode(), therefore, the first *displayed* frame would always be the first one in the animation regardless of how long time it took to load the image. Change-Id: I6b57a0f69afd3c9140628b874481cdeda1dffce5 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | Fixed AnimatedSprite to respect 'loops' properlyJan Arve Saether2014-10-061-13/+19
| | | | | | | | | | | | | | | | | | 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>
* | Made emission of AnimatedSprite currentFrameChanges consistent.Jan Arve Saether2014-09-121-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both the order was wrong and sometimes the currentFrame property did not correspond to the 'arg' argument that was carried by the signal. The order was sometimes like this: [window got exposed, m_running == false] currentFrame: 1, arg: 1 <== Unexpected, its not running [start() got called, m_running == true] currentFrame: 1, arg: 0 <== Unexpected, they are inequal currentFrame: 2, arg: 2 <== Not sure what to expect here The root of the problem was that we would enter prepareNextFrame on startup (due to QQuickWindow::exposeEvent) even if we were in the stopped state. Getting rid of the first invalid emission solved the issue. Change-Id: Iba002ee91d4d1acafcf4fd0911c28c93a4bc6fd5 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-111-19/+11
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickpainteditem.h src/quick/items/qquickshadereffectsource.cpp src/quick/items/qquickshadereffectsource_p.h Change-Id: If98096443afe85fc4370cef971eace050006a61b
| * 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>
* | Add Q_DECL_OVERRIDEAlbert Astals Cid2014-08-141-6/+6
|/ | | | | Change-Id: I2e64950aef710f943c3bc50bc9bf8a1f7fb58d28 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Support smooth for AnimatedSpriteGunnar Sletta2014-05-141-1/+1
| | | | | | Task-number: QTBUG-38923 Change-Id: I1cb9ac434aa729ee390e17deced9ed470895549d Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Fix AnimatedSprite interpolation when looping and/or reversing.Michael Brasser2014-03-171-11/+47
| | | | | | | | | | Ensure we interpolate in the correct direction, and that interpolation occurs between loops. Task-number: QTBUG-36339 Task-number: QTBUG-36340 Change-Id: Iccb097e6a9af9fa6697e2ba9ee852be9eb516edc Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Doc: Fix broken linksSze Howe Koh2013-11-051-1/+1
| | | | | | Change-Id: Ie7408409ddbaa354370267f2dd74326ec56a4186 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Refactor shaders into seprate GLSL source filesSean Harmer2013-10-311-37/+4
| | | | | | | | | | | | | | | | | | | | | | The default implementation of QSGShaderMaterial::vertexShader() and fragmentShader() now loads the GLSL source from a list of source files that can be specified via the setShaderSourceFile() or setShaderSourceFiles() functions. Multiple shader source files for each shader stage are supported. Each source file will be read in the order specified and concatenated together before being compiled. The other places where Qt Quick 2 loads shader source code have been adapted to use the new QSGShaderSourceBuilder, which is also used internally by QSGMaterial. This puts Qt Quick 2 into a better state ready to support OpenGL core profile and to load different shaders based upon OpenGL version, profile, GPU vendor, platform, etc. Change-Id: I1a66213c2ce788413168eb48c7bc5317e61988a2 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Remove superfluous code.Gunnar Sletta2013-10-291-12/+0
| | | | | | | | | | I suspect this was to work around that a very early version of the previous renderer some times left vertex pointers active, but this has not been the case for a very long time, so this code is just wasting time and memory. Change-Id: I4b79ff67d17bf47af515e8db203960c9bceae247 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Don't use reserved keyword "texture" as uniform variable nameSean Harmer2013-10-211-2/+2
| | | | | | | | | | The "texture" keyword is a function name in OpenGL core profile. This commit is in preparation for making the Qt Quick 2 renderer and materials work with a core profile context. Change-Id: Iad243e64ab8db739fc46b85bb626bdb8b9ceb208 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-19/+19
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Fixed and updated Qt Quick's \qmlmodule pageJerome Pasion2013-09-251-1/+1
| | | | | | | | | | | -incremented version to Qt Quick 2.2 (in \qmlmodule page) -import changed to QtQuick 2.2 -\inqmlmodule no longer needs the version. QDoc will ignore the version but it is better to remove it now to avoid confusion Task-number: QTBUG-32172 Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* emit runningChanged when AnimatedSprite stops by loops settingsTasuku Suzuki2013-06-221-3/+4
| | | | | | Task-number: QTBUG-31522 Change-Id: I20718cda5f77f3a53176c8b1a4baacedd77375af Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fix remote image loading for AnimatedSpriteAlan Alpert2013-03-121-2/+2
| | | | | | | | | 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>
* 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>