diff --git a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp --- a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp +++ b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp @@ -20,11 +20,13 @@ #include "kwin_wayland_test.h" #include "platform.h" #include "client.h" +#include "composite.h" #include "cursor.h" #include "screenedge.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" +#include "scene.h" #include "shell_client.h" #include @@ -51,9 +53,6 @@ void DontCrashAuroraeDestroyDecoTest::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); qRegisterMetaType(); @@ -77,6 +76,10 @@ QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void DontCrashAuroraeDestroyDecoTest::init() diff --git a/autotests/integration/dont_crash_empty_deco.cpp b/autotests/integration/dont_crash_empty_deco.cpp --- a/autotests/integration/dont_crash_empty_deco.cpp +++ b/autotests/integration/dont_crash_empty_deco.cpp @@ -20,7 +20,9 @@ #include "kwin_wayland_test.h" #include "platform.h" #include "client.h" +#include "composite.h" #include "cursor.h" +#include "scene.h" #include "screenedge.h" #include "screens.h" #include "wayland_server.h" @@ -48,9 +50,6 @@ void DontCrashEmptyDecorationTest::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -68,6 +67,10 @@ QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void DontCrashEmptyDecorationTest::init() diff --git a/autotests/integration/dont_crash_no_border.cpp b/autotests/integration/dont_crash_no_border.cpp --- a/autotests/integration/dont_crash_no_border.cpp +++ b/autotests/integration/dont_crash_no_border.cpp @@ -21,7 +21,9 @@ #include "kwin_wayland_test.h" #include "platform.h" #include "client.h" +#include "composite.h" #include "cursor.h" +#include "scene.h" #include "screenedge.h" #include "screens.h" #include "wayland_server.h" @@ -55,9 +57,6 @@ void DontCrashNoBorder::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -80,6 +79,10 @@ QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void DontCrashNoBorder::init() diff --git a/autotests/integration/dont_crash_reinitialize_compositor.cpp b/autotests/integration/dont_crash_reinitialize_compositor.cpp --- a/autotests/integration/dont_crash_reinitialize_compositor.cpp +++ b/autotests/integration/dont_crash_reinitialize_compositor.cpp @@ -86,6 +86,10 @@ QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void DontCrashReinitializeCompositorTest::init() diff --git a/autotests/integration/effects/scripted_effects_test.cpp b/autotests/integration/effects/scripted_effects_test.cpp --- a/autotests/integration/effects/scripted_effects_test.cpp +++ b/autotests/integration/effects/scripted_effects_test.cpp @@ -170,6 +170,10 @@ QVERIFY(workspaceCreatedSpy.wait()); QVERIFY(Compositor::self()); + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); + KWin::VirtualDesktopManager::self()->setCount(2); } diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -25,6 +25,7 @@ #include "effectloader.h" #include "cursor.h" #include "platform.h" +#include "scene.h" #include "shell_client.h" #include "wayland_server.h" #include "workspace.h" @@ -86,13 +87,15 @@ config->sync(); kwinApp()->setConfig(config); - if (QFile::exists(QStringLiteral("/dev/dri/card0"))) { - qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); - } + qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", "1"); kwinApp()->start(); QVERIFY(workspaceCreatedSpy.wait()); QVERIFY(Compositor::self()); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void SlidingPopupsTest::init() diff --git a/autotests/integration/effects/toplevel_open_close_animation_test.cpp b/autotests/integration/effects/toplevel_open_close_animation_test.cpp --- a/autotests/integration/effects/toplevel_open_close_animation_test.cpp +++ b/autotests/integration/effects/toplevel_open_close_animation_test.cpp @@ -21,10 +21,12 @@ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "composite.h" #include "deleted.h" #include "effectloader.h" #include "effects.h" #include "platform.h" +#include "scene.h" #include "shell_client.h" #include "wayland_server.h" #include "workspace.h" @@ -81,6 +83,10 @@ kwinApp()->start(); QVERIFY(workspaceCreatedSpy.wait()); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void ToplevelOpenCloseAnimationTest::init() diff --git a/autotests/integration/effects/wobbly_shade_test.cpp b/autotests/integration/effects/wobbly_shade_test.cpp --- a/autotests/integration/effects/wobbly_shade_test.cpp +++ b/autotests/integration/effects/wobbly_shade_test.cpp @@ -82,6 +82,10 @@ kwinApp()->start(); QVERIFY(workspaceCreatedSpy.wait()); QVERIFY(Compositor::self()); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void WobblyWindowsShadeTest::init() diff --git a/autotests/integration/generic_scene_opengl_test.cpp b/autotests/integration/generic_scene_opengl_test.cpp --- a/autotests/integration/generic_scene_opengl_test.cpp +++ b/autotests/integration/generic_scene_opengl_test.cpp @@ -49,9 +49,6 @@ void GenericSceneOpenGLTest::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -78,6 +75,10 @@ kwinApp()->start(); QVERIFY(workspaceCreatedSpy.wait()); QVERIFY(Compositor::self()); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void GenericSceneOpenGLTest::testRestart_data() diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -20,7 +20,9 @@ #include "kwin_wayland_test.h" #include "platform.h" #include "abstract_client.h" +#include "composite.h" #include "cursor.h" +#include "scene.h" #include "screenedge.h" #include "screens.h" #include "wayland_server.h" @@ -182,9 +184,6 @@ void LockScreenTest::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -201,6 +200,10 @@ QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void LockScreenTest::init() diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -302,9 +302,6 @@ void PlasmaWindowTest::testLockScreenNoPlasmaWindow() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } // this test verifies that lock screen windows are not exposed to PlasmaWindow QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated); QVERIFY(plasmaWindowCreatedSpy.isValid()); diff --git a/autotests/integration/scene_opengl_shadow_test.cpp b/autotests/integration/scene_opengl_shadow_test.cpp --- a/autotests/integration/scene_opengl_shadow_test.cpp +++ b/autotests/integration/scene_opengl_shadow_test.cpp @@ -113,9 +113,6 @@ { // Copied from generic_scene_opengl_test.cpp - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -154,6 +151,10 @@ group.sync(); Workspace::self()->slotReconfigure(); + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); + } void SceneOpenGLShadowTest::cleanup()