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

Updates to Map::{renderSync,nudgeTransitions} #1979

Merged
merged 5 commits into from
Aug 5, 2015
Merged

Conversation

brunoabinader
Copy link
Member

Given the example in #1975 where a custom animation (not triggered by an input event) triggers a Map repaint, Map should be self-sufficient in terms of data to avoid triggering View invalidations in a burst.

Important changes:

  • Map::renderSync() no longer provides a return parameter.
  • Map::nudgeTransitions() no longer requires a forceRerender parameter.
  • MapContext::renderSync() should be ideally returning void, however for performance reasons we no w only return the value of MapContext::isLoaded() to avoid a second invokeSync() from Map to MapContext.
  • Removed Transform::needsTransition() - Transform::updateTransitions() already checks for the transition callback.
  • Moved StillImageCallback to its own header to avoid duplicated definitions in Map and MapContext headers.
  • Added Update::Repaint enum to notify MapContext that all we require is a style update, followed by a view invalidation.
  • Coalesce view invalidations in MapContext::invalidateView() to avoid flooding the client with redundant invalidation calls.
  • Updated public API changes in the ports code accordingly.

/cc @incanus @kkaefer @jfirebaugh @tmpsantos @tmcw

Fixes #1975.

@brunoabinader brunoabinader added iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage Android Mapbox Maps SDK for Android Linux macOS Mapbox Maps SDK for macOS and removed in progress labels Aug 3, 2015
@brunoabinader brunoabinader force-pushed the map-update-fix branch 3 times, most recently from 5532571 to 65eb337 Compare August 4, 2015 21:47
Transform::updateTransitions() already checks if there is a callback to
update transitions.
Do not call for view invalidation until painter has rendered a new
frame.
Clients no longer need to provide data (eg. if gesturing or in a custom
animation) to Map::nudgeTransitions().

Upon MapContext::renderSync(), a new atomic bool 'needsRepaint' in MapData
allows thread-safe communication between Map and MapContext.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants