From eb990a853aa5f29dab761fa6c07f417ecf61db88 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 6 Jun 2008 16:22:55 +0000 Subject: [PATCH] 2008-06-06 Emmanuele Bassi * 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. --- ChangeLog | 12 ++++++++++++ clutter/clutter-texture.c | 28 ---------------------------- tests/test-actors.c | 19 +++++++++++++++---- 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index fef61d7..45e7081 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-06-06 Emmanuele Bassi + + * 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 * tests/test-shader.c: Use the special wrapper vars when building diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index 637d8c2..7c3fc35 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -271,32 +271,6 @@ clutter_texture_realize (ClutterActor *actor) } 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) { ClutterTexture *texture = CLUTTER_TEXTURE (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; diff --git a/tests/test-actors.c b/tests/test-actors.c index 45cc92f..d8d794c 100644 --- a/tests/test-actors.c +++ b/tests/test-actors.c @@ -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*/ -- 2.7.4