Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the lag between layers. #644

Merged
merged 2 commits into from
Nov 21, 2016
Merged

Remove the lag between layers. #644

merged 2 commits into from
Nov 21, 2016

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Nov 9, 2016

Pedantically, this wasn't a lag, but rather missed frames.

A variety of actions can trigger rerendering. We want to perform animations before other updates. To ensure that renderings are well ordered and not called too often, we were removing an animation frame request and then creating a new one to ensure that the callback happened at the end of the animation frame cycle. However, sometimes this would defer the animation frame callback until a later cycle rather than just at the end of the next cycle.

By using a single animation queue, we ensure that get all of the callbacks we want in the animation cycle. This has the fringe benefit that it has less overhead in Chrome. Furthermore, by using a shared array for the animation queue, two map instances can be synchronized, whereas, before, there was likely to be a lag between them.

A few other minor optimizations have been made: vgl textures are built in the _build step not in the animation frame. The vgl camera is only updated just as needed, so if two pan events happen in a single frame, only one update will occur.

Resolves issue #526.

Pedantically, this wasn't a lag, but rather missed frames.

A variety of actions can trigger rerendering.  We want to perform animations before other updates.  To ensure that renderings are well ordered and not called too often, we were removing an animation frame request and then creating a new one to ensure that the callback happened at the end of the animation frame cycle.  However, sometimes this would defer the animation frame callback until a later cycle rather than just at the end of the next cycle.

By using a single animation queue, we ensure that get all of the callbacks we want in the animation cycle.  This has the fringe benefit that it has less overhead in Chrome.  Furthermore, by using a shared array for the animation queue, two map instances can be synchronized, whereas, before, there was likely to be a lag between them.

A few other minor optimizations have been made: vgl textures are built in the _build step not in the animation frame.  The vgl camera is only updated just as needed, so if two pan events happen in a single frame, only one update will occur.
@codecov-io
Copy link

codecov-io commented Nov 9, 2016

Current coverage is 86.90% (diff: 94.11%)

Merging #644 into master will decrease coverage by <.01%

@@             master       #644   diff @@
==========================================
  Files            87         87          
  Lines          8571       8585    +14   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           7449       7461    +12   
- Misses         1122       1124     +2   
  Partials          0          0          

Powered by Codecov. Last update 73e8285...739e2ab

@aashish24
Copy link
Member

looks reasonable to me; I thought we merged this already but I didn't +1 it.

@manthey manthey merged commit b85183d into master Nov 21, 2016
@manthey manthey deleted the layer-lag branch November 21, 2016 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants