You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Use Android Choreographer to smooth Map animations #2410
@jfirebaugh How does the current C++ animation system work? What would it take to plump the frame time stamp for the next frame that will be drawn (so basically what the state should be for the upcoming renderSync as we get from Android).
Using the frame time helps to reduce inter-frame jitter because the frame time is fixed at the time the frame was scheduled to start, regardless of when the animations or drawing callback actually runs. All callbacks that run as part of rendering a frame will observe the same frame time so using the frame time also helps to synchronize effects that are performed by different callbacks.
Transform would be easy to modify to use ^, basically don't set transitionStart until first call to updateTransitions. The updateTransitions would receive it's frame time from an optional parameter to renderSync
MapData might be a bit trickier. Perhaps set animationTime in renderSync instead of update?
@ljbade I believe most of this work on the iOS side was put down into the Core GL level as they originally tried using the rough iOS equivalent called CADisplayLink. Let's work with @1ec5@incanus@friedbunny to see what they've done on the iOS side already and then reuse that if possible.
I'm not sure I understand the actual problem that this would solve in our particular case. Animations in the map view are entirely self-contained and don't need to be synced with anything as the map view itself handles updating native views atop (long stable in iOS, just recently synced on Android in #2409).
@incanus The more I think about it, I think you are right that this wont fix the sync issues, which really requires GL side user dot and InfoViews (even if just render them to bitmap then pass to GL texture).
Activity
ljbade commentedon Sep 24, 2015
@jfirebaugh How does the current C++ animation system work? What would it take to plump the frame time stamp for the next frame that will be drawn (so basically what the state should be for the upcoming
renderSyncas we get from Android).ljbade commentedon Sep 24, 2015
Here is the reasoning from the Android docs:
ljbade commentedon Sep 24, 2015
Taking a look at the Android animation code, you do something like this:
postFrameCallbackpostFrameCallbackyou save that time stamp as the animation start timepostFrameCallbacktimesljbade commentedon Sep 24, 2015
Transformwould be easy to modify to use ^, basically don't settransitionStartuntil first call toupdateTransitions. TheupdateTransitionswould receive it's frame time from an optional parameter torenderSyncMapDatamight be a bit trickier. Perhaps setanimationTimeinrenderSyncinstead ofupdate?ljbade commentedon Sep 24, 2015
It would be interesting to see if iOS also provides a similar synced time source for driving animations.
bleege commentedon Sep 29, 2015
@ljbade I believe most of this work on the iOS side was put down into the Core GL level as they originally tried using the rough iOS equivalent called CADisplayLink. Let's work with @1ec5 @incanus @friedbunny to see what they've done on the iOS side already and then reuse that if possible.
incanus commentedon Oct 1, 2015
I'm not sure I understand the actual problem that this would solve in our particular case. Animations in the map view are entirely self-contained and don't need to be synced with anything as the map view itself handles updating native views atop (long stable in iOS, just recently synced on Android in #2409).
ljbade commentedon Oct 1, 2015
@incanus The more I think about it, I think you are right that this wont fix the sync issues, which really requires GL side user dot and InfoViews (even if just render them to bitmap then pass to GL texture).