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.
This commit is contained in:
parent
3a3c815286
commit
3b075b6dc4
@ -31,6 +31,7 @@ typedef struct SuperOH
|
|||||||
} SuperOH;
|
} SuperOH;
|
||||||
|
|
||||||
static gint n_hands = NHANDS;
|
static gint n_hands = NHANDS;
|
||||||
|
static gint use_alpha = 255;
|
||||||
|
|
||||||
static GOptionEntry super_oh_entries[] = {
|
static GOptionEntry super_oh_entries[] = {
|
||||||
{
|
{
|
||||||
@ -39,6 +40,12 @@ static GOptionEntry super_oh_entries[] = {
|
|||||||
G_OPTION_ARG_INT, &n_hands,
|
G_OPTION_ARG_INT, &n_hands,
|
||||||
"Number of hands", "HANDS"
|
"Number of hands", "HANDS"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"use-alpha", 'a',
|
||||||
|
0,
|
||||||
|
G_OPTION_ARG_INT, &use_alpha,
|
||||||
|
"Stage opacity", "VALUE"
|
||||||
|
},
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -205,6 +212,14 @@ test_paint_wrapper_main (int argc, char *argv[])
|
|||||||
stage = clutter_stage_get_default ();
|
stage = clutter_stage_get_default ();
|
||||||
clutter_actor_set_size (stage, 800, 600);
|
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_title (CLUTTER_STAGE (stage), "Paint Test");
|
||||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user