aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgrenderloop.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Properly collect polish timings from all render loopsUlf Hermann2014-07-021-3/+5
| | | | | | | | | | | | | | | | | | | | | | 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 categorized logging for all things scenegraph.Gunnar Sletta2014-07-011-25/+31
| | | | | | | | | | Change-Id: I865ee838b0fd6c257b7189f24130012b98206fd1 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-101-15/+33
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Follow QOpenGLContext API renamingLaszlo Agocs2014-04-251-1/+1
| | | | | | | | | | | | Task-number: QTBUG-38564 Change-Id: Ice1170339f7d650fcb6accfccf325471629343d6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Use global context sharing from QtGui instead of QSGContextJocelyn Turcotte2014-04-041-2/+2
| | | | | | | | | | | | | | | | | | This removes QSGContext::sharedOpenGLContext and replace its uses with QOpenGLContextPrivate::globalShareContext, which is also going to be used by QOpenGLWidget and QQuickWidget. Change-Id: I1e296c3e6832f717caaf31ba7d7b27c06249219b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Destroy render loop when QCoreApplication is cleaned up.Gunnar Sletta2014-03-291-5/+7
| | | | | | | | | | | | | | | | | | Doing it on 'aboutToQuit' meant we would clean it up whenever an application ran QCoreApp::exec() which could be multiple times per application run. Change-Id: I59e06398a551ae7979e3832dff811937037fa106 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * Fix QQuickView::grabWindow() on retina displaysMorten Johan Sørvig2014-03-201-1/+1
| | | | | | | | | | | | | | | | | | Multiply by window->devicePixelRatio() at all qt_gl_read_framebuffer() call sites. Task-number: QTBUG-35962 Change-Id: If58e4f97fc5d931ba2e222f8cb1a0641d52c3257 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Fix potential crash during shutdown for QQuickWindowsGunnar Sletta2014-03-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The cleanup() function would deregister the render loop from all windows the render loop had seen, but the render loop doesn't see windows until the window gets a showEvent and for some implementations it was removed as a result of hideEvent. So add explicit tracking to QSGRenderLoop which is managed by QQuickWindow's constructor and destructor. With this, we no longer need the lists from the subclasses, so these functions are removed again. Change-Id: I05e5507ad57e23c80bacd99752654cc7d0890dc1 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
| * Unset the current gl window when deletedGiulio Camuffo2014-03-171-0/+2
| | | | | | | | | | | | | | | | | | | | This does in the QSGGuiThreadRenderLoop what 403045a did for the QSGThreadedRenderLoop. Fix a memory corruption in Mesa's dri2 EGL when setting a window current after deleting the previous current one. Change-Id: I8df0bacdf12f71e969a9ea39842a402c9a2a303f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Make sure QSGRenderLoop is cleaned up cleanly.Gunnar Sletta2014-03-141-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e13547c595913c58e6bd6a5ed80fdc729fae7d47 used a global static to clean up QSGRenderLoop which is triggered very late, potentially after SG backend API plugins have been unloaded. This results in crashes when used in combination with scenegraph-playgrounds's customcontext. Partially revert the change and instead clean up at the time of QApp::aboutToQuit and make sure we also disconnect cleanly from all QQuickWindows. This change also ensures that QSGRenderLoop::windowDestroyed() gets called for all QQuickWindows registered with the render loop. This ensures that rendering stops and that scene graph nodes and resources will be cleaned up regardless of whether the application has remembered to delete the window or not. This is a good thing as it makes the scene graph shutdown a bit cleaner. Change-Id: I9cb9093979f8eac05542f118a6ff9cfe5c84f745 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Compress touch events in QQuickWindow.Gunnar Sletta2014-05-051-0/+6
|/ | | | | | | | | | | | | | Instead of sending multiple touch updates per frame, we store the last one and flush the pending events just before we enter into the scene graph sync phase. [ChangeLog][QtQuick] QQuickWindow will compresses touch events and delivers at most one touch event per frame. Done-with: Robin Burchell <robin.burchell@jollamobile.com> Change-Id: Ia0169bc4a3f0da67709b91ca65c326934b55d372 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Consolidate context creation failure handling in Quick.Friedemann Kleint2014-03-131-10/+33
| | | | | | | | | Add QQuickWidget::sceneGraphError() equivalent to QQuickWindow::sceneGraphError(), move message formatting code to QQuickWindowPrivate. Change-Id: I18cd4d7e0f6ee1011c29375218dc6a044b0d2cf2 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Remove isES() usage in scenegraphLaszlo Agocs2014-03-041-1/+1
| | | | | | | | | The error signal patch added some usages of QOpenGLFunctions::isES(). These need to be temporarily removed. Change-Id: Ibd1d8094059020708aefe4b3502ba56d624928b3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Introduced a few more signals to QQuickWindow.Gunnar Sletta2014-02-251-3/+5
| | | | | | | | | | | | Also marked the new afterAnimation() signal as \since 5.3 and introduced proper revisioning on the new signals. [Changelog][QtQuick] Added QQuickWindow::afterSynchronizing(), openglContextCreated(), sceneGraphAboutToStop(). Useful for deeper integration with the rendering. Change-Id: I5532b310506c2432325595e55ef9307b8934abee Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix wrong assert in QSGRenderLoop::setInstanceMarco Bubke2014-02-251-1/+1
| | | | | | | | | The assert before test not if the scoped pointer is null but the pointer which was holding the scoping pointer. Task-number: QTBUG-36932 Change-Id: I7a5e51752446556c1796bb677fe69cbceffdd3e0 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Add an error signal to QQuickWindowLaszlo Agocs2014-02-211-1/+10
| | | | | | | | | | | | | | When nothing is connected to this signal, an error will be printed or, in case of Windows, a message box will be shown. If there is something connected, it is up to the application to handle the error. [ChangeLog] Added a new sceneGraphError() signal to QQuickWindow which applications can use to detect errors like OpenGL context creation failures and react in their own custom ways. Task-number: QTBUG-36138 Change-Id: I33b1e5e0e3f25872af67c5bb5ae937e3470b25f3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Add a signal for syncing external animation systemsLaszlo Agocs2014-02-201-0/+2
| | | | | | | | | [ChangeLog] QQuickWindow will now emit the afterAnimating() signal from the gui thread before each scenegraph sync request. Change-Id: I4897c82f75066238e781455d4fce4fb6bbe2558e Reviewed-by: Pasi Keränen <pasi.keranen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move QtQuick profiling to own profiler adapterUlf Hermann2014-02-151-3/+3
| | | | | | | | The QtQuick parts of the QML profiler service thus become a proper global profiler which can be independently enabled and disabled. Change-Id: Ifad03801cab2be66a264fc46fdebdae582fcc99b Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-02-111-11/+12
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4context.cpp Change-Id: Ied5b23bec4dc14abe51127c507aed668f855c1e1
| * 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>
* | Further pack messages for QQmlProfilerServiceUlf Hermann2014-01-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | Allow multiple detailTypes in each packet and extend the profiling code to make use of that. Note that this changes the usual order of pixmapSizeKnown and PixmapLoadingFinished events. As far as I can see this doesn't affect the QML profiler frontend and the order of these events isn't specified anywhere. Change-Id: Id39ad98594ccf35add4415e08daf9e92ab561237 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Unify calls to profiler service event methods.Ulf Hermann2014-01-221-7/+5
|/ | | | | | | | | | | | Don't needlessly duplicate information about the profiler being available and allow inlining. Use macros to check availability of the profiler in calling code and generally simplify the code. Task-number: QTBUG-35315 Change-Id: I0a9daec4a95f74b9db795ef2918a01fb772ea107 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.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>