Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Only run Style::updateProperties when required - #1155

Merged
jfirebaugh merged 3 commits into
masterfrom
1155-update-as-needed
Apr 2, 2015
Merged

jfirebaugh merged 3 commits into
masterfrom
1155-update-as-needed

Conversation

@kkaefer

@kkaefer kkaefer commented Apr 2, 2015

Copy link
Copy Markdown
Member

We're currently running Style::updateProperties too often; whenever anything about the transform changes. However, we only need to run it on zoom, or when adding/removing classes.

@incanus incanus added the performance Speed, stability, CPU usage, memory usage, or power usage label Mar 30, 2015
@jfirebaugh jfirebaugh self-assigned this Apr 1, 2015
@jfirebaugh jfirebaugh mentioned this pull request Apr 1, 2015
jfirebaugh added a commit that referenced this pull request Apr 2, 2015
This brings the easing transition code a bit closer to how easings work
in gl-js. Instead of having an array of individual transitions for scale,
rotate, and pan, there is a single transition function that does all the
required calculations. This permits us to:

* Eliminate the "timeout" transition. (Fixes #126)
* Remove the start/stopPanning() and similar functions from the API. The
  transform is capable of determining when a transition that affects the
  pan position is in effect. (Fixes #79)
* Run style recalculations only when an ease transition that affects the
  zoom is in progress. (Fixes #1155)
@kkaefer

kkaefer commented Apr 2, 2015

Copy link
Copy Markdown
Member Author

From #1176:

This brings the easing transition code a bit closer to how easings work in gl-js. Instead of having an array of individual transitions for scale, rotate, and pan, there is a single transition function that does all the required calculations. This permits us to:

@kkaefer

kkaefer commented Apr 2, 2015

Copy link
Copy Markdown
Member Author

This branch also removes the startScaling/Panning/Rotating and the corresponding stop functions. These are used to enable/disable texture interpolation:

Previous code:

Note how the icon doesn't jump between pixels but rather moves gradually at the expense of sharpness.

@kkaefer

kkaefer commented Apr 2, 2015

Copy link
Copy Markdown
Member Author

(Android is still calling startPanning et al, so the test fails.)

@jfirebaugh

Copy link
Copy Markdown
Contributor

@kkaefer Do you want to keep startPanning et al? I think we should at least reduce them to one start/stopInteraction method pair and require calls to always be paired (no timeout mechanism).

@kkaefer

kkaefer commented Apr 2, 2015

Copy link
Copy Markdown
Member Author

I think we should keep it. Combining them to one call is fine, but we'd need to still track them individually in the view code.

This brings the easing transition code a bit closer to how easings work
in gl-js. Instead of having an array of individual transitions for scale,
rotate, and pan, there is a single transition function that does all the
required calculations. This permits us to:

* Eliminate the "timeout" transition. (Fixes #126)
* Replace start/stopPanning() et al with setGestureInProgress(). Apps or
  SDKs are expected to make paired calls to setGestureInProgress(). This
  state will be ORed with the active easing state to determine when to
  use texture interpolation. (Fixes #79)
* Run style recalculations only when an ease transition that affects the
  zoom is in progress. (Fixes #1155)
@jfirebaugh
jfirebaugh force-pushed the 1155-update-as-needed branch from d7a161d to 12c07b9 Compare April 2, 2015 23:12
@jfirebaugh

Copy link
Copy Markdown
Contributor

Replaced startPanning et al with setGestureInProgress(bool) and updated GLFW and iOS views to use it. Android has never used startPanning et al so I simply removed the bindings. I'll ticket a separate issue to add bindings and use setGestureInProgress(bool) on Android.

jfirebaugh added a commit that referenced this pull request Apr 2, 2015
Only run Style::updateProperties when required
@jfirebaugh
jfirebaugh merged commit 3bd180d into master Apr 2, 2015
@jfirebaugh
jfirebaugh deleted the 1155-update-as-needed branch April 2, 2015 23:38
@incanus

incanus commented Apr 3, 2015

Copy link
Copy Markdown
Contributor

We should also grab handleQuickZoomGesture() since this is a zooming gesture like the pinch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

performance Speed, stability, CPU usage, memory usage, or power usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants