aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
Commit message (Collapse)AuthorAgeFilesLines
* Improve performance of animators.v5.4.0-beta1Gunnar Sletta2014-10-105-18/+63
| | | | | | | | | | | | | | | 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 issues with Keyboard Focus documentation.Mitch Curtis2014-10-101-3/+3
| | | | | Change-Id: I0dcc364456404a761a555da065452a59d1249a2f Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* PathView: Fix QML engine thinking currentItem is null when it's notSérgio Martins2014-10-101-0/+5
| | | | | | | | QML didn't re-evaluate any bindings using currentItem because a notification was missing. Change-Id: Icdaa3022e0b01644a060e577d87f011b4ea9fabb Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Return the content position rounded on the right sideGiulio Camuffo2014-10-091-9/+9
| | | | | | | | | | | | | | | | | | | QQuickFlickable::contentX/Y() returns the negative of the value stored in the QQuickTimeLineValue used by QQuickFlickable. So we must be careful when using things like qRound, and call it with the negative of the value ine the QQuickTimeLineValue, else code like this would fail: QQuickFlickable *f = ... f->setPixelAligned(true) f->setContentY(-10.5) assert(f->contentY() == qRound(-10.5)) // fail The assert expression indeed turns into -11 == -10, which is false but which is not what the user would expect. Change-Id: Ib92ee2fa613b751462237349d9e4e2f2b4652f82 Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* Export QQuickKeyNavigationAttached as a part of the private APIOleg Shparber2014-10-091-1/+1
| | | | | | | | This change fixes linking problems when QQuickKeyNavigationAttached is used through private headers. Change-Id: I176a9551718d9ba25c160a3b1caa8872c88d39f3 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Make QQuickKeyNavigationAttached respect user set valuesOleg Shparber2014-10-091-6/+6
| | | | | | | | | | Before this change, when user tried to set KeyNavigation property to the value which was previously automatically assigned, user set flag wasn't raised. Such behavior led to situations, when explicitly set values later were not respected by automatic mutual changes. Change-Id: Id5ba5061c03a61f4d7835a638dc746b1485b9a56 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Doc: Updated the QML State Machine docsVenu2014-10-091-1/+2
| | | | | | | | | | | | | | - Excluded the src/imports/statemachine directory from qtquick.qdocconf to avoid unnecessary qdoc warnings. - corrected a broken link to an external source - changed the group name to avoid collision - added a \qmlmodule page for QtQml.StateMachine - Reduced the amount of duplication between the C++ and QML state machine overviews. Task-number: QTBUG-41561 Change-Id: I87c815fada7006f0609331e315bb338f062bb4db Reviewed-by: Topi Reiniö <topi.reinio@digia.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>
* Relax ShaderEffectSource's sourceItem vs window handling.Gunnar Sletta2014-10-091-1/+5
| | | | | | | | | | | For dynamically loaded items, the window may not be set on either the source or the item, so we need to be a bit more relaxed in our checking. This fixes a regression for dynamically loaded GaussianBlur. Change-Id: I3e888405a95058ca79ecd2dff42c0ed4c8fff065 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix missing glyphs in selectionEskil Abrahamsen Blomfeldt2014-10-092-27/+60
| | | | | | | | | | | | | | | | | Change 198009db79a85d3cab7fe3a6432635d36123a2d6 revealed a bug in the new selection algorithm which would occur sometimes when a given run of text spanned several script items. Since we are checking the glyph runs for overlaps in the actual text, we need to report the exact characters spanned by the glyph run. We use the new enabler for this in QGlyphRunPrivate. Added a new test case which is an error case we did not yet cover, which is when there is only a single script item, but several font engines are used to produce it (fallback fonts). Change-Id: Ie4c3e79ad98a033d5c75fd67ada4ae83df33435b Task-number: QTBUG-41808 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Prevent removeFirst call on empty list.Zeno Endemann2014-10-011-2/+2
| | | | | | | | | The hoverItems list might get changed as a result of the sendHoverEvent call, so it is safer to take the element out first. Change-Id: I88c7380a2e4dd2297f9d0cfe01edc453ca525cb3 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Partially revert d9c531781e6c95f80681b3c82700833e1de88794Gunnar Sletta2014-10-015-48/+22
| | | | | | | | | | | | This logic changed then timing for when the layer's m_dirtyTexture was set and unset, which had some side effects. Revert to the old and known-to-work behavior of using a connection. Change-Id: I4048e7ae70491afe36b2d766e6c506d9febc44ed Task-number: QTBUG-41451 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make Canvas use texture atlas for smallish Image based canvases.Gunnar Sletta2014-09-303-17/+10
| | | | | | | | | | | This makes Canvas with Image batchable in the renderer which means that it is feasible to have 100s of small Canvases in a scene, for instance as static icons rendered with a bit of script. Change-Id: I3ad57360d632b7093fd6993afa88ed35c21d178a Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix build when using -WerrorSérgio Martins2014-09-301-1/+1
| | | | | | | | | "'borderBottom' may be used uninitialized in this function [-Werror=maybe-uninitialized]" Observed when compiling for android. Change-Id: Ifcb26e28440f08528a192ea2fe88d6343e33710b Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Add orientationUpdateMask to QQuickScreenAlex Blasche2014-09-302-1/+43
| | | | | | Task-number: QTBUG-38699 Change-Id: I173b7e53c27dba336351572859f7c9aeafe07ef9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Give Item::layer documentation some much needed love.Gunnar Sletta2014-09-2910-2/+460
| | | | | Change-Id: I31e038d961d3aa09a36db0c091c4e4910e395c2e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Doc: Replace VisualDataModel with DelegateModelNico Vertriest2014-09-252-21/+21
| | | | | | | Task-number: QTBUG-37725 Change-Id: Iad3b31470af8ea965d19b3d0901822b901407d40 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Reset 'invalidatePending' after the FBO has been recreated.Gunnar Sletta2014-09-251-0/+1
| | | | | | | | | If not, we will always request a new FBO during updatePaintNode, even when the fbo is not following the items size. Task-number: QTBUG-41565 Change-Id: I20b4b3a8e3630ff963a876320808869bba62fb8a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* move QQuickWindowAttached to QQuickWindowQmlImplShawn Rutledge2014-09-243-12/+7
| | | | | | | | | | It causes problems to do qmlRegisterType on QQuickWindow if the attached property also refers to QQuickWindow. Task-number: QTBUG-40816 Task-number: QTBUG-41047 Change-Id: I7a6f75af52f65e2be022b97128702982bec7cbe8 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix cleanup of non-threaded render loops.Gunnar Sletta2014-09-242-50/+23
| | | | | | | | | | | | | | | | | | | | | | They would unconditionally call cleanupNodesOnShutdown on hide(), but QQuickWindow::sceneGraphInvalidated would only be emitted if this was the last window being hidden, leading to an inconsistent state in the application. Since the non-threaded render loops do not support releasing resources (there is one OpenGL context and one QSGRenderContext shared between all windows) we delay cleanup until the window is destroyed. This change also make the render loops track the windows until they are destroyed, similar to what the threaded one does. The purpose of this is to, in the case of dangling windows, only trigger invalidation of the scene graph when the last QQuickWindow is destroyed through QSGRenderLoop::cleanup(). Task-number: QTBUG-41210 Change-Id: I7e12a4f726ebb3e7935c822b6046abb3590c583a Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Doc: apply title case to all section1 titlesNico Vertriest2014-09-245-8/+8
| | | | | | Task-number: QTBUG-41250 Change-Id: I303d989992c9685f73baae50c64accf71b43549f Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fix clip state tracking in Context2DMatt Fischer2014-09-223-6/+10
| | | | | | | | | | | | | | | | | | A recent change (f45fe58ad2aa741c90b756643da75f1a6bc2fdf6) introduced the concept of clipping being disabled for a context, so that it can start with no clip path set. However, this state is not properly tracked, so an attempt to restore a context state which has no clip path does not work properly. This change adds this information to the Clip command, so that it can be properly restored. This patch also re-enables a test case which was supposed to check this behavior, but had been disabled. Task-number: QTBUG-40312 Change-Id: I3fd5626ecfcc1298a81931828cbb590290098a92 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Don't do qgetenv on library loadThiago Macieira2014-09-221-35/+39
| | | | | | | | | | Bad for two reasons: first, it increases the load time of the application and second, it makes it impossible to to setenv/putenv from main(). The latter is useful if you need to work on an embedded device that doesn't allow setting environment variables. Change-Id: Id543f77336d7ac2e4ea820b51f55ce5a40a33b4e Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Cleanup remaining QtQuick.Dialogs leftoversJ-P Nurmi2014-09-191-3/+1
| | | | | | | QtQuick.Dialogs was moved to the qtquickcontrols module in Qt 5.3 Change-Id: I16d03dc1c342d396963c5bec3125b3d11d0d9bed Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Doc: add documentation for Photo Viewer exampleLeena Miettinen2014-09-191-0/+2
| | | | | Change-Id: Iffedd9361bd0475a53c1a8b9567c9cbf5e5d4867 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Finally: A default animation driver which doesn't use walltime.Gunnar Sletta2014-09-184-22/+134
| | | | | | | | | | | I've wanted this for a long time, but the animation system didn't support it when mixed with timers/pauses. However, because of dfc8f8b5d4a02f33c7f9063c2a28450902a9d863 and 0db3ea4048fe572a256deb343ea5e64a55d98de9 to qtbase, it is now possible. Change-Id: Ic70c181ce49eae90276bd4f22a2d299061f96087 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Sync QQuickWindow::update() up with polishAndSync().Gunnar Sletta2014-09-172-3/+18
| | | | | | | | | | | | | | | When calling QQuickWindow::update() on the GUI thread, we would immediately flag the render thread that a repaint was needed and then schedule a polishAndSync. If the render thread completed the current frame before the GUI thread got to polishAndSync, it would repaint right away without syncing with GUI first. Instead of sending the repaint right away, register the need for a full repaint in the window and set it as part of the next sync phase. Change-Id: Ia731fb46724cc79f5391422213b069de9362d002 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QQuickWindow::setColor() should use update() rather than dirtyItem()Gunnar Sletta2014-09-171-1/+1
| | | | | | | | | | dirtyItem() will trigger maybeUpdate in the renderloop which may decide to skip the render pass if nothing changed in the scene graph. Use update() instead which forces the rendering to go through regardless. Change-Id: I4730bb0cd79d58fa21970a847cc1720060cb14a8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Don't assume a QSGRenderContext is valid just because it's not 0Ulf Hermann2014-09-171-1/+4
| | | | | | | Task-number: QTBUG-41353 Change-Id: I2a8c500ed974b3e5f45f3a1eb1f66c7a24b17d56 Reviewed-by: Andy Nichols <andy.nichols@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Protect QQuickWindow::openglContext against not having a context.Gunnar Sletta2014-09-171-1/+1
| | | | | Change-Id: I3d5087d9c322ee5ee3325858ee717161fd7801a3 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
* Fix crash when borders exceed item width/height in border imageEskil Abrahamsen Blomfeldt2014-09-162-87/+126
| | | | | | | | | | | | | | | | | While we protected against the the borders exceeding the size of the source image when deciding whether to create a given patch, we did not protect against the case where the target rectangle is smaller than the borders. To fix this, we simply move the calculation of the target rectangle up to before we create the nodes, and check for isEmpty() before creating the nodes. In addition, we did not properly handle changing the borders dynamically. The subtree has to be rebuilt if the borders change so that the source or target rectangles change. Change-Id: Ia6a0df616ebbd0a32924de0b63fd48043027930a Task-number: QTBUG-41338 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QQuickTextControl: update cursor rect when cursor changes positionRichard Moe Gustavsen2014-09-163-5/+5
| | | | | | | | | | | | | | If the text cursor changes position by indirect manipulation of the document that backs a QQuickTextControl, we need to inform that the cursor rect changed as well. This will fix a bug with QQuickTextEdit that caused the platform input method to be out of sync since the cursor rect signal was never emitted from the the text control. Task-number: QTBUG-41042 Change-Id: Idcf35a2d51c8dffcb80ba21f8e59a61e04e5a879 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Let QSGPlainTexture support shutting down without a GL context.Gunnar Sletta2014-09-121-1/+1
| | | | | | Change-Id: Iae934e4d9e91f4ea21dd5bf27c4fafc5d481fb0a Task-number: QTBUG-41278 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Link to Key Handling Priorities section more in Keys documentation.Mitch Curtis2014-09-121-0/+5
| | | | | | | | | For those clicking directly on specific property links who might not know that the info they need about event order already exists. Change-Id: I18a9124697f542f5b3a2955ee10dfee538a93385 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* prevent crash when set ShaderEffectSource::sourceItem nullTasuku Suzuki2014-09-121-16/+16
| | | | | | | | Regression introduced in 81ba77d736f07efac37d284cd741d71f9dad4149 Task-number: QTBUG-41241 Change-Id: I9a65af6915325e1cbf9205c7da94273d5b91b310 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Check for valid QSGRenderContext instead of QOpenGLContextAndy Nichols2014-09-111-1/+1
| | | | | | | | A QQuickWindow with a valid QSGRenderContext is what should be checked for in QQuickCanvasItem::itemChange. Change-Id: Ibb85c2bb79d85b2d91b5d68cfa8a4760106047ae Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Select specific features to be recorded when profiling QMLUlf Hermann2014-09-1112-45/+62
| | | | | | | | | | | | 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>
* Fix debug output from renderer.Gunnar Sletta2014-09-111-3/+6
| | | | | | | | It was wrong when we ran without depth buffer or when we used the separate ibo code path. Change-Id: Ie6e4bfc99ee2a4a593e45be7d9af9af17896bcba Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Snap native glyphs to pixel grid in vertex shader.Gunnar Sletta2014-09-115-28/+8
| | | | | | | | | | | The implementation relied on the full matrix, but did not set the RequiresFullMatrix flag. Setting the flag would have serious negative performance impact as it prevents batching, so we solve it in the vertex shader instead. Task-number: QTBUG-38702 Change-Id: I0c245ea9e18b0b29dd9e3073a2648a7f4e061685 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Simon Hausmann2014-09-114-6/+24
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-09-084-6/+24
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4arraydata.cpp src/quick/scenegraph/util/qsgatlastexture.cpp Change-Id: Ic4c96066d5c37dcf0d5446baed590ea005d445ce
| | * Support padding in images stored in atlas textureEskil Abrahamsen Blomfeldt2014-08-301-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | If the stride does not match the width of the image, we upload it line-by-line instead of as one big rect. Change-Id: I5e08afcf5c35dc810fed25e45255d55d932b2a4c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | * 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>
* | | Improve KeyNavigation documentation.Mitch Curtis2014-09-111-2/+2
| | | | | | | | | | | | | | | Change-Id: I07e66deb4b21eca191c17532749eeccd33d83fb0 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | | Improve Drag documentation.Mitch Curtis2014-09-111-6/+7
| | | | | | | | | | | | | | | Change-Id: Ifba60b729c8ad02009cd5c8caa5d58e20a76c73b Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | | QQuickTextInput: calculate height of cursor rect using QTextLine::height()Richard Moe Gustavsen2014-09-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calculating the height of the line using ascent + descent seems inaccurate, since the result will not match what ends up being drawn. QQuickTextEdit uses instead QTextLine::height() for the same function, and this works correct. Since there seems to be no reason to reinvent how to calculate the height when the line already has a function for that, and since the result also seems to be wrong, we change the implementation to use QTextLine::height(). Change-Id: I9c9cd4360b6d4cfd3582756c4efdff9c02065789 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | | Don't post deleteLater on invalid canvas contextsUlf Hermann2014-09-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | QCoreApplication complains about that. The context will only be valid once it has been requested in one way or another. Change-Id: Idb44f2541d71355443a5b491078a3040907b1614 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | Fix pixel bleed in BorderImageEskil Abrahamsen Blomfeldt2014-09-106-72/+393
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keeping all patches of the border image in the same texture with different sample points can cause parts of the border to bleed over to the center patch. To rectify this, we create a separate texture for each of the nine patches we need, and separate image nodes. To avoid applying antialiasing on the interior edges of the border image, we introduce new antialiasing flags which can be used to specify precisely which edges of the image should be antialiased. [ChangeLog][BorderImage] Fixed possible pixel bleed between border patches and center patch in BorderImage. Change-Id: Icc292b3969217320eecca99e79675316c42eab08 Task-number: QTBUG-35838 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | QQuickTextInput: keep floating point precition when calculating offsetRichard Moe Gustavsen2014-09-041-2/+2
| | | | | | | | | | | | | | | | | | Without this patch, positionToRectangle will return a slightly different rectangle than what ends up being drawn. Change-Id: Ib1a3936f0fab393d6016d85d63547ec7f3036b7a Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>