mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
tests: Use ClutterStage "after-paint" instead of ClutterActor "paint"
The "paint" signal of ClutterActor is deprecated and will be removed. We have a good replacement to get notified about stage paints nowadays, that is "after-paint" on ClutterStage, so switch to that signal where it makes sense. I didn't bother to update the few tests (namely Clutters conform/texture-fbo.c, conform/text-cache.c, interactive/test-cogl-multitexture.c and Cogls conform/test-multitexture.c, conform/test-texture-mipmaps.c) where it's harder to replace the signal since we don't build those anyway. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1522
This commit is contained in:
parent
a03e233b44
commit
4e63ed524e
@ -15,7 +15,7 @@ static const ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff };
|
||||
|
||||
|
||||
static void
|
||||
on_paint (ClutterActor *actor,
|
||||
on_after_paint (ClutterActor *actor,
|
||||
ClutterPaintContext *paint_context,
|
||||
void *state)
|
||||
{
|
||||
@ -162,7 +162,7 @@ test_readpixels (TestUtilsGTestFixture *fixture,
|
||||
* the first few frames, and we won't be doing anything else that
|
||||
* will trigger redrawing. */
|
||||
idle_source = g_idle_add (queue_redraw, stage);
|
||||
g_signal_connect_after (stage, "paint", G_CALLBACK (on_paint), NULL);
|
||||
g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), NULL);
|
||||
|
||||
clutter_actor_show (stage);
|
||||
clutter_test_main ();
|
||||
|
@ -140,7 +140,7 @@ check_paint (TestState *state, int x, int y, int scale)
|
||||
#define FRAME_COUNT_UPDATED 8
|
||||
|
||||
static void
|
||||
on_paint (ClutterActor *actor,
|
||||
on_after_paint (ClutterActor *actor,
|
||||
ClutterPaintContext *paint_context,
|
||||
TestState *state)
|
||||
{
|
||||
@ -219,8 +219,8 @@ test_texture_pixmap_x11 (TestUtilsGTestFixture *fixture,
|
||||
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (state.stage), &stage_color);
|
||||
|
||||
paint_handler = g_signal_connect_after (state.stage, "paint",
|
||||
G_CALLBACK (on_paint), &state);
|
||||
paint_handler = g_signal_connect (CLUTTER_STAGE (state.stage), "after-paint",
|
||||
G_CALLBACK (on_after_paint), &state);
|
||||
|
||||
idle_handler = g_idle_add (queue_redraw, state.stage);
|
||||
|
||||
|
@ -66,7 +66,7 @@ assert_rectangle_color_and_black_border (int x,
|
||||
|
||||
|
||||
static void
|
||||
on_paint (ClutterActor *actor,
|
||||
on_after_paint (ClutterActor *actor,
|
||||
ClutterPaintContext *paint_context,
|
||||
void *state)
|
||||
{
|
||||
@ -400,7 +400,7 @@ test_viewport (TestUtilsGTestFixture *fixture,
|
||||
* the first few frames, and we won't be doing anything else that
|
||||
* will trigger redrawing. */
|
||||
idle_source = g_idle_add (queue_redraw, stage);
|
||||
g_signal_connect_after (stage, "paint", G_CALLBACK (on_paint), NULL);
|
||||
g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), NULL);
|
||||
|
||||
clutter_actor_show (stage);
|
||||
clutter_test_main ();
|
||||
|
@ -168,12 +168,12 @@ verify_redraw (Data *data, int expected_paint_count)
|
||||
GMainLoop *main_loop = g_main_loop_new (NULL, TRUE);
|
||||
gulong paint_handler;
|
||||
|
||||
paint_handler = g_signal_connect_data (data->stage,
|
||||
"paint",
|
||||
paint_handler = g_signal_connect_data (CLUTTER_STAGE (data->stage),
|
||||
"after-paint",
|
||||
G_CALLBACK (g_main_loop_quit),
|
||||
main_loop,
|
||||
NULL,
|
||||
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
|
||||
G_CONNECT_SWAPPED);
|
||||
|
||||
/* Queue a redraw on the stage */
|
||||
clutter_actor_queue_redraw (data->stage);
|
||||
|
@ -97,7 +97,7 @@ generate_round_texture (void)
|
||||
}
|
||||
|
||||
static void
|
||||
paint_cb (ClutterActor *stage,
|
||||
on_after_paint (ClutterActor *stage,
|
||||
ClutterPaintContext *paint_context,
|
||||
Data *data)
|
||||
{
|
||||
@ -258,7 +258,7 @@ test_cogl_point_sprites_main (int argc, char *argv[])
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Point Sprites");
|
||||
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL);
|
||||
g_signal_connect_after (stage, "paint", G_CALLBACK (paint_cb), &data);
|
||||
g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), &data);
|
||||
|
||||
clutter_actor_show (stage);
|
||||
|
||||
|
@ -166,7 +166,7 @@ static unsigned int timeout_id = 0;
|
||||
static int shader_no = 0;
|
||||
|
||||
static void
|
||||
paint_cb (ClutterActor *actor,
|
||||
on_after_paint (ClutterActor *actor,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
CoglFramebuffer *framebuffer =
|
||||
@ -326,7 +326,7 @@ test_cogl_shader_glsl_main (int argc, char *argv[])
|
||||
cogl_material_set_layer (material, 0, redhand);
|
||||
|
||||
set_shader_num (0);
|
||||
g_signal_connect_after (stage, "paint", G_CALLBACK (paint_cb), NULL);
|
||||
g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), NULL);
|
||||
|
||||
clutter_actor_set_reactive (stage, TRUE);
|
||||
g_signal_connect (stage, "button-release-event",
|
||||
|
@ -112,7 +112,7 @@ TestCallback tests[] =
|
||||
};
|
||||
|
||||
static void
|
||||
on_paint (ClutterActor *actor,
|
||||
on_after_paint (ClutterActor *actor,
|
||||
ClutterPaintContext *paint_context,
|
||||
TestState *state)
|
||||
{
|
||||
@ -152,7 +152,7 @@ main (int argc, char *argv[])
|
||||
/* We want continuous redrawing of the stage... */
|
||||
clutter_threads_add_idle (queue_redraw, stage);
|
||||
|
||||
g_signal_connect_after (stage, "paint", G_CALLBACK (on_paint), &state);
|
||||
g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), &state);
|
||||
|
||||
clutter_actor_show (stage);
|
||||
|
||||
|
@ -56,7 +56,7 @@ do_events (ClutterActor *stage)
|
||||
}
|
||||
|
||||
static void
|
||||
on_paint (ClutterActor *stage,
|
||||
on_after_paint (ClutterActor *stage,
|
||||
ClutterPaintContext *paint_context,
|
||||
gconstpointer *data)
|
||||
{
|
||||
@ -129,7 +129,7 @@ main (int argc, char **argv)
|
||||
|
||||
clutter_threads_add_idle (queue_redraw, stage);
|
||||
|
||||
g_signal_connect (stage, "paint", G_CALLBACK (on_paint), NULL);
|
||||
g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), NULL);
|
||||
|
||||
clutter_test_main ();
|
||||
|
||||
|
@ -13,7 +13,7 @@ static int n_chars;
|
||||
static int rows, cols;
|
||||
|
||||
static void
|
||||
on_paint (ClutterActor *actor,
|
||||
on_after_paint (ClutterActor *actor,
|
||||
ClutterPaintContext *paint_context,
|
||||
gconstpointer *data)
|
||||
{
|
||||
@ -135,7 +135,7 @@ main (int argc, char *argv[])
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Performance");
|
||||
|
||||
g_signal_connect (stage, "paint", G_CALLBACK (on_paint), NULL);
|
||||
g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), NULL);
|
||||
|
||||
label = create_label ();
|
||||
w = clutter_actor_get_width (label);
|
||||
|
@ -12,7 +12,7 @@
|
||||
#define ROWS 20
|
||||
|
||||
static void
|
||||
on_paint (ClutterActor *actor,
|
||||
on_after_paint (ClutterActor *actor,
|
||||
ClutterPaintContext *paint_context,
|
||||
gconstpointer *data)
|
||||
{
|
||||
@ -65,7 +65,7 @@ main (int argc, char *argv[])
|
||||
|
||||
clutter_threads_add_idle (queue_redraw, stage);
|
||||
|
||||
g_signal_connect (group, "paint", G_CALLBACK (on_paint), NULL);
|
||||
g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), NULL);
|
||||
|
||||
{
|
||||
gint row, col;
|
||||
|
@ -28,7 +28,7 @@ clutter_perf_fps_init (void)
|
||||
g_random_set_seed (12345678);
|
||||
}
|
||||
|
||||
static void perf_stage_paint_cb (ClutterStage *stage,
|
||||
static void perf_stage_after_paint_cb (ClutterStage *stage,
|
||||
ClutterPaintContext *paint_context,
|
||||
gpointer *data);
|
||||
static gboolean perf_fake_mouse_cb (gpointer stage);
|
||||
@ -36,7 +36,7 @@ static gboolean perf_fake_mouse_cb (gpointer stage);
|
||||
static inline void
|
||||
clutter_perf_fps_start (ClutterStage *stage)
|
||||
{
|
||||
g_signal_connect (stage, "paint", G_CALLBACK (perf_stage_paint_cb), NULL);
|
||||
g_signal_connect (stage, "after-paint", G_CALLBACK (perf_stage_after_paint_cb), NULL);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@ -53,7 +53,7 @@ clutter_perf_fps_report (const gchar *id)
|
||||
}
|
||||
|
||||
static void
|
||||
perf_stage_paint_cb (ClutterStage *stage,
|
||||
perf_stage_after_paint_cb (ClutterStage *stage,
|
||||
ClutterPaintContext *paint_context,
|
||||
gpointer *data)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user