Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/scene_opengl_shadow_test.cpp
Show All 27 Lines | |||||
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/shm_pool.h> | 34 | #include <KWayland/Client/shm_pool.h> | ||
35 | #include <KWayland/Client/surface.h> | 35 | #include <KWayland/Client/surface.h> | ||
36 | #include <KWayland/Server/shadow_interface.h> | 36 | #include <KWaylandServer/shadow_interface.h> | ||
37 | #include <KWayland/Server/surface_interface.h> | 37 | #include <KWaylandServer/surface_interface.h> | ||
38 | 38 | | |||
39 | #include "kwin_wayland_test.h" | 39 | #include "kwin_wayland_test.h" | ||
40 | 40 | | |||
41 | #include "abstract_client.h" | 41 | #include "abstract_client.h" | ||
42 | #include "composite.h" | 42 | #include "composite.h" | ||
43 | #include "effect_builtins.h" | 43 | #include "effect_builtins.h" | ||
44 | #include "effectloader.h" | 44 | #include "effectloader.h" | ||
45 | #include "effects.h" | 45 | #include "effects.h" | ||
▲ Show 20 Lines • Show All 677 Lines • ▼ Show 20 Line(s) | 685 | { | |||
723 | clientShadow->attachBottom(bufferBottom); | 723 | clientShadow->attachBottom(bufferBottom); | ||
724 | 724 | | |||
725 | Buffer::Ptr bufferLeft = shmPool->createBuffer( | 725 | Buffer::Ptr bufferLeft = shmPool->createBuffer( | ||
726 | referenceShadowTexture.copy(QRect(0, 128, 128, 1))); | 726 | referenceShadowTexture.copy(QRect(0, 128, 128, 1))); | ||
727 | clientShadow->attachLeft(bufferLeft); | 727 | clientShadow->attachLeft(bufferLeft); | ||
728 | 728 | | |||
729 | clientShadow->setOffsets(QMarginsF(128, 128, 128, 128)); | 729 | clientShadow->setOffsets(QMarginsF(128, 128, 128, 128)); | ||
730 | 730 | | |||
731 | QSignalSpy shadowChangedSpy(client->surface(), &KWayland::Server::SurfaceInterface::shadowChanged); | 731 | QSignalSpy shadowChangedSpy(client->surface(), &KWaylandServer::SurfaceInterface::shadowChanged); | ||
732 | QVERIFY(shadowChangedSpy.isValid()); | 732 | QVERIFY(shadowChangedSpy.isValid()); | ||
733 | clientShadow->commit(); | 733 | clientShadow->commit(); | ||
734 | surface->commit(Surface::CommitFlag::None); | 734 | surface->commit(Surface::CommitFlag::None); | ||
735 | QVERIFY(shadowChangedSpy.wait()); | 735 | QVERIFY(shadowChangedSpy.wait()); | ||
736 | 736 | | |||
737 | // Check that we got right shadow from the client. | 737 | // Check that we got right shadow from the client. | ||
738 | QPointer<KWayland::Server::ShadowInterface> shadowIface = client->surface()->shadow(); | 738 | QPointer<KWaylandServer::ShadowInterface> shadowIface = client->surface()->shadow(); | ||
739 | QVERIFY(!shadowIface.isNull()); | 739 | QVERIFY(!shadowIface.isNull()); | ||
740 | QCOMPARE(shadowIface->offset().left(), 128.0); | 740 | QCOMPARE(shadowIface->offset().left(), 128.0); | ||
741 | QCOMPARE(shadowIface->offset().top(), 128.0); | 741 | QCOMPARE(shadowIface->offset().top(), 128.0); | ||
742 | QCOMPARE(shadowIface->offset().right(), 128.0); | 742 | QCOMPARE(shadowIface->offset().right(), 128.0); | ||
743 | QCOMPARE(shadowIface->offset().bottom(), 128.0); | 743 | QCOMPARE(shadowIface->offset().bottom(), 128.0); | ||
744 | 744 | | |||
745 | QVERIFY(client->effectWindow()); | 745 | QVERIFY(client->effectWindow()); | ||
746 | QVERIFY(client->effectWindow()->sceneWindow()); | 746 | QVERIFY(client->effectWindow()->sceneWindow()); | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 782 | { | |||
803 | Buffer::Ptr bufferTopLeft = shmPool->createBuffer(referenceTileTexture); | 803 | Buffer::Ptr bufferTopLeft = shmPool->createBuffer(referenceTileTexture); | ||
804 | clientShadow->attachTopLeft(bufferTopLeft); | 804 | clientShadow->attachTopLeft(bufferTopLeft); | ||
805 | 805 | | |||
806 | Buffer::Ptr bufferTopRight = shmPool->createBuffer(referenceTileTexture); | 806 | Buffer::Ptr bufferTopRight = shmPool->createBuffer(referenceTileTexture); | ||
807 | clientShadow->attachTopRight(bufferTopRight); | 807 | clientShadow->attachTopRight(bufferTopRight); | ||
808 | 808 | | |||
809 | clientShadow->setOffsets(QMarginsF(256, 256, 256, 0)); | 809 | clientShadow->setOffsets(QMarginsF(256, 256, 256, 0)); | ||
810 | 810 | | |||
811 | QSignalSpy shadowChangedSpy(client->surface(), &KWayland::Server::SurfaceInterface::shadowChanged); | 811 | QSignalSpy shadowChangedSpy(client->surface(), &KWaylandServer::SurfaceInterface::shadowChanged); | ||
812 | QVERIFY(shadowChangedSpy.isValid()); | 812 | QVERIFY(shadowChangedSpy.isValid()); | ||
813 | clientShadow->commit(); | 813 | clientShadow->commit(); | ||
814 | surface->commit(Surface::CommitFlag::None); | 814 | surface->commit(Surface::CommitFlag::None); | ||
815 | QVERIFY(shadowChangedSpy.wait()); | 815 | QVERIFY(shadowChangedSpy.wait()); | ||
816 | 816 | | |||
817 | // Check that we got right shadow from the client. | 817 | // Check that we got right shadow from the client. | ||
818 | QPointer<KWayland::Server::ShadowInterface> shadowIface = client->surface()->shadow(); | 818 | QPointer<KWaylandServer::ShadowInterface> shadowIface = client->surface()->shadow(); | ||
819 | QVERIFY(!shadowIface.isNull()); | 819 | QVERIFY(!shadowIface.isNull()); | ||
820 | QCOMPARE(shadowIface->offset().left(), 256.0); | 820 | QCOMPARE(shadowIface->offset().left(), 256.0); | ||
821 | QCOMPARE(shadowIface->offset().top(), 256.0); | 821 | QCOMPARE(shadowIface->offset().top(), 256.0); | ||
822 | QCOMPARE(shadowIface->offset().right(), 256.0); | 822 | QCOMPARE(shadowIface->offset().right(), 256.0); | ||
823 | QCOMPARE(shadowIface->offset().bottom(), 0.0); | 823 | QCOMPARE(shadowIface->offset().bottom(), 0.0); | ||
824 | 824 | | |||
825 | QVERIFY(client->effectWindow()); | 825 | QVERIFY(client->effectWindow()); | ||
826 | QVERIFY(client->effectWindow()->sceneWindow()); | 826 | QVERIFY(client->effectWindow()->sceneWindow()); | ||
Show All 37 Lines |