From dfa4796eae910b5ca09d971102450e6eea8b9a10 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 12 Jan 2017 14:04:04 +0100 Subject: [PATCH] Compositor: Don't require OpenGL to build the QML APIs [ChangeLog][Compositor API] The compositor API now works without OpenGL support. This makes the compositor API work with shared memory clients only. If OpenGL clients connect they will currently punch holes in the compositor window, but fixing that is out of scope for this patch. Fixes: QTBUG-74896 Change-Id: I6c1ba82f28ba9edecf380e471124e15d16f9518e Reviewed-by: Paul Olav Tvete --- tests/auto/wayland/client/tst_client.cpp | 8 ++++++++ tests/auto/wayland/surface/tst_surface.cpp | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/tests/auto/wayland/client/tst_client.cpp b/tests/auto/wayland/client/tst_client.cpp index 08120c8c24f..e9ae5e4b352 100644 --- a/tests/auto/wayland/client/tst_client.cpp +++ b/tests/auto/wayland/client/tst_client.cpp @@ -36,7 +36,9 @@ #include #include #include +#if QT_CONFIG(opengl) #include +#endif #include #include @@ -107,6 +109,7 @@ public: QPoint mousePressPos; }; +#if QT_CONFIG(opengl) class TestGlWindow : public QOpenGLWindow { Q_OBJECT @@ -136,6 +139,7 @@ void TestGlWindow::paintGL() glClear(GL_COLOR_BUFFER_BIT); ++paintGLCalled; } +#endif // QT_CONFIG(opengl) class tst_WaylandClient : public QObject { @@ -176,7 +180,9 @@ private slots: void dontCrashOnMultipleCommits(); void hiddenTransientParent(); void hiddenPopupParent(); +#if QT_CONFIG(opengl) void glWindow(); +#endif // QT_CONFIG(opengl) void longWindowTitle(); private: @@ -458,6 +464,7 @@ void tst_WaylandClient::hiddenPopupParent() QTRY_VERIFY(compositor->surface()); } +#if QT_CONFIG(opengl) void tst_WaylandClient::glWindow() { QSKIP("Skipping GL tests, as not supported by all CI systems: See https://bugreports.qt.io/browse/QTBUG-65802"); @@ -483,6 +490,7 @@ void tst_WaylandClient::glWindow() testWindow->setVisible(false); QTRY_VERIFY(!compositor->surface()); } +#endif // QT_CONFIG(opengl) void tst_WaylandClient::longWindowTitle() { diff --git a/tests/auto/wayland/surface/tst_surface.cpp b/tests/auto/wayland/surface/tst_surface.cpp index dddff0866f0..9659235a079 100644 --- a/tests/auto/wayland/surface/tst_surface.cpp +++ b/tests/auto/wayland/surface/tst_surface.cpp @@ -28,7 +28,9 @@ #include "mockcompositor.h" #include +#if QT_CONFIG(opengl) #include +#endif using namespace MockCompositor; @@ -39,7 +41,9 @@ private slots: void cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); } void createDestroySurface(); void waitForFrameCallbackRaster(); +#if QT_CONFIG(opengl) void waitForFrameCallbackGl(); +#endif void negotiateShmFormat(); }; @@ -89,6 +93,7 @@ void tst_surface::waitForFrameCallbackRaster() } } +#if QT_CONFIG(opengl) void tst_surface::waitForFrameCallbackGl() { QSKIP("TODO: This currently fails, needs a fix"); @@ -129,6 +134,7 @@ void tst_surface::waitForFrameCallbackGl() bufferSpy.removeFirst(); } } +#endif // QT_CONFIG(opengl) void tst_surface::negotiateShmFormat() {