aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgrenderloop.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix backend API, broken since 5.2.0Gunnar Sletta2014-02-041-1/+1
| | | | | | | | Without this change, it is not possible to implement a custom context without also implementing a renderloop. Change-Id: Iac2aa732251cdf7221b28f665394cdd336a3d846 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Fix leak-on-exit of QSGRenderLoop::s_instanceAlex Montgomery2014-01-281-10/+11
| | | | | | | | | s_instance is created with new and never deleted which causes several destructors to never be called. Task-number: QTBUG-35731 Change-Id: Icccb19186958f8bb74c5fd2b4b41165255debc46 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Safeguard QQuickWindow::hide() against other GL contexts.Gunnar Sletta2013-12-121-0/+2
| | | | | | | | | If another GL context is bound to another surface on the GUI thread, we can run into issues while cleaning up the SG nodes. Task-number: QTBUG-34898 Change-Id: Ifa02b7cdbc7ab38b3a149a21452cc5071498a7d1 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Delay renderWindow with a timerRobin Burchell2013-11-271-2/+6
| | | | | | | | | | Add an exhaust delay to QSGGuiThreadRenderLoop. Some updates may be done with posted events, and maybeUpdate event competed with those, leading to partial updates and frames drawn twice. Change-Id: I532bff692c597eeba5bbd6def89ae68c80fdd69b Done-with: Mikko Harju <mikko.harju@jollamobile.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-11-201-0/+2
|\ | | | | | | Change-Id: Id732233d56e8d1706f62ef7a153d4a471406c551
| * Make sure we clean up GL resources before we delete the GL context.Gunnar Sletta2013-11-181-0/+2
| | | | | | | | | | | | | | Task-number: QTBUG-34806 Change-Id: I5013baaff0ca86357292474976944c1a3056f219 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Safely abort when we don't succeed in creating a GL context.Gunnar Sletta2013-11-191-0/+1
|/ | | | | | | Task-number: QTBUG-33363 Change-Id: Ia2b0c329157786cb4ec703989f12d2fdb1ce6bc8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Added QSG_INFO=1 environment variable to spit out graphics infoGunnar Sletta2013-11-051-1/+9
| | | | | Change-Id: I12bc0bc475b3e99185aefcd58eef5a0fb5e9852e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Added private API for enabling sharing between the QQuickwindow instances.Gunnar Sletta2013-11-011-0/+2
| | | | | | | | This API is primarily a hook which is needed by the Qt WebEngine to set up sharing with the scene graph's OpenGL contexts. Change-Id: I5bb03abd9ab99f502db8e413fe838a8b30365b8d Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-5/+12
| | | | | | | | | | | | | | | | | | | See the task for the full reasoning behind this patch. The threaded renderloop has been refactored to have one window per thread. This is mostly a simplification of the current code path where for loops over multiple windows are turned into if (window). The QSGContext has been split into two classes, QSGRenderContext for which there is one per OpenGLContext. The rest of the patch is name changes and a couple of cleanups in the hopes of simplifying this change. Task-number: QTBUG-33993 Change-Id: I31c81f9694d7da7474a72333169be38de62613c4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QSGRenderLoop: don't dereference gl pointer if it has been deletedDmitry Shachnev2013-09-261-1/+2
| | | | | Change-Id: Icd612b243cdfe1248d1b94964c53f5102f9558d2 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Animators - Render thread animation systemGunnar Sletta2013-09-211-10/+13
| | | | | | | | | | | | 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>
* Set incubation controller when a Window{} is loaded via QQmlApplicationEngineAlan Alpert2013-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This was the one convenience that was lost when transitioning templates from QQuickView + Item{} to QQmlApplicationEngine + Window{}. As the default window incubation controller was tied to the first window's frameSwapped, we could easily run into a situation where a secondary window required incubation while the first window was idle. This would then starve the incubation controller. Instead make it so that the renderloop emits "timeToIncubate" once it is done with a renderpass over all windows, so the incubator gets to run once and exactly once per vsync when animating. The incubator logic was also flawed in that it could post a lot of events to itself as a result of incubatingObjectCountChanged and thus starve system events while processing incubation requests. Now we start a timer and don't start it again until we have completed an incubation pass. Task-number: QTBUG-31203 Change-Id: Iea9e2c81efb46bb7875c70ccda0cdc4b3b3e58e7 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QmlProfiler: SceneGraph profilingChristiaan Janssen2013-05-061-11/+25
| | | | | Change-Id: Ide71b330b13fc3816ed191bd9af84e0fce0d9587 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Renderloop for WindowsGunnar Sletta2013-04-241-12/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | The normal GUI thread render loop has several problems on windows. It does not do vsync animations and on some hardware, where the vsync delta is higher than the time it takes to fire a 16ms timer, the eventloop will always contain at least one event and we never return to processing non-client area events, like resize. Also, threaded OpenGL seems rather unstable, so the threaded renderer is not a stable option. So we introduce a windows based renderloop. It is fully cross platform but written to make the most out of the limitations which exist. The overall goal is: - vsync animations when allowed by the system. We get this by using an animation driver and advancing in sync with rendering - Keep system load low and allow for NC processing. The maybeUpdate function will start a short timer which will let the renderloop idle for few ms, allowing the eventloop to pick up system events. (this is similar to what the threaded renderer also does, btw) Change-Id: Ic192fd0ed7d5ecdaa2c887c08cbeb42c5de6b8a8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Remove dead code.Gunnar Sletta2013-04-171-28/+4
| | | | | | | | | | | | | | | The renderWithoutShowing was a piece of functionality that we experimented on long ago and it never quite worked and has it currently only adds bloat. It would be sensible to be able to render a window without showing it on screen, such as for testing purposes, but then it should be done through proper public API and thouroughly supported cross platform. Change-Id: I6bea7335f769c038a8167bad77c2dba171359be9 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Remove resize hook from QSGRenderLoop, exposureChanged is enough.Gunnar Sletta2013-04-041-7/+0
| | | | | | | | | After much back and forth, I think we have settled on the right approach in QtGui, which is that resizeEvent is pretty much useless as the action happens on the following exposeEvent(). Change-Id: I5e87bda89853907d041f56acf9a2895e540c41f0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Our debug env vars are a mess. Standardize on QSG_RENDER_TIMINGGunnar Sletta2013-04-041-5/+5
| | | | | Change-Id: I4e88b479a8a9a5126312a05800e8170511b1f7ac Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Abort rendering when QOpenGLContext::create/makeCurrent fails.Gunnar Sletta2013-03-131-5/+13
| | | | | | Task-number: QTBUG-30158 Change-Id: Ic8239fe6f074c989e4474d46042e1a82796b4908 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Make sure exposeEvents trigger a render passGunnar Sletta2013-02-211-1/+3
| | | | | | | | We needs this on non-compositing window managers to trigger repaints on partial updates. Change-Id: Ied5f3e854173c5e00ad7e1222aeb66eb9c96158c Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* GUI render loop did not render on expose, nor clean up properly.Gunnar Sletta2013-02-181-4/+13
| | | | | Change-Id: I6f9ab43ad6d149295487d9f69ceb0131cd142776 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Complete rewrite of threaded render loop.Gunnar Sletta2013-01-181-0/+363
This change starts using the superior implementation of the scene graph render loop which has been worked on in the scenegraph-playground project for a while. It uses a far more straightforward locking/sync paradigm compared to the existing one and is less deadlock and error prone. It also enables the scene graph thread to run on its own when the GUI thread is blocked, enabling threaded animations. This changes also introduces a naming change inside Qt Quick from "Window Manager" -> "Render Loop" as that fits better to what the code does. Change-Id: I1c2170ee04fcbef79660bd7dae6cace647cdb276 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>