Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/scene_opengl_shadow_test.cpp
Show All 25 Lines | |||||
26 | #include <QPair> | 26 | #include <QPair> | ||
27 | #include <QVector> | 27 | #include <QVector> | ||
28 | 28 | | |||
29 | #include <KDecoration2/Decoration> | 29 | #include <KDecoration2/Decoration> | ||
30 | #include <KDecoration2/DecorationShadow> | 30 | #include <KDecoration2/DecorationShadow> | ||
31 | 31 | | |||
32 | #include <KWayland/Client/server_decoration.h> | 32 | #include <KWayland/Client/server_decoration.h> | ||
33 | #include <KWayland/Client/shadow.h> | 33 | #include <KWayland/Client/shadow.h> | ||
34 | #include <KWayland/Client/shell.h> | | |||
35 | #include <KWayland/Client/shm_pool.h> | 34 | #include <KWayland/Client/shm_pool.h> | ||
36 | #include <KWayland/Client/surface.h> | 35 | #include <KWayland/Client/surface.h> | ||
37 | #include <KWayland/Server/shadow_interface.h> | 36 | #include <KWayland/Server/shadow_interface.h> | ||
38 | #include <KWayland/Server/surface_interface.h> | 37 | #include <KWayland/Server/surface_interface.h> | ||
39 | 38 | | |||
40 | #include "kwin_wayland_test.h" | 39 | #include "kwin_wayland_test.h" | ||
41 | 40 | | |||
42 | #include "composite.h" | 41 | #include "composite.h" | ||
▲ Show 20 Lines • Show All 580 Lines • ▼ Show 20 Line(s) | |||||
623 | { | 622 | { | ||
624 | QFETCH(QSize, windowSize); | 623 | QFETCH(QSize, windowSize); | ||
625 | QFETCH(WindowQuadList, expectedQuads); | 624 | QFETCH(WindowQuadList, expectedQuads); | ||
626 | 625 | | |||
627 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Decoration)); | 626 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Decoration)); | ||
628 | 627 | | |||
629 | // Create a decorated client. | 628 | // Create a decorated client. | ||
630 | QScopedPointer<Surface> surface(Test::createSurface()); | 629 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
631 | QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data())); | 630 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
632 | QScopedPointer<ServerSideDecoration> ssd(Test::waylandServerSideDecoration()->create(surface.data())); | 631 | QScopedPointer<ServerSideDecoration> ssd(Test::waylandServerSideDecoration()->create(surface.data())); | ||
633 | 632 | | |||
634 | auto *client = Test::renderAndWaitForShown(surface.data(), windowSize, Qt::blue); | 633 | auto *client = Test::renderAndWaitForShown(surface.data(), windowSize, Qt::blue); | ||
635 | 634 | | |||
636 | QSignalSpy sizeChangedSpy(shellSurface.data(), &ShellSurface::sizeChanged); | 635 | QSignalSpy sizeChangedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); | ||
637 | QVERIFY(sizeChangedSpy.isValid()); | 636 | QVERIFY(sizeChangedSpy.isValid()); | ||
638 | 637 | | |||
639 | // Check the client is decorated. | 638 | // Check the client is decorated. | ||
640 | QVERIFY(client); | 639 | QVERIFY(client); | ||
641 | QVERIFY(client->isDecorated()); | 640 | QVERIFY(client->isDecorated()); | ||
642 | auto *decoration = client->decoration(); | 641 | auto *decoration = client->decoration(); | ||
643 | QVERIFY(decoration); | 642 | QVERIFY(decoration); | ||
644 | 643 | | |||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
687 | { | 686 | { | ||
688 | // this test verifies that top/right/bottom/left shadow tiles are | 687 | // this test verifies that top/right/bottom/left shadow tiles are | ||
689 | // still drawn even when corner tiles are missing | 688 | // still drawn even when corner tiles are missing | ||
690 | 689 | | |||
691 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::ShadowManager)); | 690 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::ShadowManager)); | ||
692 | 691 | | |||
693 | // Create a surface. | 692 | // Create a surface. | ||
694 | QScopedPointer<Surface> surface(Test::createSurface()); | 693 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
695 | QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data())); | 694 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
696 | auto *client = Test::renderAndWaitForShown(surface.data(), QSize(512, 512), Qt::blue); | 695 | auto *client = Test::renderAndWaitForShown(surface.data(), QSize(512, 512), Qt::blue); | ||
697 | QVERIFY(client); | 696 | QVERIFY(client); | ||
698 | QVERIFY(!client->isDecorated()); | 697 | QVERIFY(!client->isDecorated()); | ||
699 | 698 | | |||
700 | // Render reference shadow texture with the following params: | 699 | // Render reference shadow texture with the following params: | ||
701 | // - shadow size: 128 | 700 | // - shadow size: 128 | ||
702 | // - inner rect size: 1 | 701 | // - inner rect size: 1 | ||
703 | // - padding: 128 | 702 | // - padding: 128 | ||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | |||||
783 | void SceneOpenGLShadowTest::testDistributeHugeCornerTiles() | 782 | void SceneOpenGLShadowTest::testDistributeHugeCornerTiles() | ||
784 | { | 783 | { | ||
785 | // this test verifies that huge corner tiles are distributed correctly | 784 | // this test verifies that huge corner tiles are distributed correctly | ||
786 | 785 | | |||
787 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::ShadowManager)); | 786 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::ShadowManager)); | ||
788 | 787 | | |||
789 | // Create a surface. | 788 | // Create a surface. | ||
790 | QScopedPointer<Surface> surface(Test::createSurface()); | 789 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
791 | QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data())); | 790 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
792 | auto *client = Test::renderAndWaitForShown(surface.data(), QSize(64, 64), Qt::blue); | 791 | auto *client = Test::renderAndWaitForShown(surface.data(), QSize(64, 64), Qt::blue); | ||
793 | QVERIFY(client); | 792 | QVERIFY(client); | ||
794 | QVERIFY(!client->isDecorated()); | 793 | QVERIFY(!client->isDecorated()); | ||
795 | 794 | | |||
796 | // Submit the shadow to KWin. | 795 | // Submit the shadow to KWin. | ||
797 | QScopedPointer<KWayland::Client::Shadow> clientShadow(Test::waylandShadowManager()->createShadow(surface.data())); | 796 | QScopedPointer<KWayland::Client::Shadow> clientShadow(Test::waylandShadowManager()->createShadow(surface.data())); | ||
798 | QVERIFY(clientShadow->isValid()); | 797 | QVERIFY(clientShadow->isValid()); | ||
799 | 798 | | |||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |