Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/scene_qpainter_shadow_test.cpp
Show All 29 Lines | |||||
30 | #include <QPair> | 30 | #include <QPair> | ||
31 | #include <QVector> | 31 | #include <QVector> | ||
32 | 32 | | |||
33 | #include <KDecoration2/Decoration> | 33 | #include <KDecoration2/Decoration> | ||
34 | #include <KDecoration2/DecorationShadow> | 34 | #include <KDecoration2/DecorationShadow> | ||
35 | 35 | | |||
36 | #include <KWayland/Client/server_decoration.h> | 36 | #include <KWayland/Client/server_decoration.h> | ||
37 | #include <KWayland/Client/shadow.h> | 37 | #include <KWayland/Client/shadow.h> | ||
38 | #include <KWayland/Client/shell.h> | | |||
39 | #include <KWayland/Client/shm_pool.h> | 38 | #include <KWayland/Client/shm_pool.h> | ||
40 | #include <KWayland/Client/surface.h> | 39 | #include <KWayland/Client/surface.h> | ||
41 | #include <KWayland/Server/shadow_interface.h> | 40 | #include <KWayland/Server/shadow_interface.h> | ||
42 | #include <KWayland/Server/surface_interface.h> | 41 | #include <KWayland/Server/surface_interface.h> | ||
43 | 42 | | |||
44 | #include "kwin_wayland_test.h" | 43 | #include "kwin_wayland_test.h" | ||
45 | 44 | | |||
46 | #include "composite.h" | 45 | #include "composite.h" | ||
▲ Show 20 Lines • Show All 580 Lines • ▼ Show 20 Line(s) | |||||
627 | { | 626 | { | ||
628 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Decoration)); | 627 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Decoration)); | ||
629 | 628 | | |||
630 | QFETCH(QSize, windowSize); | 629 | QFETCH(QSize, windowSize); | ||
631 | QFETCH(WindowQuadList, expectedQuads); | 630 | QFETCH(WindowQuadList, expectedQuads); | ||
632 | 631 | | |||
633 | // Create a decorated client. | 632 | // Create a decorated client. | ||
634 | QScopedPointer<Surface> surface(Test::createSurface()); | 633 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
635 | QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data())); | 634 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
636 | QScopedPointer<ServerSideDecoration> ssd(Test::waylandServerSideDecoration()->create(surface.data())); | 635 | QScopedPointer<ServerSideDecoration> ssd(Test::waylandServerSideDecoration()->create(surface.data())); | ||
637 | 636 | | |||
638 | auto *client = Test::renderAndWaitForShown(surface.data(), windowSize, Qt::blue); | 637 | auto *client = Test::renderAndWaitForShown(surface.data(), windowSize, Qt::blue); | ||
639 | 638 | | |||
640 | QSignalSpy sizeChangedSpy(shellSurface.data(), &ShellSurface::sizeChanged); | 639 | QSignalSpy sizeChangedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); | ||
641 | QVERIFY(sizeChangedSpy.isValid()); | 640 | QVERIFY(sizeChangedSpy.isValid()); | ||
642 | 641 | | |||
643 | // Check the client is decorated. | 642 | // Check the client is decorated. | ||
644 | QVERIFY(client); | 643 | QVERIFY(client); | ||
645 | QVERIFY(client->isDecorated()); | 644 | QVERIFY(client->isDecorated()); | ||
646 | auto *decoration = client->decoration(); | 645 | auto *decoration = client->decoration(); | ||
647 | QVERIFY(decoration); | 646 | QVERIFY(decoration); | ||
648 | 647 | | |||
Show All 39 Lines | |||||
688 | } | 687 | } | ||
689 | 688 | | |||
690 | void SceneQPainterShadowTest::testShadowTextureReconstruction() | 689 | void SceneQPainterShadowTest::testShadowTextureReconstruction() | ||
691 | { | 690 | { | ||
692 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::ShadowManager)); | 691 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::ShadowManager)); | ||
693 | 692 | | |||
694 | // Create a surface. | 693 | // Create a surface. | ||
695 | QScopedPointer<Surface> surface(Test::createSurface()); | 694 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
696 | QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data())); | 695 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
697 | auto *client = Test::renderAndWaitForShown(surface.data(), QSize(512, 512), Qt::blue); | 696 | auto *client = Test::renderAndWaitForShown(surface.data(), QSize(512, 512), Qt::blue); | ||
698 | QVERIFY(client); | 697 | QVERIFY(client); | ||
699 | QVERIFY(!client->isDecorated()); | 698 | QVERIFY(!client->isDecorated()); | ||
700 | 699 | | |||
701 | // Render reference shadow texture with the following params: | 700 | // Render reference shadow texture with the following params: | ||
702 | // - shadow size: 128 | 701 | // - shadow size: 128 | ||
703 | // - inner rect size: 1 | 702 | // - inner rect size: 1 | ||
704 | // - padding: 128 | 703 | // - padding: 128 | ||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |