aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickanimatorjob.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQuickAnimatorController: fix dangling QQuickAnimatorProxyJob pointerJ-P Nurmi2016-01-081-0/+2
| | | | | | | | | | | | | We're hitting crash problems in controls2 auto tests where QQuickAnimatorController::stopProxyJobs() contains dangling pointers in m_proxiesToStop. The window for these proxy jobs had been already reset, so the destructor of QQuickAnimatorProxyJob was not removing it from QQuickAnimatorController's m_proxiesToStop. Change-Id: I89e3b174c86dfb217a555f07ee1ce4c42cbcf204 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-181-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix more casts that dropped the constness.Thiago Macieira2015-07-071-2/+2
| | | | | | | | | | | | | | Found with GCC's -Wcast-qual Change-Id: I66a35ce5f88941f29aa6ffff13dde502fccefb1d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Make sure we stop animators if they are yet to be started.Gunnar Sletta2015-04-151-3/+2
|/ | | | | | Change-Id: I311e66c64a79581739f80e124fd58da2aaded549 Task-number: QTBUG-45220 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Improve debug formatting of QAbstractAnimationJob and related classes.Friedemann Kleint2015-04-021-0/+15
| | | | | | | | | | | - Output the state. - Add output to QQuickAnimatorJob. - Add a private export to the debug operator for use by QQuickAnimatorProxyJob to format its contained job. Task-number: QTBUG-45220 Change-Id: Ic64bb5d949864de1c4fb322d53acc3e253977e5d Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.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 devFrederik Gladhorn2014-10-291-9/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickaccessibleattached_p.h src/quick/items/qquickwindow.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp Change-Id: I8bf07487a75f9d1b0d6efa5914dd06875fc9654d
| * Improve performance of animators.v5.4.0-beta1Gunnar Sletta2014-10-101-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of one QCoreApp::postEvent() per completed animation added up to a very large overhead when 1000+ animators were used at the same time. This is very relevant for sprite games and similar and deserves to work at least as good as normal animations. Instead, store the animations to stop and stop then on the gui thread later as a result of frameSwapped. For the benchmark in question this allows for roughly double the amount of animators being started and stopped. Change-Id: Iae3d1ec1502ee1908fdbba708fa9f976aa230064 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Remove the "groupNode"Gunnar Sletta2014-10-171-9/+21
|/ | | | | | | | | | | | | | | | | | We originally had the groupnode to simplify adding and removing clip / effect / opacity nodes to the item tree at a time when the renderer was a bit more trivial and only did a single pass over the tree during rendering. The runtime cost at the time was negligible. The QSGBatchRenderer has a bit more logic, so the extra node now costs a bit more. In addition to extra memory, we need to allocate shadow nodes for it and put those into the renderer's internal shadownode hash. This removal increases the performance of adding / removal of simple items by ~10% in addition to reducing the number of nodes in the scene graph by up to 1/3. Change-Id: I8cd64984f868d75820e25d33dfdbebd4d20651fe Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Fix memory leak and crash with transform animators.Gunnar Sletta2014-10-091-1/+13
| | | | | | | | | | | | | | | | | | Every time initialize() was called, we would increment the ref on an item. However, initialize is called every time the job is started, so the ref would increase and only decrease once, leading to a leaked helper. Change it to only increment the first time. A different problem was that when an item was destroyed, we could run the risk of the QQuickTransformAnimatorJob destructor being called with the helper's item being null. This would lead to the helper not being removed from the cache and a dangling helper would remain in the transforms cache. Now change it so that when a target is destroyed, we explicitly destroy the helper as well (as no animation can happen then anyway) and reset all pointers in the job. Change-Id: I1ce76db134bbc1871d32f1224ba5b68a4a4eeafa Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-09-081-4/+10
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4arraydata.cpp src/quick/scenegraph/util/qsgatlastexture.cpp Change-Id: Ic4c96066d5c37dcf0d5446baed590ea005d445ce
| * Fix crash with cleanup of animators.Gunnar Sletta2014-08-301-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had several separate issues relating to how the jobs were cleaned up. The first was that upon getting setWindow(0), the animator did not reset m_controller to 0, leading to the starts() coming after that to post null jobs to the controller. This would later crash in beforeNodeSync as the starting job was null. The second issue was that during shutdown, QQuickAnimatorProxy would try to delete jobs on the controller which was already deleted. The controller is deleted on the GUI thread regardless of render loop, so this was solved with a QPointer. The third was that we were a bit too aggressive in trying to clean up jobs on the GUI thread, so we introduced a new bool which gets set to true in startJob() so that Proxy::deleteJob() knows who owns the job. Task-number: QTBUG-37833 Change-Id: I1b6221a2c1ce2bfd0758801b950cda00ff6899d0 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>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-121-2/+4
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4include.cpp src/quick/items/qquickrendercontrol.cpp src/quick/items/qquickrendercontrol_p.h src/quickwidgets/qquickwidget.cpp Change-Id: Ib2dc0051a38cd283a37a7665eb4a76f6f7ec8b15
| * Fix crash when animators are deleted just after being started.Gunnar Sletta2014-08-081-2/+4
| | | | | | | | | | Change-Id: I35850e279dae596edb9a1b93143d6aa195221b41 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* | Protect against crashes with invalid openglContext()Simon Hausmann2014-08-081-6/+6
|/ | | | | | | | | 1) Don't fail the assertion in the animator jobs if we don't have a context 2) Delegate the opengl context check in QQuickWindow::createTextureFromImage to the QSGContext Change-Id: I1b248895dcd6db406f1af8866fd0052dd7564899 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix crash with running animators on re-shown windows.Gunnar Sletta2014-05-191-5/+21
| | | | | | | | | | | | | | | | | The non-threaded render loops would clean up the nodes for a window when it was hidden, but the animators kept running and had a reference to the deleted nodes. This was not a problem for the threaded render loop as it would wipe the animator controller as well which would clean the jobs. Fix it by triggering a reset of all nodes in the animators when the window is told to clean up. If an animator is ticked when it doesn't have a node, it will simply do nothing. When the window is made visible again, we call initialize on all animators to find the new node. Task-number: QTBUG-37995 Change-Id: Ie5609d95db29f4b2b30ca5bf641dce901e528389 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Normalize signal & slot signatures in connectionThiago Macieira2014-02-031-1/+1
| | | | | | | Profiling shows Qt Creator spends 2% of its load time normalizing Change-Id: I58132e11ab5fc942b04925c3bcc919165784a5d1 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Refactored Animator internalsGunnar Sletta2013-11-061-67/+36
| | | | | | | | | | | | Change the design from posting events for starting and stopping to use the scene graph's existing 'sync' point. This gives much higher predictability and makes both ownership and cleanup cleaner and also reduces intermediate states while events are waiting to be delivered. Task-number: QTBUG-34137 Change-Id: I069ac22acbddaa47925b8172ba98ac340fe9bf8d Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Track size changes from transform animators.Gunnar Sletta2013-10-291-2/+3
| | | | | | | | | | When the size changes, so will most likely also the transform origin, so we need to check for it and update accordingly. Task-number: QTBUG-34140 Change-Id: Ic3d6c1ac599db499ab196a8cbe550308a75e837f Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Several smaller fixes to Animators.Gunnar Sletta2013-10-081-1/+11
| | | | | | | | | | | | | | Backwards animations are not supported for animators as the animation system cannot handle uncontrolled backwards animations. Make sure we write back values only for the animators that have run at all. Clockwise rotation to 0 can easily end up on 360 as a result the _q_interpolateClockwise function not being entirely correct. Change-Id: If69b8555a1361f46600a40e80419b65438c18097 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Make sure to markDirty the node from UniformAnimator.Gunnar Sletta2013-10-031-0/+4
| | | | | | | | Failure to do so will not repaint scene graphs which only has changes from the animator. Change-Id: Id420775d704df17379ca9b0eecd543fd3829fd00 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Make transform and opacity animators work when layer.enabled: trueGunnar Sletta2013-10-031-0/+12
| | | | | Change-Id: I6d9ece93a75782d524c211fc81a43f4311a38571 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Allow animators to work properly with multiple windowsGunnar Sletta2013-09-261-18/+49
| | | | | Change-Id: I5ba663ba0fa089ea786cf43cb4dfa40cbc955342 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Support looping for "uncontrolled animations".Gunnar Sletta2013-09-261-1/+0
| | | | | | | | | | The render thread animations rely heavily on uncontrolled animations, meaning animations with duration=-1. We support this by adding a m_currentLoopStartTime and incrementally counting the finish time of each uncontrolled animation. Change-Id: I1f2ccea09aff4c51b1a7f98a2ddb58636af50557 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Animators - Render thread animation systemGunnar Sletta2013-09-211-0/+532
This introduces 6 new QML types for animating state in the scene graph when the UI thread is blocked. The QObject property being animated is updated after the animation completes. It works also with the "windows" and "basic" render loops, but offer litte benefit then compared to in the "threaded" case. Change-Id: Ic19e47c898c0b8bd53e457db922b3c9c457c8147 Reviewed-by: Lars Knoll <lars.knoll@digia.com>