diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-11-30 19:55:01 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-12-05 16:39:59 -0800 |
commit | 96e942dabeeaaa9ab6df3a870668c6fe53d930da (patch) | |
tree | c2bee431f14b90422586d0dc1e7d77256474fadb /tools/layoutlib/bridge | |
parent | 0a0a1248cfc03940174cbd9af677bafd7280a3bc (diff) | |
download | frameworks_base-96e942dabeeaaa9ab6df3a870668c6fe53d930da.zip frameworks_base-96e942dabeeaaa9ab6df3a870668c6fe53d930da.tar.gz frameworks_base-96e942dabeeaaa9ab6df3a870668c6fe53d930da.tar.bz2 |
Use a Choreographer to schedule animation and drawing.
Both animations and drawing need to march to the beat of
the same drum, but the animation system doesn't know
abgout the view system and vice-versa so neither one
can drive the other.
We introduce the Choreographer as a drummer to keep
everyone in time and ensure a magnificent performance.
This patch enabled VSync based animations and drawing by
default. Two system properties are provided for testing
purposes to control the behavior.
"debug.choreographer.vsync": Enables vsync based animation
timing. Defaults to true. When false, animations are
timed by posting delayed messages to a message queue in
the same way they used to be before this patch.
"debug.choreographer.animdraw": Enables the use of the animation
timer to drive drawing such that drawing is synchronized with
animations (in other words, with vsync or the timing loop).
Defaults to true. When false, layout traversals and drawing
are posted to the message queue for execution without any delay or
synchronization in the same way they used to be before this patch.
Stubbed out part of the layoutlib animation code because it
depends on the old timing loop (opened bug 5712395)
Change-Id: I186d9518648e89bc3e809e393e9a9148bbbecc4d
Diffstat (limited to 'tools/layoutlib/bridge')
-rw-r--r-- | tools/layoutlib/bridge/src/android/animation/AnimationThread.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/layoutlib/bridge/src/android/animation/AnimationThread.java b/tools/layoutlib/bridge/src/android/animation/AnimationThread.java index 2b5e4fa..af83c61 100644 --- a/tools/layoutlib/bridge/src/android/animation/AnimationThread.java +++ b/tools/layoutlib/bridge/src/android/animation/AnimationThread.java @@ -86,8 +86,11 @@ public abstract class AnimationThread extends Thread { try { Handler_Delegate.setCallback(new IHandlerCallback() { public void sendMessageAtTime(Handler handler, Message msg, long uptimeMillis) { - if (msg.what == ValueAnimator.ANIMATION_START || - msg.what == ValueAnimator.ANIMATION_FRAME) { + if (msg.what == ValueAnimator.ANIMATION_START /*|| + FIXME: The ANIMATION_FRAME message no longer exists. Instead, + the animation timing loop is based on a Choreographer object + that schedules animation and drawing frames. + msg.what == ValueAnimator.ANIMATION_FRAME*/) { mQueue.add(new MessageBundle(handler, msg, uptimeMillis)); } else { // just ignore. |