From 3b075b6dc4197ed78f6386ee7e9a6e307839590f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 9 Dec 2009 01:46:52 +0000 Subject: [PATCH] tests: Allow setting the stage opacity in test-paint-wrapper This allows testing the Stage:use-alpha property and the blending done by a compositor. --- tests/interactive/test-paint-wrapper.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/interactive/test-paint-wrapper.c b/tests/interactive/test-paint-wrapper.c index 7b14cef42..46e01daa0 100644 --- a/tests/interactive/test-paint-wrapper.c +++ b/tests/interactive/test-paint-wrapper.c @@ -31,6 +31,7 @@ typedef struct SuperOH } SuperOH; static gint n_hands = NHANDS; +static gint use_alpha = 255; static GOptionEntry super_oh_entries[] = { { @@ -39,6 +40,12 @@ static GOptionEntry super_oh_entries[] = { G_OPTION_ARG_INT, &n_hands, "Number of hands", "HANDS" }, + { + "use-alpha", 'a', + 0, + G_OPTION_ARG_INT, &use_alpha, + "Stage opacity", "VALUE" + }, { NULL } }; @@ -205,6 +212,14 @@ test_paint_wrapper_main (int argc, char *argv[]) stage = clutter_stage_get_default (); clutter_actor_set_size (stage, 800, 600); + if (use_alpha != 255) + { + g_object_set (G_OBJECT (stage), + "use-alpha", TRUE, + "opacity", use_alpha, + NULL); + } + clutter_stage_set_title (CLUTTER_STAGE (stage), "Paint Test"); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);