test-pixmap: Add a --disable-animation option
authorNeil Roberts <neil@linux.intel.com>
Fri, 28 May 2010 16:53:04 +0000 (17:53 +0100)
committerNeil Roberts <neil@linux.intel.com>
Tue, 22 Jun 2010 11:22:48 +0000 (12:22 +0100)
Sometimes the animation makes debugging awkward so this patch adds a
--disable-animation option to simplify the test.

tests/interactive/test-pixmap.c

index 2e49fbd..193d3e9 100644 (file)
@@ -23,6 +23,7 @@
 
 static gboolean disable_x11 = FALSE;
 static gboolean disable_glx = FALSE;
+static gboolean disable_animation = FALSE;
 
 static GOptionEntry g_options[] =
 {
@@ -38,6 +39,12 @@ static GOptionEntry g_options[] =
     &disable_glx,
     "Disable redirection through GLX pixmap",
     NULL },
+  { "disable-animation",
+    0, 0,
+    G_OPTION_ARG_NONE,
+    &disable_animation,
+    "Disable the animations",
+    NULL },
 
   { NULL }
 };
@@ -256,7 +263,8 @@ test_pixmap_main (int argc, char **argv)
       clutter_texture_set_filter_quality (CLUTTER_TEXTURE (tex),
                                           CLUTTER_TEXTURE_QUALITY_HIGH);
       clutter_actor_set_position (group, 0, 0);
-      clutter_behaviour_apply (depth_behavior, group);
+      if (!disable_animation)
+        clutter_behaviour_apply (depth_behavior, group);
     }
 
 #ifdef HAVE_CLUTTER_GLX
@@ -279,7 +287,8 @@ test_pixmap_main (int argc, char **argv)
                                  clutter_actor_get_width (stage)
                                  - clutter_actor_get_width (tex),
                                  0);
-      clutter_behaviour_apply (depth_behavior, group);
+      if (!disable_animation)
+        clutter_behaviour_apply (depth_behavior, group);
 
       if (!clutter_glx_texture_pixmap_using_extension (
                                      CLUTTER_GLX_TEXTURE_PIXMAP (tex)))
@@ -316,7 +325,8 @@ test_pixmap_main (int argc, char **argv)
   /* oddly, the actor's size is 0 until it is realized, even though
      pixmap-height is set */
   clutter_actor_set_position (group, 0, row_height);
-  clutter_behaviour_apply (depth_behavior, group);
+  if (!disable_animation)
+    clutter_behaviour_apply (depth_behavior, group);
 
 
   g_signal_connect (stage, "key-release-event",
@@ -326,7 +336,8 @@ test_pixmap_main (int argc, char **argv)
 
   clutter_actor_show (stage);
 
-  clutter_timeline_start (timeline);
+  if (!disable_animation)
+    clutter_timeline_start (timeline);
 
   clutter_main ();
 # endif /* USE_GDKPIXBUF */