2008-06-06 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-texture.c:
	(clutter_texture_class_init): Do not unrealize on hide(), and
	do not realize() on show. By default, clutter_actor_show() will
	realize ourselves, and we don't want to unrealize when hidden
	to avoid paying the penalty of reading back the texture data
	from the video memory.

	* tests/test-actors.c: Show all textures again when pressing
	the 'r' key.
This commit is contained in:
Emmanuele Bassi 2008-06-06 16:22:55 +00:00
parent d66fe947a0
commit eb990a853a
3 changed files with 27 additions and 32 deletions

View File

@ -1,3 +1,15 @@
2008-06-06 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-texture.c:
(clutter_texture_class_init): Do not unrealize on hide(), and
do not realize() on show. By default, clutter_actor_show() will
realize ourselves, and we don't want to unrealize when hidden
to avoid paying the penalty of reading back the texture data
from the video memory.
* tests/test-actors.c: Show all textures again when pressing
the 'r' key.
2008-06-06 Neil Roberts <neil@o-hand.com>
* tests/test-shader.c: Use the special wrapper vars when building

View File

@ -270,32 +270,6 @@ clutter_texture_realize (ClutterActor *actor)
CLUTTER_NOTE (TEXTURE, "Texture realized");
}
static void
clutter_texture_show (ClutterActor *self)
{
ClutterActorClass *parent_class;
/* chain up parent show */
parent_class = CLUTTER_ACTOR_CLASS (clutter_texture_parent_class);
if (parent_class->show)
parent_class->show (self);
clutter_actor_realize (self);
}
static void
clutter_texture_hide (ClutterActor *self)
{
ClutterActorClass *parent_class;
/* chain up parent hide */
parent_class = CLUTTER_ACTOR_CLASS (clutter_texture_parent_class);
if (parent_class->hide)
parent_class->hide (self);
clutter_actor_unrealize (self);
}
static void
clutter_texture_paint (ClutterActor *self)
{
@ -535,8 +509,6 @@ clutter_texture_class_init (ClutterTextureClass *klass)
actor_class->paint = clutter_texture_paint;
actor_class->realize = clutter_texture_realize;
actor_class->unrealize = clutter_texture_unrealize;
actor_class->show = clutter_texture_show;
actor_class->hide = clutter_texture_hide;
actor_class->request_coords = clutter_texture_request_coords;
gobject_class->dispose = clutter_texture_dispose;

View File

@ -40,10 +40,12 @@ get_radius (void)
/* input handler */
static gboolean
input_cb (ClutterStage *stage,
input_cb (ClutterActor *stage,
ClutterEvent *event,
gpointer data)
{
SuperOH *oh = data;
if (event->type == CLUTTER_BUTTON_PRESS)
{
ClutterButtonEvent *button_event;
@ -56,7 +58,7 @@ input_cb (ClutterStage *stage,
g_print ("*** button press event (button:%d) ***\n",
button_event->button);
e = clutter_stage_get_actor_at_pos (stage, x, y);
e = clutter_stage_get_actor_at_pos (CLUTTER_STAGE (stage), x, y);
if (e && (CLUTTER_IS_TEXTURE (e) || CLUTTER_IS_CLONE_TEXTURE (e)))
{
@ -76,6 +78,15 @@ input_cb (ClutterStage *stage,
clutter_main_quit ();
return TRUE;
}
else if (clutter_key_event_symbol (kev) == CLUTTER_r)
{
gint i;
for (i = 0; i < n_hands; i++)
clutter_actor_show (oh->hand[i]);
return TRUE;
}
}
return FALSE;
@ -88,8 +99,8 @@ frame_cb (ClutterTimeline *timeline,
gint frame_num,
gpointer data)
{
SuperOH *oh = (SuperOH *)data;
gint i;
SuperOH *oh = data;
gint i;
/* Rotate everything clockwise about stage center*/