mirror of
https://github.com/brl/mutter.git
synced 2024-12-27 13:22:15 +00:00
Merge branch 'master' into 1.0-integration
* master: [test-text-perf] Use queue_redraw instead of painting the stage directly [actor] In paint when opacity == 0, clear the queued_redraw flag
This commit is contained in:
commit
9557328e4e
@ -2256,7 +2256,10 @@ clutter_actor_paint (ClutterActor *self)
|
||||
* actors with 0 opacity to be a NOP... */
|
||||
if (G_LIKELY (context->pick_mode == CLUTTER_PICK_NONE) &&
|
||||
priv->opacity == 0)
|
||||
return;
|
||||
{
|
||||
priv->queued_redraw = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
/* if we aren't paintable (not in a toplevel with all
|
||||
* parents paintable) then do nothing.
|
||||
|
@ -10,10 +10,9 @@ static int font_size;
|
||||
static int n_chars;
|
||||
static int rows, cols;
|
||||
|
||||
gboolean idle (gpointer data)
|
||||
static void
|
||||
on_paint (ClutterActor *actor, gconstpointer *data)
|
||||
{
|
||||
ClutterActor *stage = CLUTTER_ACTOR (data);
|
||||
|
||||
static GTimer *timer = NULL;
|
||||
static int fps = 0;
|
||||
|
||||
@ -33,8 +32,13 @@ gboolean idle (gpointer data)
|
||||
fps = 0;
|
||||
}
|
||||
|
||||
clutter_actor_paint (stage);
|
||||
++fps;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
queue_redraw (gpointer stage)
|
||||
{
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -91,6 +95,8 @@ main (int argc, char *argv[])
|
||||
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
|
||||
g_signal_connect (stage, "paint", G_CALLBACK (on_paint), NULL);
|
||||
|
||||
label = create_label ();
|
||||
w = clutter_actor_get_width (label);
|
||||
h = clutter_actor_get_height (label);
|
||||
@ -114,7 +120,7 @@ main (int argc, char *argv[])
|
||||
|
||||
clutter_actor_show_all (stage);
|
||||
|
||||
g_idle_add (idle, (gpointer) stage);
|
||||
g_idle_add (queue_redraw, stage);
|
||||
|
||||
clutter_main ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user