summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandquickcompositor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Documentation: update examples for extensionsJohan Klokkhammer Helsing2017-10-161-2/+2
| | | | | | Change-Id: If8840594b4077a464e97b4cb6db2fe8b70edf70d Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Fix licensingv5.9.0-beta4Jani Heikkinen2017-05-041-13/+16
| | | | | | | | | | Currently tests are licensed under GPL-EXCEPT, examples under BSD and src under LGPL so replase old license headers with new & proper ones. Also remove old & unused license files Task-number: QTBUG-57147 Change-Id: Ia6a738798736c275dc309ccfa5b627dc2178d241 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace all occurrences of Q_DECL_OVERRIDE with overrideJohan Klokkhammer Helsing2017-01-231-2/+2
| | | | | Change-Id: I16b7b23efe944b49d1fcc9e7588cdb0a991cebd1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Refactor buffer handlingPaul Olav Tvete2016-10-011-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | We cannot support bindToTexture() functions. On some platforms the texture is provided by the driver. Therefore, the HW integration must always provide a texture. This has the added bonus of unifying the two separate code paths that were introduced when EGLStream support was added. Add a separate buffer manager that owns all buffers. Don't destroy buffer objects on release. The client will probably attach them again later. Also, release shm buffers immediately after uploading to texture (needs to be documented that image() will not work afterwards). Make the old SurfaceBuffer class into an abstract base class, so we can store state in the buffer class instead of having to map from the wl_resource in each buffer integration. Move the shared memory buffer handling into a separate subclass. Change-Id: I81e471d13c92913d31ea1efe487f93fa908b5e0c Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Make QWaylandKeymap a QObjectJohan Klokkhammer Helsing2016-09-301-0/+1
| | | | | | | | | This makes it possible to use defaultSeat declaratively by allowing it to be uninitialized until the QWaylandCompositor::create has been called. Change-Id: I962cc7cc82a0bbc9240abb50cf92dee77e4a0ba6 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'qt/5.7' into 5.8v5.8.0-alpha1Liang Qi2016-08-281-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compositor/compositor_api/qwaylandseat.cpp src/compositor/compositor_api/qwaylandview.cpp tests/auto/compositor/compositor.pro tests/auto/compositor/compositor/testinputdevice.cpp tests/auto/compositor/compositor/testinputdevice.h tests/auto/compositor/testinputdevice.cpp tests/auto/compositor/testinputdevice.h tests/auto/compositor/testseat.cpp tests/auto/compositor/testseat.h Change-Id: I98e045908dd964e5d4120bd35e71b8839c0d923a
| * Doc: Language editsVenugopal Shivashankar2016-08-171-2/+2
| | | | | | | | | | | | | | Task-number: QTBUG-53147 Change-Id: I353cf18b9661b5eb2371072f8091dc890fc7fcf0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Migrate to public QOpenGLTextureBlitterLaszlo Agocs2016-07-291-1/+1
| | | | | | | | | | Change-Id: I481ebdaf9e5749a57223a91ab3a231ca40af059a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: Rename shm to sharedMemoryJohan Klokkhammer Helsing2016-07-111-1/+1
|/ | | | | | | | sharedMemory is much clearer and will increase the readability of the code and API. Change-Id: Ibb6d7424fa8d44a94a0f4ddf476a564eb235323f Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* Add API to grab a surface's contentGiulio Camuffo2016-04-181-0/+66
| | | | | | | | This patch adds a new QWaylandSurfaceGrabber class. The user can use it to grab a surface's content, and get a QImage with the data. Change-Id: I25dd72a8ba39201cd91addbfc976b93ca1e05112 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Rename compositor Shell to WlShellJohan Klokkhammer Helsing2016-04-051-2/+2
| | | | | | | | | | | | | | | | | | | | | * QWaylandShell -> QWaylandWlShell * QWaylandShellSurface -> QWaylandWlShellSurface * QWaylandQuickShellSurfaceItem -> QWaylandQuickWlShellSurfaceItem * Shell -> WlShell (QML) * ShellSurface -> WlShellSurface (QML) * ShellSurfaceItem -> WlShellSurfaceItem (QML) This is done to avoid confusion with XdgShell and will hopefully help clarify that some of the examples only support wl_shell and not xdg_shell. Additionally, this makes "Shell" an available name in the compositor API, which may in turn enable the creation of a more general abstraction hiding the details of the shell backends (i.e. xdg_shell, wl_shell, and eventually ivi_shell). Change-Id: Iebac1f36505084bfaaea68838005d54db6c55e21 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Add documentation to Qt Wayland CompositorEskil Abrahamsen Blomfeldt2015-10-261-0/+21
| | | | | | | | | | | 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-1/+1
| | | | | | | enable building QtWaylandCompositor by default Change-Id: I7cf34052b304ca9fef55b7e30ef6a6367b5d75f1 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Move the createDefaultSurface function to QWaylandCompositorPrivateJørgen Lind2015-09-101-6/+16
| | | | | | | | | | Its really not meant to be reimplemented by other classes than QWaylandCompositor or QWaylandQuickCompositor because of the createSurface signal. If someone really wants to use the virtual function then they can subclass the private Change-Id: Iad88fde3fc999ac18bdc57bd37864884865a962a Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Remove legacy namingJørgen Lind2015-09-101-27/+0
| | | | | Change-Id: Ibf7fad69085b4439b7d5cc3fd1a7aa24ed9e03c3 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Make it possible to connect to a createSurface signalJørgen Lind2015-09-041-2/+2
| | | | | | | | | | | | 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
* Cleanup QWaylandQuickCompositorExtension fileJørgen Lind2015-09-041-0/+1
| | | | Change-Id: I3f0e5a41f0bb15311bd48775be10d81548caf1e3
* Make it possible to construct QWaylandOutputJørgen Lind2015-09-041-14/+0
| | | | | | | | | | | | | | | This requires QWaylandOutput to be initialized. This will happend when the QWaylandCompositor of the QWaylandOutputSpace that is set on the QWaylandOutput is created. QWaylandCompositor will send or post a Polish event to the QWaylandOutput which again will call QWaylandOutput::initialize. This function will create the global that will be put on the wl_displays registry This makes it possible to Create WaylandOutputs in QML (see the pure-qml example) and also gives a better programming model in C++ Change-Id: Iaf907ae18a283678eda6d04390dc9790ae0bced8
* Make Manufacturer & Model modifiable properties of QWaylandOutputJørgen Lind2015-09-021-4/+2
| | | | | | This to make construction look nicer and make them modifyable from QML Change-Id: I5f5ffffb34f664914cdb531736c42a6873bfe18c
* Use QWaylandClient in constructor of QWaylandSurfaceJørgen Lind2015-08-281-1/+1
| | | | | | instead of struct ::wl_client * Change-Id: I606a813e84eeec8134e6ece428f42a53e1ba0189
* Remove QtWayland::Compositor and add QWaylandCompositorPrivateJørgen Lind2015-08-281-2/+0
| | | | | | Embrace PIMPL Change-Id: I8c8b5971e15c208317ff33231bda1513e7b8d489
* Remove QtWayland::SurfaceJørgen Lind2015-08-281-1/+0
| | | | | | | | 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
* Fix missing file rename from QWayalandQuickView -> ....ItemJørgen Lind2015-08-281-1/+2
| | | | Change-Id: I12a12c3f476d223dc278c34ab1a9a39cc5b5f9e5
* Remove the default shell functionalityJørgen Lind2015-08-281-21/+0
| | | | | | | | This will be readded in a different way. Also, remove the WaylandSurfaceChrome since it is no longer needed, and just use WaylandView directly Change-Id: I8d4a7b2135d9fdaea7dd3fcd729e55cceebf48fb
* Remove the QWaylandCompositor::createView virtual functionJørgen Lind2015-08-281-7/+0
| | | | | | | | | Views are just a representation of the QWaylandSurface, and many different types of view "sub-classes" will exist depending on its perticular use. Dont enforce just one view implementation for one compositor. Change-Id: Ie237a73e63638e70713f89b479fb1b248426c9ac
* Rename QWaylandQuickView to QWaylandQuickItemJørgen Lind2015-08-281-2/+2
| | | | | | | | | QuickView is already used for something semantically different, lets stick with Item which is a subclass of QWaylandView A QWaylandView is a view of a surface.... Change-Id: I75975485e7b5fb66444fe9fe400effb124882d32
* Rename QWaylandSurfaceView to QWaylandViewJørgen Lind2015-08-281-4/+4
| | | | | | and rename QWaylandSurfaceItem to QWaylandQuickView Change-Id: I989b482eb79df06e9f265bc2b0ef6b3dce7509d6
* Rework how we manage extensionsJørgen Lind2015-08-281-2/+7
| | | | Change-Id: If2cbf096e7419bc1bda007d5167ce39d1a5d50ae
* Introducing QWaylandOutputSpaceJørgen Lind2015-08-281-2/+3
| | | | | | | | | | Its purpose is to make it possible to have multiscreen environments, and also multiple multioutput environments It is also an abstraction to make it clear that outputs are arranged in a 2d space Change-Id: I418509996a03b2ca1a12aec9c9e25e143a15a10f
* Move the texture ownership from the QWaylandSurfaceJørgen Lind2015-08-281-2/+10
| | | | | | | | | | | | | | | 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
* Make it possible to set a QWaylandSurface on the QWaylandSurfaceViewJørgen Lind2015-08-281-5/+5
| | | | | | This will allow us to use QWaylandSurfaceItem from within QML Change-Id: I6ecfbf3a5de5f5a748a6a85295b9741316fef976
* Make it possible to add the default shell from qmlJørgen Lind2015-08-281-0/+26
| | | | Change-Id: I00f01a42b98dbe76851800b87a725fcca16f824e
* Make it optional to register the QWaylandQuick types to qmlJørgen Lind2015-08-281-4/+31
| | | | Change-Id: Ic50e3516e435a354ad478349d9af86a5a112f5c7
* Make QWaylandCompositor inherit QObjectJørgen Lind2015-08-281-2/+2
| | | | | | | | | | | | | | | | | And remove the constructor arguments, and just having parent as a constructor argument. This requires QWaylandCompositor to have a create semantic familiar from QWindow and QOpenGLContext. On create the native wayland socket is created and initialized. Also the virtual functions surfaceCreated and surfaceAboutToBeDestroyed have been converted to signals, removing the need to subclass QWaylandCompositor Examples have been changed to avoid having two super classes inheriting QObject. This is done by either making the QWindow subclass a member or making the QWaylandCompositor a member. Change-Id: I317d37e2adca15bfe4e1904e20ab0d83943b2d45
* Add createSurface factory function on QWaylandCompositorJørgen Lind2015-08-281-20/+6
| | | | | | This simplifies subclassing the compositor getting Change-Id: I392b84febae62df042b23fa806360bc068bf984f
* Move surface management to outputsJørgen Lind2015-08-281-2/+2
| | | | Change-Id: I427e576a4e0834d6266af2670f7ff47e078153d4
* LGPL v3 license change for Qt Wayland CompositorJørgen Lind2015-07-241-11/+14
| | | | Change-Id: I84ed248b471464214d935352768f300d4b90dec3
* Move surfaces to outputsPier Luigi Fiorini2015-04-211-10/+3
| | | | | | | | | 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-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge branch '5.4' into devGiulio Camuffo2014-11-151-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge done by Giulio Camuffo Conflicts: src/client/client.pro src/client/qwaylanddisplay.cpp src/client/qwaylandinputdevice.cpp src/client/qwaylandinputdevice_p.h src/client/qwaylandwindow.cpp src/compositor/compositor_api/qwaylandsurface.cpp src/compositor/compositor_api/qwaylandsurface_p.h src/compositor/wayland_wrapper/qwlsurface.cpp Change-Id: I1df878bb54f49d953c51215a2772869e261ebe81
| * Fix the compositor's wayland versioningGiulio Camuffo2014-10-091-1/+1
| | | | | | | | | | | | | | | | | | 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>
* | Expose surface's client to QMLPier Luigi Fiorini2014-08-171-0/+2
|/ | | | | | | | | | | | | | | Introduce QWaylandClient class that wraps wl_client credentials and has a method to destroy the client. Add QWaylandClient object as a QWaylandSurface property. This come in handy for example when the compositor wants to kill the process of an unresponsive surface or wants to know client credentails. WaylandClient typedef is now useless thus is replaced by QWaylandClient. Change-Id: I997ec459af0f19baef67e7420c90937b197b2e1d Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Split QWaylandSurface in a model and view fashionGiulio Camuffo2014-04-291-1/+6
| | | | | | | | | | QtQuick compositors already use a view class (QWaylandSurfaceItem), so add a new QWaylandSurfaceView, which is subclassed by QWaylandSurfaceItem, and move the view related methods of QWaylandSurface there. A QWaylandSurface can have many views. Change-Id: I7e92fe1f7e9d252f5f40a3097feabb5f3318b03a Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Rework the way buffers are used and renderedGiulio Camuffo2014-04-291-0/+102
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>