Map::nudgeTransitions no longer depends on client information
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.
This commit is contained in:
@@ -256,6 +256,9 @@ void MapContext::update() {
|
||||
|
||||
if (!style) {
|
||||
updated = static_cast<UpdateType>(Update::Nothing);
|
||||
}
|
||||
|
||||
if (updated == static_cast<UpdateType>(Update::Nothing)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -315,12 +318,12 @@ void MapContext::renderStill(const TransformState& state, const FrameData& frame
|
||||
asyncUpdate->send();
|
||||
}
|
||||
|
||||
MapContext::RenderResult MapContext::renderSync(const TransformState& state, const FrameData& frame) {
|
||||
bool MapContext::renderSync(const TransformState& state, const FrameData& frame) {
|
||||
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
|
||||
|
||||
// Style was not loaded yet.
|
||||
if (!style) {
|
||||
return { false, false };
|
||||
return false;
|
||||
}
|
||||
|
||||
transformState = state;
|
||||
@@ -345,10 +348,11 @@ MapContext::RenderResult MapContext::renderSync(const TransformState& state, con
|
||||
|
||||
viewInvalidated = false;
|
||||
|
||||
return RenderResult {
|
||||
isLoaded(),
|
||||
style->hasTransitions() || painter->needsAnimation()
|
||||
};
|
||||
if (style->hasTransitions() || painter->needsAnimation()) {
|
||||
data.setNeedsRepaint(true);
|
||||
}
|
||||
|
||||
return isLoaded();
|
||||
}
|
||||
|
||||
bool MapContext::isLoaded() const {
|
||||
|
||||
Reference in New Issue
Block a user