summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandquicksurface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add documentation to Qt Wayland CompositorEskil Abrahamsen Blomfeldt2015-10-261-0/+10
| | | | | | | | | | | This adds some preliminary documentation for the Qt Wayland Compositor. There are a few classes which remain undocumented. The documentation in some areas may be a bit minimal, but this can be expanded gradually with code examples and more details. Change-Id: I5d285a5a25e8602ac2fdddc84c3fd217e7b77c95 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Rename QtCompositor to QtWaylandCompositorJørgen Lind2015-09-101-5/+5
| | | | | | | enable building QtWaylandCompositor by default Change-Id: I7cf34052b304ca9fef55b7e30ef6a6367b5d75f1 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Make it possible to connect to a createSurface signalJørgen Lind2015-09-041-6/+10
| | | | | | | | | | | | Remove the QWaylandSurface factory function from QWaylandCompositor. Add a default constructor to QWaylandSurface and a initialize function. Add som housekeeping code in debug builds that ensures the user calls initialize. Add a fallback factory function on the compositor if the user is fine with getting the default implementation of QWaylandSurface or QWaylandQuickSurface Change-Id: Ib9289c323b6723f0d1119a484cf9e0c26c95b549
* Removed the m_ prefix for variables in QWaylandSurfacePrivateJørgen Lind2015-08-281-1/+2
| | | | | | and remove unnecessary functions Change-Id: I412e5c6e0187e55a0766eee509c02924d3e1a7c9
* Use QWaylandClient in constructor of QWaylandSurfaceJørgen Lind2015-08-281-2/+2
| | | | | | instead of struct ::wl_client * Change-Id: I606a813e84eeec8134e6ece428f42a53e1ba0189
* Remove QtWayland::SurfaceJørgen Lind2015-08-281-4/+4
| | | | | | | | Its enough to have QWaylandSurface and QWaylandSurfacePrivate. Also don't pass QWaylandSurfacePrivate around, but pass QWaylandSurface and then use the QWaylandSurfacePrivate::get function. Change-Id: I915cc9d7b4497ad1c6f1f2dee61d9d0db069ba6b
* Remove output from QWaylandSurfaceJørgen Lind2015-08-281-17/+0
| | | | | | | | | | | | | | | It is the views that belong to outputs. This leads to a couple of interesting cases with enter and leave events, but the implementation says you will get enter events for the first view of a surface entering an output, and for the last view being removed from an output. Also to throttle a surface, there has to be 1 surface which takes care of this. This is because if multiple views throttle, then the client might render to quick. Change-Id: If4bba380fd4d7f506fd769606cbdea4ce58b908d
* Fixups after rebasingJørgen Lind2015-08-281-40/+0
| | | | Change-Id: Ie5d8899157d77f83f2cf65f236d534b972aa4770
* Remove excess definition of QWaylandKeymapJørgen Lind2015-08-281-5/+2
| | | | | | Also remove QWaylandUnmapLock Change-Id: I0b481224fd03032603084142f36be279351f6611
* Fix missing file rename from QWayalandQuickView -> ....ItemJørgen Lind2015-08-281-1/+1
| | | | Change-Id: I12a12c3f476d223dc278c34ab1a9a39cc5b5f9e5
* rename QWaylandExtensionTemplate::get to findInJørgen Lind2015-08-281-1/+1
| | | | Change-Id: I7fcfd2e4974cf1b5b32592a6d5c03ed335a9f446
* Rename QWaylandSurfaceView to QWaylandViewJørgen Lind2015-08-281-1/+1
| | | | | | and rename QWaylandSurfaceItem to QWaylandQuickView Change-Id: I989b482eb79df06e9f265bc2b0ef6b3dce7509d6
* Improve QWaylandExtensionJørgen Lind2015-08-281-2/+3
| | | | | | | | By using curiously recurring template pattern we can generate a getter which is very convenient, and all QWaylandExtensions should have this casting operation Change-Id: Idb5a786655f2e106cf5388b11ed71e8b6ddddec0
* Rework how we manage extensionsJørgen Lind2015-08-281-21/+5
| | | | Change-Id: If2cbf096e7419bc1bda007d5167ce39d1a5d50ae
* Move the output from QWaylandSurface to the QWaylandSurfaceViewJørgen Lind2015-08-281-5/+7
| | | | | | | | | and add a property called primaryOutput on the QWaylandSurface. Also add some bookkeeping in QtWayland::Output so it knows what surfaces and views it currently holds, sending the enter and leave events automatically. Change-Id: Ib6efbc6f8157657fb4451b751bba1cb5345b7906
* Move the texture ownership from the QWaylandSurfaceJørgen Lind2015-08-281-104/+5
| | | | | | | | | | | | | | | to the respective QWaylandSurfaceView. For all GL applications this will have no significant impact, but will cause a memory regression for shm surfaces with multiple views. This is done to simplify the creation and destruction of textures, especially in multi-threaded environments. Also the same patch removes the y_inverted property and replaces it with a origin property. Its done in the same patch as a lot of the code was overlapping. Change-Id: I4bce50c614c9ac3ba0580e0560339476eac03433
* Add WaylandOutputWindow itemJørgen Lind2015-08-281-1/+5
| | | | | | | | | | and add a convenience getter on the QWaylandQuickSurface to retrieve the window. This is because the window typically in qml will have additional properties which we want to retrieve. Instead of doing surface.output.window we can now do surface.outputWindow which looks cleaner Change-Id: Ia3007583a8a0e8e01444cb3f8819fbc651be14ab
* Make QWaylandsurface::output a propertyJørgen Lind2015-08-281-0/+1
| | | | Change-Id: I2c82466b0e3842da901449d7978683922331d05e
* Add a shellView property on QWaylandSurfaceJørgen Lind2015-08-281-0/+6
| | | | Change-Id: I68d05698b3caed11ccec39ef06ac5f912d782cf2
* LGPL v3 license change for Qt Wayland CompositorJørgen Lind2015-07-241-11/+14
| | | | Change-Id: I84ed248b471464214d935352768f300d4b90dec3
* Add a mechanism to delay unmapping of surfacesGiulio Camuffo2015-07-151-13/+9
| | | | | | | | | | When a client attachs a NULL buffer on a surface we may want to hang on to the old buffer for a bit, e.g. to do a hide animation. Add the QWaylandUnmapLock class to keep a surface mapped after an attach(0) request. Change-Id: I5d5be0b36410a76a58d2b68c1b2ac5e3b875a801 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Prevent QWaylandQuickSurface from holding onto multiple buffers indefinitely.Andrew den Exter2015-06-291-2/+12
| | | | | | | | | | | With a queue of just two buffers BufferAttacher can end up holding references to both after the renderer is stopped starving the client application and causing it to block in the glSwapBuffers until the renderer restarts or the surface is destroyed. Release the current buffer to the client when the renderer is stopped so it can continue. Change-Id: Ica0e13ef78f7e6058e273c26b517a88d07f958c7 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Move surfaces to outputsPier Luigi Fiorini2015-04-211-6/+38
| | | | | | | | | Moving surfaces to belong to a specific output. Surfaces can be viewed on a different output anyway. Change-Id: I9ef76300f85190d84b83431374e76e581786e4e7 Done-with: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Update copyright headersJani Heikkinen2015-02-171-21/+13
| | | | | | | | | 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: I5a74d32515c3f1fe7aa1916f4241c92832510f8c Reviewed-by: Antti Kokko <antti.kokko@theqtcompany.com>
* Add QWaylandOutput to support multiple outputsPier Luigi Fiorini2015-02-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a new QWaylandOutput class to support multiple outputs. Each QWaylandOutput need a window for rendering. Rename OutputGlobal to Output and Output to OutputResource. Add support for physical size, mode and available geometry. Use better defaults for geometry and refreshRate from the QWindow if available. A window is no longer passed to QWaylandCompositor constructor and all output related methods are removed, however one or more outputs are required for hardware integration. QWaylandCompositor returns a list of outputs and offers an API to add or remove outputs. Hardware integrations can run headless. Change-Id: I742996571ddb78328f7bfa4f79b25a81995279e1 Done-with: Jan Arne Petersen <jan.petersen@kdab.com> Done-with: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Recreate the surface textures after the scenegraph invalidationv5.4.1Giulio Camuffo2015-01-151-0/+1
| | | | | | | | | When the scenegraph is invalidated we delete the surfaces texture. Set the update flag to true so that when the scene graph is again initialized and starts to draw a frame the textures will be recreated. Change-Id: I2fb171e4bed517e48fa2311c22651150f3e605f7 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Make sure to have valid texturesGiulio Camuffo2014-11-101-0/+4
| | | | | | | | | | | | | | The texture of QWaylandSurfaceItem's texture provider was updated in QWaylandSurfaceItem::updatePaintNode(). That is fine as long as the texture is accessed after the updatePaintNode() call, but if not we would access an invalid texture. That could happen when another QQuickItem subclass was accessing the textire in its updatePaintNode(). We don't have any guarantee on the order of the updatePaintNode() calls, so the other item could be updated before the QWaylandSurfaceItem. Change-Id: I7320d445c72796ce26f8d8483175a35e9c6840e7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix the compositor's wayland versioningGiulio Camuffo2014-10-091-4/+4
| | | | | | | | | We cannot just assume all clients implement the same version of the various interfaces as the compositor does. Keep track of them, and react accordingly when creating a resource or sending an event. Change-Id: I9792433a14d49c5c4df0c892fc1349ce0dfb0d43 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Let the ShellSurface send the mapped and unmapped signals.Giulio Camuffo2014-04-291-1/+1
| | | | | | | | A surface without any attached shell surface should never be mapped, so make the latter set the mapped state on the surface. Change-Id: If09bd9eebecd6e0a52f862cb866d85aec403c3a0 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Rework the way buffers are used and renderedGiulio Camuffo2014-04-291-0/+241
The current way buffers are handled is sub-optimal. They are hidden inside QtWayland::Surface and the actual renderer, be it QtQuick or anything else, cannot get a direct hold of them, nor it can directly control when the underlying textures are created or deleted. The main additions in this commit are the splitting of the QtQuick code path and the new QWaylandBufferRef and QWaylandBufferAttacher classes. QWaylandBufferRef allows a renderer to retain a reference to a wl_buffer even after the underlying Surface discarded it. That allows the renderer to directly decide when to destroy the texture of the buffer. QWaylandBufferAttacher is a pure virtual class which must be implemented by the renderer. Instances of it will be assigned to the QWaylandSurfaces, created. Its attach() virtual method will then be called when a new buffer is committed to the surface. The renderer can then choose to immediately create a texture or wait for some later time. It is its responsibility to create and destroy the GL texture, it will not happen automatically. This functionality is implemented for QtQuick in the new QWaylandQuickCompositor and QWaylandQuickSurface classes. Change-Id: I674b4e5fb8c65c3b1c582e33ff3a0b0e45f2acc9 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>