diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-03 09:50:06 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-03 10:41:04 -0700 |
commit | 88093bd708dccb1082bb624a6c27e5aa7688b77a (patch) | |
tree | a013645bb176d9f7d9008aa219c7e2b950af2836 /src/mbgl/style/style.cpp | |
parent | d5f4d0f05fcb8490984649d78d6c026f87a77f4e (diff) | |
download | qtlocation-mapboxgl-88093bd708dccb1082bb624a6c27e5aa7688b77a.tar.gz |
[core] Calculate hasPendingTransitions functionally rather than statefully
Diffstat (limited to 'src/mbgl/style/style.cpp')
-rw-r--r-- | src/mbgl/style/style.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 23536e0e3e..a3c7ce1ad1 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -387,9 +387,8 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) { mode == MapMode::Continuous ? util::DEFAULT_FADE_DURATION : Duration::zero() }; - hasPendingTransitions = transitioningLight.hasTransition(); for (const auto& layer : renderLayers) { - hasPendingTransitions |= layer->evaluate(parameters); + layer->evaluate(parameters); if (layer->needsRendering(zoomHistory.lastZoom)) { if (RenderSource* renderSource = getRenderSource(layer->baseImpl.source)) { @@ -443,7 +442,17 @@ RenderSource* Style::getRenderSource(const std::string& id) const { } bool Style::hasTransitions() const { - return hasPendingTransitions; + if (transitioningLight.hasTransition()) { + return true; + } + + for (const auto& layer : renderLayers) { + if (layer->hasTransition()) { + return true; + } + } + + return false; } bool Style::isLoaded() const { |