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:
Emmanuele Bassi 2009-05-28 15:53:56 +01:00
commit 9557328e4e
2 changed files with 15 additions and 6 deletions

View File

@ -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.

View File

@ -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 ();