tests/clutter: Use a dummy actor for some interactive tests

While completely untested, at least this makes it work "in theory"
again. Before it'd listen to signals on the stage, but have an incorrect
type signature to handle the test paint procedures, meaning it'd
probably crash or cause memory corruptions.

What was needed was a signal which in the callback the test could call
some cogl functions to paint on the framebuffer. While there is no such
signal on the stage, and the ClutterActor::paint signal (which they
probably used in the past) is long gone, lets add a "test actor" that is
just a wrapper that adds that paint signal with a paint context.

The tests that need it are changed to add this actor to the stage, and
to listen to the paint signal on the actor instead of incorrectly
listening on stage signals.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2807>
This commit is contained in:
Jonas Ådahl
2022-10-13 18:59:47 +02:00
committed by Marge Bot
parent 48dc8073de
commit 64c3b824fa
4 changed files with 54 additions and 7 deletions

View File

@ -87,6 +87,11 @@ main (int argc, char *argv[]) \
return clutter_test_run (); \
}
#define CLUTTER_TYPE_TEST_ACTOR (clutter_test_actor_get_type ())
CLUTTER_EXPORT
G_DECLARE_FINAL_TYPE (ClutterTestActor, clutter_test_actor,
CLUTTER, TEST_ACTOR, ClutterActor)
CLUTTER_EXPORT
void clutter_test_init (int *argc,
char ***argv);