summaryrefslogtreecommitdiffstats
path: root/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Mark the whole repo with QT_NO_CONTEXTLESS_CONNECTAhmad Samir2024-02-151-3/+2
| | | | | | | | | | | | | | | | | | | | By adding it to the default build flags via .cmake.conf. tst_primaryselectionv1 and tst_datadevicev1: the connection type needs to be explicitly set to DirectConnection, otherwise the test fails. The sender and receiver are the same object, so typically would be in the same thread. The docs say: "If the receiver lives in the thread that emits the signal, Qt::DirectConnection is used." I suspect because the code is running inside CoreCompositor::exec() the signaling thread is different from the thread the objects live in, so leaving the type as AutoConnection when sender/receiver are the same object doesn't lead to the type becoming DirectConnection. Task-number: QTBUG-116296 Change-Id: Iad49889134a78fa723973ba6efbc237038f35b82 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Fix deletion of new queued shm buffers during reconnectDavid Redondo2024-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | When reconnecting the cleanup of existing buffers is delayed in order to preserve contents and copy them to buffers belonging to the new connection. Due to the order of events it could happen that a new buffer was deleted along with the old ones but still being referenced by a window. During reconnect all QScreens are removed and new ones added for the wl_outputs on the new connection during the initial roundtrips. When the first new QScreen is added all QWindows move form the placeholder screen to it. This can cause for example QWidgets to repaint. At this point the windows are not reinited yet, and the buffer is queued inside the window. Only afterwards the reconnected signal was emitted which would cause deletion of all existing buffers including the newly queued ones. To fix this the signal is moved after the first roundtrip where all globals are announced and new buffers can be created but no new screens have been announced yet. The signal is renamed to be more fit for its new location. Pick-to: 6.7 Pick-to: 6.6 Change-Id: I06be14d235ac342a4b420176aadad3ccf18178fe Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Avoid creating decorations in the render threadDavid Edmundson2024-01-111-2/+0
| | | | | | | | | | | | | | | | | createDecoration is called when on the main thread from when window flags change, implicitly from initWindow, and also every handleWindowStatesChanged which will be called when we get the first configure event in an xdg shell. There is no need to create the decoration in QWaylandGLContext::makeCurrent. Any current call to makeCurrent before the platform window is shown will not create a decoration as there's a check for a shell surface. Any call afterwards will have already been handled by initWindow. Similarly the SHM backend store does not need to handle decorations itself. Fixes: QTBUG-105703 Pick-to: 6.7 Pick-to: 6.6 Change-Id: I644cece28277131cf7a65eaa234ff08c8431d544 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Don't lock render thread when blocking swap is usedEskil Abrahamsen Blomfeldt2023-12-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | By default, Qt will use a non-blocking eglSwapBuffers() and implement our own frame event mechanism with a time-out. When the blocking version of eglSwapBuffers() is in use (either because it's manually enabled or because the driver does not support the alternative), it depends on the main thread to poll events, as it will wait indefinitely for a frame callback. This is incompatible with our locking of the surface for the duration of the frame, since we may end up locking the main thread in QWaylandWindow::reset() during shutdown while the render thread is simultaneously locked in eglSwapBuffers(). The lock was implemented to work around a bug in one family of graphics drivers, so we simply disable it when blocking eglSwapBuffers() is used. If we need to put this back, we would need a more advanced approach and make sure we continue to poll events even while we're waiting for access to the surface. Pick-to: 6.5 6.6 6.7 Fixes: QTBUG-118890 Change-Id: I04f7d2b168726d82c38fe3fafd350dcab928b956 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Warn if eglSwapBuffers failDavid Redondo2023-11-241-1/+2
| | | | | | | | | This failing was the cause of windows freezing on NVidia. If it happens for some other reason we can now see why. Pick-to: 6.6 Change-Id: Iabd44b1b3f73a54adac3024436ffe116ca15d21a Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Introduce path for surviving compositor restartsDavid Edmundson2023-03-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces an optional mechanism for clients to survive a crash and reconnect seemingly seamlessly. In the event of a disconnect from the compositor socket we simply try to reconnect again and replay any data needed so that we maintain a consistent state to where we left off. From an application point-of-view any open popups will be dismissed and we we potentially get a new framecallback, but it will be almost entirely transparent. Users of custom QWaylandClientExtensions will be notified via the activeChanged signal and rebuild as though the compositor had withdrawn and re-announced the global. OpenGL contexts will be marked as invalid, and handled the same way as a GPU reset. On the next frame RHI will notice these are invalid and recreate them, only now against a new wl_display and new EGLDisplay. Users of low level EGL/native objects might be affected, but the alternative at this point is being closed anyway. The entire codepath is only activated via an environment variable. Change-Id: I6c4acc885540e14cead7640794df86dd974fef4f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QWaylandGLContext: print the 0x prefix in error codeThiago Macieira2022-08-101-2/+2
| | | | | | | | | So it's not ambiguous that this is hex, in messages like: "WARNING: QWaylandGLContext::makeCurrent: eglError: 3003" Pick-to: 6.4 Change-Id: Ie4bb662dcb274440ab8bfffd1709ba0415c3d790 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-101-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I106d3a5d1a7b96250380b6f51a48f3b19d10e4d9 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Do not delete window decorations before next updateInho Lee2022-02-091-8/+10
| | | | | | | | | | | | | When window decorations are turned on/off, a timing issue might happen with accessing deleted decorations. A boolean value, mWindowDecorationEnabled, will be used instead of mWindowDecoration. Pick-to: 6.3 6.2 Fixes: QTBUG-59627 Change-Id: I5514a408d89340fdbf481721ea2dc4bf62078852 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: Fix crash on shutdown on Mesa driverEskil Abrahamsen Blomfeldt2021-12-211-11/+23
| | | | | | | | | | | | | | | | | | | | | On Wayland, then the mesa driver is in use, calling eglDestroySurface() while OpenGL commands are being executed may crash. While this means the driver does not operate by the specs in this case, the driver is so popular that it makes sense to work around it. To work around this, we read-lock the surface while rendering and wait for a write-lock before we destroy the EGL surface. [ChangeLog][QtWaylandClient] Fixed a crash on shutdown that could happen with some graphics-heavy applications when running on Mesa drivers. Pick-to: 6.3 Fixes: QTBUG-92249 Change-Id: I8b8461066cc9f948dc44ddeeddaa6e7d92b76f04 Reviewed-by: Liang Qi <liang.qi@qt.io>
* client: Gracefully handle shutdown and window hidingEskil Abrahamsen Blomfeldt2021-05-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | When a window is hidden or destroyed, the render thread may already be rendering. We need to properly read-lock the surface pointer when it is in use and exit when it becomes null. Note that there is also a potential crash in the Mesa GL driver where it keeps a proxy to the wl_surface, so if we delete this while we are still rendering, it can crash inside the driver. This is not addressed by this patch, and has not been reproduced on any other drivers so far. [ChangeLog][Client] Fixed a crash that could happen when hiding or closing windows while Qt Quick was actively rendering on a different thread. Pick-to: 6.0 6.1 5.15 Fixes: QTBUG-91264 Fixes: QTBUG-90037 Task-number: QTBUG-92249 Change-Id: I029b123b83c58740321e8b90a463ced748d8bcf4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Export wayland-egl client hwintegrationElvis Lee2021-04-281-2/+2
| | | | | | | | | | | Support wayland-egl client hwintegration as a module for external build. Change-Id: I3e82838d0cc89d4bb1435b835dc1e9b592319ddf Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace scale with devicePixelRatio for non-integer scalingJungi Byun2021-03-251-1/+1
| | | | | | | | | | | | | | | The 'scale' event from wayland cannot support non-integer scaling which was originally supported in Qt. As default, devicePixelRatio follows the 'scale' so that the high DPI still works as the mechanism in Wayland. But if non-integer scaling factor such as 150% is needed, it can be supported to override the devicePixelRatio. Change-Id: I63a04db27bd521264b6d0904e1ddd05a572dc970 Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Jungi Byun <jungi.byun@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix memory leak in QWaylandGLContextEskil Abrahamsen Blomfeldt2021-01-061-0/+2
| | | | | | | | | | | | | | We were leaking an EGL context with every GL context created, which lead to rapid OOM errors in stress tests. [ChangeLog][Qt Wayland Client] Fixed a memory leak when creating QOpenGLContexts on Wayland and using the wayland-egl backend. Fixes: QTBUG-85608 Pick-to: 5.15 Pick-to: 6.0 Change-Id: I8426b5df36ec7ab9e66ce15f9e02edad3aca60b9 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Make QWaylandGLContext a QEGLPlatformContextMichal Klocek2020-08-051-151/+36
| | | | | | | | | | | Since 6ff7947 we have a new way of querying for native context. Rewrite some methods to reuse base implementation. [ChangeLog][Client] Using EGL_KHR_surfaceless_context when querying the surface format, if not supported falling back to temporary wayland surface. Change-Id: I276e4b1108a703fb3cf1587db007537e3f36b2fe Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move window decoration check out of qwaylandglcontextMichal Klocek2020-08-051-5/+2
| | | | | | | | QWaylandGLContext is usead only by wayland-egl. Move window decoration check to client buffer platform integration. Change-Id: If26811cd017066afa2508e2f33b33a0fa0b690b3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adapt to recent qtbase changes and update dependenciesFriedemann Kleint2020-07-291-1/+1
| | | | | | | | | - moving linuxaccessibility/xkbcommon/eglsupport/glxsupport to QtGui - event refactoring Task-number: QTBUG-83255 Change-Id: Ic82ee6ef5652413781468edb58c601ee7dce2e3b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-081-2/+2
| | | | | | Task-number: QTBUG-84469 Change-Id: I4bc7b2eb2913fc828f09f96e21480b76cabf8656 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add means for forcing non-blocking buffer swap supportOtto Ryynänen2020-06-041-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | In case of a driver that does not properly indicate its capability of supporting non-blocking eglSwapBuffers() call, the need arises to be able to manually force the resolution of that check. New environment variable QT_WAYLAND_FORCE_NONBLOCKING_SWAP_SUPPORT added. If it is defined to 0 (i.e. false), the non-blocking swap support is forced to behave as if the driver had been detected not to be supported. Equally setting it to 1 causes the non-blocking swap support resolution to remain true (default) even if driver reports it does not support it. [ChangeLog][Client] Added support for environment variable QT_WAYLAND_FORCE_NONBLOCKING_SWAP_SUPPORT, which can be used to force the resolution of detecting if EGL driver supports non-blocking eglSwapBuffers call. If you encounter application freezing while waiting indefinitely for a buffer swap, then try setting variable to 0. Task-number: QTBUG-84226 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I92dc505d12daf4d78dc18e4f85f3a55ecdf109f3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-04-291-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/client/xdgoutput/tst_xdgoutput.cpp Regenerated CMake projects. Removed duplicate wayland source in tests/auto/client/xdgoutput/xdgoutput.pro. It's still referenced via the included shared.pri file. Regenerated the CMake project to adapt to that. Otherwise the CMake project fails to configure due to duplicate rules with a error like the one below CMake Error at src/compositor/Qt6WaylandCompositorMacros.cmake:13 (add_custom_command): Attempt to add a custom rule to output tests/auto/client/xdgoutput/wayland-xdg-output-unstable-v1-server-protocol.h.rule Also use a workaround fix for configuring CMake standalone tests due to regression introduced by dd7e40b1086020f6a054957f4972720cd684 in qtbase. Change-Id: Ib364b851a1fa828c153efbf8653c9e4ef5e618cd
| * Test the EGL wayland platform extensions before using themSamuli Piippo2020-03-051-1/+1
| | | | | | | | | | | | | | | | | | The Khronos headers may be recent enough to have the ifdefs but implementation might still be missing on some platforms. Don't use the extensions unless the configure test passes. Change-Id: I23129115729567fa92bc23da099d27df598fc206 Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
* | Replace QT_OPENGL_ES_2 with QT_CONFIGEskil Abrahamsen Blomfeldt2020-04-171-1/+1
| | | | | | | | | | | | | | | | | | QT_CONFIG is the new and robust way of checking the build configuration of Qt. Task-number: QTBUG-83467 Change-Id: Ia58b308b9b8a242df479cbd01d088204eed73a75 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix build after QOpenGLShaderProgram library moveSimon Hausmann2020-03-161-1/+1
| | | | | | | | | | | | | | The class is now in QtOpenGL. Change-Id: Ifef8dfa753fb5d337d516a33fc49e610c7c8c6eb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Fix build: Add dependency on OpenGL moduleJohan Klokkhammer Helsing2020-01-301-1/+1
|/ | | | | | | | | | Several of the QOpenGL* classes we depend on has moved to QtOpenGL, add the dependency and fix the include paths. Task-number: QTBUG-74409 Change-Id: Iab7949dd67befaa71cf2cfa041771e93f4e47160 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Enable QtWayland for QNXJames McDonnell2020-01-131-1/+5
| | | | | | | | | | | | Make EGL 1.5 with EGL_PLATFORM_WAYLAND_EXT a requirement for QNX and add some EGL 1.5 code alternatives. Avoids the need to deal with incompatibility problems between the QNX native display/window type and Wayland display/window type. Change-Id: Ib26a020e1f8c7f570c6af08697d8c8153c887294 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Dan Cape <dcape@qnx.com>
* Client: really use OpenGL ES 2 API for decoration blitterPeter Seiderer2019-12-041-1/+1
| | | | | | | | | | Really use (as the comment states) the OpenGL ES 2 API for the decoration blitter. Task-number: QTBUG-80356 Change-Id: I4c923343e721a824521fb9b2b36be5d2de984325 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devJohan Klokkhammer Helsing2019-05-071-14/+11
|\ | | | | | | | | | | | | | | Conflicts: src/client/qwaylanddisplay_p.h src/client/qwaylandwindow.cpp Change-Id: I50eb5c83a8b81e4bdb032b68d41f429b17d0a74d
| * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-05-021-14/+11
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandwindow_p.h Change-Id: Ic4104c48267d1682bb58d6b38afc833c39515eae
| | * Client: Full implementation for frame callbacks (second try)Johan Klokkhammer Helsing2019-04-241-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Wayland plugin now takes full control over delivering update request and implement frame callbacks for both egl and shm. [ChangeLog][QPA plugin] The non-blocking version of eglSwapBuffers is now used, if supported. This fixed a bug where minimized windows would block the event loop. [ChangeLog][QPA plugin] Windows that don't get frame callbacks from the compositor within 100 ms are now set as not exposed. This should stop most clients from rendering unnecessary frames to minimized or hidden windows. Also, when we relied on the QPA version of requestUpdate, we would sometimes deliver one update request while we were waiting for a frame callback. When we implement the fallback timer ourselves we can make sure we only deliver the fallback if there are no pending frame callbacks. QtQuick and other applications often depend on blocking swapBuffers to throttle animations. If the context's surface format has a non-zero swapInterval, try to emulate a blocking swap. Fixes: QTBUG-69077 Change-Id: I3c6964f31a16e9aff70b8ec3c5340e640a30fef2 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-101-145/+58
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp Done-with: Johan Klokkhammer Helsing <johan.helsing@qt.io> Change-Id: Ia6fa28454f681b4965b5e18f635cb8c40da316f3
| * | Use a dedicated EGLContext for the decorations blitterGiulio Camuffo2019-04-051-145/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to drop all the StateGuard code, reduce OpenGL state changes when blitting and to also support windows that requested an OpenGL Core context. Change-Id: Ie507a14a04b3d26cdf31f68973057553fa8493bf Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Merge remote-tracking branch 'qt/5.13' into devPaul Olav Tvete2019-03-211-0/+1
|\| | | | | | | | | | | Change-Id: I3dc204fcaa71c01a80b0c622443012eb07964431
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-161-0/+1
|/| | | |/ | | | | Change-Id: Ifb1c6c64abbb5c453092eeb1aff91572b57de410
| * Client xdg-shell: Fix crash when switching popupsJohan Klokkhammer Helsing2019-02-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call to flushWindowSystemEvents() sometimes caused new popups to be shown in the middle of hiding another. I.e. if multiple events show and hide surfaces, they would be shown/hidden in opposite order of their corresponding events. QMenus sometimes suffered from this (can be seen with the qopenglwidget example from qtbase). When the flush was added 5 years ago in 50f43a0c5, it was to "reduce the chances of seeing a bad frame". I don't see any rendering artifacts, though, and I can't find any bug report on it. So let's hope it's safe to remove the hack. [ChangeLog][QPA plugin] Fixed a crash that sometimes happened when switching popups. Also adds more info to the workaround warning message that appears when a popup grab is attempted and there already is another grabbing popup that is not the parent. Fixes: QTBUG-73524 Change-Id: Ibfcbb48c4bbe295c2be1a30add2d7e05cad398c5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Fix incorrect decoration size when QT_SCALE_FACTOR is setJohan Klokkhammer Helsing2019-01-301-2/+2
|/ | | | | | | | | [ChangeLog][QPA plugin] Fixed a bug where window decorations were to small for for the content when QT_SCALE_FACTOR was set. Fixes: QTBUG-72993 Change-Id: I1ed26e038c27f7c4454a6bcc04f0849e4af789e7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix black client windows when not using window decorations on NVIDIADominik Holland2019-01-081-1/+6
| | | | | | | | | | QWaylandGlContext::makeCurrent() tries to be smart and only call eglMakeCurrent() if really needed. This causes problems on NVIDIA where the call is always needed. Change-Id: I08d881d69f79a0fd4ea83a65780052e269a566be Task-number: QTBUG-71697 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Revert "Client: Full implementation for frame callbacks"Johan Klokkhammer Helsing2019-01-081-7/+15
| | | | | | | | | | | | | | | | This caused regressions because QtQuick depends on swapBuffers for throttling animations. We probably need to emulate a blocking swapBuffers and continue after a timeout, but until we have a patch for this, revert this to avoid releasing a regression. This brings back the bug with a frozen event loop when a surface is waiting for a frame callback, but this is preferable to a regression. This reverts commit 1dc85b95ab0adc1e805d059e2c35c671ef790011. Fixes: QTBUG-72578 Change-Id: If6435a947aae5e9fd775404649a392bfafe9130a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Full implementation for frame callbacksJohan Klokkhammer Helsing2018-12-131-15/+7
| | | | | | | | | | | | | | | | | | | The Wayland plugin now takes full control over delivering update request and implement frame callbacks for both egl and shm. Fixes two bugs: [ChangeLog][Client] The non-blocking version of eglSwapBuffers is now used. This fixed a bug where minimized windows would block the event loop. Also, when we relied on the QPA version of requestUpdate, we would sometimes deliver one update request while we were waiting for a frame callback. When we implement the fallback timer ourselves we can make sure we only deliver the fallback if there are no pending frame callbacks. Fixes: QTBUG-69077 Change-Id: I2d3a6896c32e63d8520b57448a3601a817816a91 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Fix deadlock for xdg-shell when makeCurrent is called earlyJohan Klokkhammer Helsing2018-09-261-1/+2
| | | | | | | | | | | | If makeCurrent was called before the window was exposed, it would disable resizing, which would block the window from applying the configure which the client needs to ack in order to be exposed. Fixes the issue by locking resizing only if the window is exposed. Change-Id: I0e6b30bc4b08886fb95d502cac0b735d4bb732d2 Fixes: QTBUG-70646 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Workaround for crash in QWaylandGlContext::makeCurrentv5.12.0-alpha1Johan Klokkhammer Helsing2018-09-121-0/+3
| | | | | | | | | | QOpenGLContext::makeCurrent no longer sets the current context before calling the platform function. Task-number: QTBUG-70511 Change-Id: I67766d43b1142b0742f655b5c2728f4c87fbfb5f Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix regression in QWaylandGlContext::makeCurrent for offscreen surfacesJohan Klokkhammer Helsing2018-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QPA plugin] Fixed a bug where offscreen surfaces would get surfaceless EGL contexts. Fixes a regression in in bf09c7a1. The call, window->updateSurface(window->isExposed()), is problematic because offscreen textures are never exposed, and consequently, eglSurface will be EGL_NO_SURFACE, which will then create a surfaceless context in the call: eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context) This reverts to the old behavior of always trying to create an EGL surface, unless the window doesn't have a valid wl_surface, in which case it doesn't make sense (which is what bf09c7a1 fixed, QTBUG-65553). Task-number: QTBUG-70242 Task-number: QTBUG-68605 Task-number: QTBUG-67601 Change-Id: I44b07bb8bf4b33c73c6379a1de8e9e5cfd220b51 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Respect requested surface when creating gl contextMichal Klocek2018-06-131-1/+1
| | | | | | | | | | | When creating gl context with egl pass reference format [ChangeLog][QPA plugin] Fixed a bug where QSurfaceFormat::renderableType() was ignored when creating an OpenGL context. Change-Id: Id7ae55413b8b515e344e9147345631186bef6d6c Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Don't try to create compatibility GL context when profile is unsetv5.11.0-beta2Johan Klokkhammer Helsing2018-03-091-4/+12
| | | | | | | | Context creation would sometimes fail because of this. Change-Id: Icf73a42ee2bb984ebfc09b7ed98f094d544134b8 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use default member initialization for raw pointersJohan Klokkhammer Helsing2018-02-281-3/+3
| | | | | | | | Initialize to nullptr to prevent undefined behavior. Change-Id: I7753c0be77a886d62ecb1cd7b86fc8c98340b0b8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Init variables where they are declared when possible (clang-tidy)Johan Klokkhammer Helsing2018-02-271-3/+0
| | | | | | | | | | | | | | | | | | | | clang-tidy -p compile_commands.json $file \ -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' \ -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' \ -header-filter='qtwayland' \ -fix Afterwards I ran search and replace on the diff to clean up some whitespace errors: - Replaced '(\n\+[^:\n]*)(:\s+\+\s+)' with '$1: ' - Replaced '(\n\+[^,\n]*)(,\s+\+\s+)' with '$1, ' - Replaced '\n\+\s*\n' with '\n' I also had to do some manual edits, because for some reason, this particular clang-tidy check doesn't trigger for some files. Change-Id: I3b3909bac4bf20108bbe8ad1e01bcc54236dae1b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2018-01-311-1/+1
|\ | | | | | | Change-Id: I603cbb164e6015c1bb7796bd8bb055d84dbc3b04
| * Don't recreate hidden egl surfacesDavid Edmundson2018-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWaylandEglWindow deletes surfaces when a window changes from hidden to visible, presumably as a result of us not having a valid wl_surface object. By extension it doesn't make sense to create a surface whilst a window is still hidden. This fixes a crash where a QQuickWindow hides and then is destroyed. In QQuickWindow destruction we have to create a valid context in order to delete any textures/assets owned by the scene graph; as the wl_surface has gone this causes an error in the EGL libs when we create an EGL surface. Task-number: QTBUG-65553 Change-Id: I9b37a86326bf2cd7737c4e839c1aa8c74cf08116 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Replace Q_NULLPTR with nullptrKevin Funk2017-09-261-1/+1
|/ | | | | | | Change-Id: I9699a957430b8d3574ce29acb91b7ada9ea6209b Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crashing in non-core GLES functions on some systemsLaszlo Agocs2016-11-291-2/+7
| | | | | | | | | | | | The 5.7 refactoring for QOpenGLFunctions introduced new requirements for the QPlatformGLContext::getProcAddress implementations. Implementations outside of qtbase were unfortunately forgotten. QtWayland's implementation does not derive from the common EGL version so it needs its own patch. Task-number: QTBUG-57326 Change-Id: Ie2ad22bf5986870aac74adc1e4c654c616091034 Reviewed-by: Risto Avila <risto.avila@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* use modularized platformsupport modulesv5.8.0-beta1Oswald Buddenhagen2016-10-221-1/+1
| | | | | Change-Id: I7883470e22deb089240d86df7dc2d625a107a53e Reviewed-by: Lars Knoll <lars.knoll@qt.io>