aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
Commit message (Collapse)AuthorAgeFilesLines
* Improve performance of animators.v5.4.0-beta1Gunnar Sletta2014-10-104-16/+62
| | | | | | | | | | | | | | | 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>
* Fix memory leak and crash with transform animators.Gunnar Sletta2014-10-093-7/+18
| | | | | | | | | | | | | | | | | | 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>
* Remove alpha channel from images that doesn't actually have alpha.Gunnar Sletta2014-10-091-0/+25
| | | | | | | | | We did this for QPixmap since forever, and it has a huge impact on rendering performance, so there is no reason why we shouldn't spend that extra bit of time. Change-Id: Ibd2e6d585525a5b5a975b8d7498c21dec00647c5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Select specific features to be recorded when profiling QMLUlf Hermann2014-09-113-29/+38
| | | | | | | | | | | | Some features, like the memory profiler, create huge amounts of data. Often enough, we're not actually interested in all the data available from the profiler and collecting it all can lead to excessive memory consumption. This change enables us to optionally turn various aspects of QML profiling off. Task-number: QTBUG-41118 Change-Id: I7bb223414e24eb903124ffa6e0896af6ce974e49 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-09-083-5/+14
|\ | | | | | | | | | | | | | | | | 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-303-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-261-1/+1
|\| | | | | | | | | | | Conflicts: src/qml/qml/qqmlobjectcreator_p.h Change-Id: I60858ddb46866a8fa1a8576bb05b412afeeb4e41
| * Fix typo in StateChangeScript documentation.Mitch Curtis2014-08-191-1/+1
| | | | | | | | | | Change-Id: Iec72331c183ea02680bad01f04eae82ebd815cdb Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Update license headers and add new licensesJani Heikkinen2014-08-2564-1209/+697
| | | | | | | | | | | | | | | | | | - 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 const & to argumentsAlbert Astals Cid2014-08-241-2/+2
| | | | | | | | | | Change-Id: I1bcf69638fee32b6e6565b8ea828c0adcff48a67 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | CleanupSimon Hausmann2014-08-152-10/+10
| | | | | | | | | | | | | | | | | | Merge QV4::CompiledData::QmlUnit into QV4::CompiledData::Unit. For pure JS units it means a slight increase of memory usage by a few bytes, but overall it makes the code a lot simpler. Change-Id: Ib48927749720b056f004aac0fe22cb8ec729e3f6 Reviewed-by: Lars Knoll <lars.knoll@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>
* | Add declarative QQuickTextMetrics API from QQuickFontMetrics invokablesMitch Curtis2014-08-085-5/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows use of a declarative API for the functions in QFontMetricsF which take parameters. This solves the problem of QML expressions that use QML methods not being re-evaluated when the internal data changes, by allowing the user to set the arguments as properties of a TextMetrics object, that would otherwise have to be passed to QML methods. For example: FontMetrics { id: fontMetrics } property rect r: fontMetrics.boundingRect("Blah") At some point, the font of the FontMetrics object is changed, but r will still represent the original bounding rect. Instead, the user will now write: TextMetrics { id: textMetrics text: "Blah" } property rect r: textMetrics.boundingRect The QML methods remain in QQuickFontMetrics for those who need an imperative API. [ChangeLog][QtQuick] Added QQuickTextMetrics, which provides a declarative API for the functions in QFontMetricsF which take arguments. Change-Id: I019dc4639531906fc751ba61281cc1c695742287 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Get rid of StringRefLars Knoll2014-07-221-11/+11
| | | | | | | | | | | | | | | | Remove the Ref classes, as they won't be required anymore once Managed and Managed::Data are separated. Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add QQuickFontMetrics.Mitch Curtis2014-07-174-2/+455
| | | | | | | | | | | | | | | | | | | | | | | | This will be a private C++ type that is exposed to QtQuick 2.4 as FontMetrics. [ChangeLog][QtQuick] Added QQuickFontMetrics, which provides a subset of QFontMetricsF's API. Change-Id: Iac31e5a555bd8f1dc0904b8de0408e5f1a402b25 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-107-11/+9
|\| | | | | | | Change-Id: Iba61035910c46627e5e1c3824757da7b3d573657
| * Doc: correct link/compilation errors in Qt DeclarativeNico Vertriest2014-07-027-11/+9
| | | | | | | | | | | | | | Task-number: QTBUG-34749 Change-Id: I507d54b0568d77c6099a0bd99f5c369b8667032a Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Properly collect polish timings from all render loopsUlf Hermann2014-07-022-8/+6
| | | | | | | | | | | | | | | | | | | | | | Previously the polish timings were collected incorrectly from the windows render loop and not at all from the basic render loop. By collecting the polish times at the right places we can get rid of the 2-argument profile macro as well. Task-number: QTBUG-39876 Change-Id: I0b4aaf87162c652b8dcea6cd4f54db053f8312fe Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Use the same length for all scene graph numeric dataUlf Hermann2014-07-021-1/+1
| | | | | | | | | | | | | | | | Having one int between all the qint64 is really not worth it. Also, the clients were not picking that up correctly. Change-Id: I9a9bc1c26c7518e1b666b788fa41f83c714a6db5 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | QQuickSystemPalette: use QGuiApplication::paletteChanged()J-P Nurmi2014-07-022-44/+15
| | | | | | | | | | | | | | | | | | Use the newly introduced signal instead of filtering events of the whole application. Change-Id: I876268145485ba07316e916d26a93d53c464ef3a Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* | QQuickApplication: do not filter LayoutDirectionChange eventsJ-P Nurmi2014-06-252-35/+4
| | | | | | | | | | | | | | | | | | | | The newly introduced QGuiApplication::layoutDirectionChanged() is much cheaper to use than filtering events of the application object. Change-Id: I356c94cc6bea806bf3644c31c2610501d90f6c35 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | QQuickApplication: do not filter ApplicationActive/Inactive eventsJ-P Nurmi2014-06-231-19/+5
| | | | | | | | | | | | | | | | | | Listening to QGuiApplication::applicationStateChanged() is enough, no need to do expensive event filtering for listening to application state changes. Change-Id: Iba71bc8cefec236f2f7e2e25c57c5c6b9c9fb1ea Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Optimize the way AnimatedImage display its contentLouis du Verdier2014-06-052-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | Since QtQuick2, the AnimatedImage component is less efficient than it was with QtQuick1, using more CPU and RAM. This commit makes it upload when required each animation frame as a cached texture (using QQuickPixmapCache) to speed up the component. Task-number: QTBUG-38921 Change-Id: I7ab0b5f47ecec6cb3cdded0dd219d6acc1bc4148 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-06-042-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | The merge conflict is about the removal of "d1" from the register set on ARM, but that was already done in dev in commit ddb33ee9ba9e1344caa9be5dbf4b534c3ede692e The change in src/quick/scenegraph/coreapi/qsgrenderer.cpp with commit 2414f1675eab163b22dcc4e8ded80ed04d06369b was reverted to what it was before, per Laszlo's advice. Conflicts: src/qml/jit/qv4isel_masm.cpp Change-Id: I7bce546c5cdee01e37853a476d82279d4e72948b
| * Fix potential null pointer dereferencingFrederik Gladhorn2014-05-301-1/+1
| | | | | | | | | | | | | | | | | | These were found by http://www.viva64.com/en/b/025 most issues are rather cosmetic. Change-Id: I7cc12610aae6a43d26bedb9b480863c0695ddfa3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Fix type of AnimationController::animation in documentation.Mitch Curtis2014-05-271-1/+1
| | | | | | | | | | | | Change-Id: I3122ba1d7e9f1c396bef347cd1fd7df8ab32ff47 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Fix crash when sharing data structures between 32-bit and 64-bitSimon Hausmann2014-05-261-1/+5
| | | | | | | | | | | | | | | | | | | | The data structures in QV4::CompiledData are intended to be shareable between different architectures (if endianness is the same). This requires us to pack them, which is possible with MSVC and GCC (which also includes clang) Change-Id: I078254b9d314f60f8973a0c9404f53af41a48fb8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Rework custom parser integrationSimon Hausmann2014-06-042-108/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The custom parser design used to be so that the custom parser operates on the "AST", creates its own binary representation of the data it needs, stores it in a QByteArray and gets that at object instantiation time. That meant serializing everything necessary. With the introduction of the "binary" QML data structure, that process of serialization becomes obsolete and would require extra work in the custom parsers for example for QQuickStates to store the translation parameters. The clean solution is to eliminate this unnecessary serialization process and instead let the custom parsers do a verification pass at type compile time and then simply operate directly on the QV4::CompiledData::Bindings at object instantiation time. That simplifies the code, and allows for support of translations throughout all list model properties. Additionally this speeds up the creation of state objects and reduces memory consumption. Previously a text: qsTr("foo") binding in states would result in an actual java script binding. After this patch it is merely stored as a string and translated at object instantiation time. Change-Id: I7550274513f54abb09a0ab4de51c4c0bcdb23cae Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-05-224-9/+67
|\| | | | | | | Change-Id: I0dd91626837276f5811e4830f4a4e9f89bf1e1bd
| * Fix crash with running animators on re-shown windows.Gunnar Sletta2014-05-194-9/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-131-1/+1
|\| | | | | | | Change-Id: I24827851643247b938b3a1b7182864293e5c3fe7
| * Doc: Fix invalid cross-referenceKevin Funk2014-05-121-1/+1
| | | | | | | | | | Change-Id: Ib344215f240705100da8d949ac86b57af26a97ef Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-1014-99/+173
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/accessible/quick/quick.pro src/quick/items/qquickpincharea.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp Manually adjusted for TestHTTPServer constructor change: tests/auto/quick/qquickimage/tst_qquickimage.cpp Change-Id: I5e58a7c08ea92d6fc5e3bce98571c54f7b2ce08f
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-011-12/+25
| |\ | | | | | | | | | Change-Id: I996a85744753598bb48c7e0d7954049202f4f037
| | * Fix translations in states causing failing assertionsSimon Hausmann2014-04-281-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a smaller fix suitable for the release branch, merely adding support for translations to the bytearray compilation step for states and ensuring a consistent error message when qsTr is used in list models. The proper fix will be done in dev that eliminates the entire intermediate QByteArray storage for custom compilers. Task-number: QTBUG-38492 Change-Id: If5171f16eb742c718e48b8bbcb265b0c241cd5e7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | QQuickStyledText: do not insert an extra blank line in the beginningJ-P Nurmi2014-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Do not insert an extra line-separator when the document begins with an element such as <p> or <h1> that causes an implicit line break. Task-number: QTBUG-38531 Change-Id: Ib1da9df9a4a767cf11c63a4e2845f334cd69df69 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
| * | Eliminate a static global QString in qquickpath.cppJ-P Nurmi2014-04-301-2/+2
| |/ | | | | | | | | | | Change-Id: Iad3838f1d215c02555be0acd5f313eaefd4f90a0 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Support dumping of animation jobs via QML_ANIMATION_TICK_DUMP.Michael Brasser2014-04-087-3/+95
| | | | | | | | | | Change-Id: I0b444321667691be3e1037164d02f29ed4dfc13e Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Avoid recompiling of signal handlers defined in QtQuick state changes and ↵Simon Hausmann2014-04-022-17/+6
| | | | | | | | | | | | | | | | | | | | Connection objects We can re-use the expression we've compiled at QML type compilation time, as long as we "inject" the signal parameters in the dynamic qml lookup chain. Change-Id: Icc417531c41dea06ff5d033011179af49b03f542 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Fix performance regression for bindings from QtQuick state changesSimon Hausmann2014-04-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression from the compiler change. We can and should try to use the binding as it was compiled in the loader thread for things like PropertyChanges { target: foo width: someExpresion + to + calculate * width; } It is already ensured that these expressions are compiled without type optimizations. Change-Id: Ib855d8a848fcab2524df008727eab436ac98514e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Remove object index parameter from QQmlCustomParser::compileSimon Hausmann2014-03-292-3/+2
| | | | | | | | | | | | | | | | There is no need anymore to pass through the object index of the object being "custom compiled". Change-Id: I8ef8e578b27523d9e7190503fbf95d1eb863a149 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Remove custom code for converting from QString to QColorSimon Hausmann2014-03-281-47/+5
| | | | | | | | | | | | | | | | | | After commit 9b021a1fbd0b974a452a6e18a8c0b4b97cbf8edb in qtbase we can now (about a year later ;-) remove the custom code from handling alpha when converting from string to color and rely on the implementation in qtbase. Change-Id: Ia8086c99f0f782742d3adf12cb2c3b79dee8d578 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| * Cleanup: Remove last traces of QQmlScriptSimon Hausmann2014-03-191-1/+0
| | | | | | | | | | | | | | | | | | | | What remains is the code for removing .pragma from script source code (and replacing it with white-space to preserve line/column numbers). The previous code even returned the value of the pragmas, but for the remaining caller sites that value isn't used, so we can just return void. Change-Id: I16db15da236970660b817d6c4493005365a7a1af Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Doc: Document signals (not handlers) under \qmlsignalSze Howe Koh2014-03-181-5/+9
| | | | | | | | | | | | | | | | Append the handler names to the end of the corresponding signal doc. Task-number: QTBUG-35846 Change-Id: I3d627ba7ed5be94e5c402ab092b4d582536499e8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Register animation profiler callback also from render threadUlf Hermann2014-03-182-8/+26
| | | | | | | | | | | | | | | | | | | | | | The QUnifiedTimer in the GUI thread doesn't cover the render thread animations. We need a separate registration for those. We also need to keep track of which animation events are coming from which threads. Task-number: QTCREATORBUG-11659 Change-Id: I1fdd80a5630cc6a33e527b99be7347f3bd63510f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Say hello to QQuickItem::grabToImage().Gunnar Sletta2014-05-012-0/+7
| | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick][Item] Added functions QQuickItem::grabToImage() and Item::grabToImage() to allow grabbing of items into system-memory images. Change-Id: I76cd73bb62f7440569c6fce63d63528559845721 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Make profiling of pixmap cache events more consistentUlf Hermann2014-04-221-6/+14
|/ | | | | | | | | | Previously canceled replies weren't reported, the cache count was reported before it was updated, and the request or implicit sizes were reported instead of the size actually stored in memory. Task-number: QTBUG-37890 Change-Id: I9d9d9f6b9bfa75c7d56b778fc8174bda4e842d72 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Remove redundant QQmlBinding members.Michael Brasser2014-03-111-1/+1
| | | | | | | | | This reduces the size of QQmlBinding by 12 bytes. Task-number: QTBUG-37134 Change-Id: Id55257edec8cee88d863374e8a96d7eebbeaf523 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>