]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
animation,throbber: go back to frame dropping
authorRay Strode <rstrode@redhat.com>
Tue, 12 Mar 2013 15:57:15 +0000 (11:57 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 12 Mar 2013 16:01:21 +0000 (12:01 -0400)
Right now we figure out which animation frame to use
based on a static counter variable.  Since it's static
instead of per-object, if there are multiple instances
it ends up counting up too fast.

We could:
1) make it per-object state
2) drop it and use the ifdef'd out alternative implementation
that potentially drops frames if the machine is sluggish

This commit chooses 2, but we may end up going to one if the
frame dropping turns out to be problematic.

Based on deductive work from Kevin Murphy.

src/libply-splash-graphics/ply-animation.c
src/libply-splash-graphics/ply-throbber.c

index ed558cfee1892b73b284a1c8ae0418676ec02482..bba8490e1b190e6eda8157f5c5d1ff5d25ae820c 100644 (file)
@@ -182,14 +182,8 @@ on_timeout (ply_animation_t *animation)
   animation->previous_time = animation->now;
   animation->now = ply_get_timestamp ();
 
-#ifdef REAL_TIME_ANIMATION
   should_continue = animate_at_time (animation,
                                      animation->now - animation->start_time);
-#else
-  static double time = 0.0;
-  time += 1.0 / FRAMES_PER_SECOND;
-  should_continue = animate_at_time (animation, time);
-#endif
 
   sleep_time = 1.0 / FRAMES_PER_SECOND;
   sleep_time = MAX (sleep_time - (ply_get_timestamp () - animation->now),
index 59cf10c6ce5f826d4d2aa25915e0212e4233a3e2..42044bafdebb372fc3f2a4eaced7b7f362f62c9b 100644 (file)
@@ -178,14 +178,8 @@ on_timeout (ply_throbber_t *throbber)
   bool should_continue;
   throbber->now = ply_get_timestamp ();
 
-#ifdef REAL_TIME_ANIMATION
   should_continue = animate_at_time (throbber,
-                                 throbber->now - throbber->start_time);
-#else
-  static double time = 0.0;
-  time += 1.0 / FRAMES_PER_SECOND;
-  should_continue = animate_at_time (throbber, time);
-#endif
+                                     throbber->now - throbber->start_time);
 
   sleep_time = 1.0 / FRAMES_PER_SECOND;
   sleep_time = MAX (sleep_time - (ply_get_timestamp () - throbber->now),