From 3790caafa3c98706c5cf0618c8aec592b2780bba Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 3 May 2017 10:13:01 -0700 Subject: [PATCH] [core] Factor timePoint initialization --- src/mbgl/map/map.cpp | 4 +++- src/mbgl/style/style.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 9964c5c9f3a..4bd370eff35 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -227,7 +227,9 @@ void Map::Impl::render(View& view) { return; } - TimePoint timePoint = Clock::now(); + TimePoint timePoint = mode == MapMode::Continuous + ? Clock::now() + : Clock::time_point::max(); auto flags = transform.updateTransitions(timePoint); diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index a3c7ce1ad16..7f21d81b0e4 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -360,7 +360,7 @@ void Style::cascade(const TimePoint& timePoint, MapMode mode) { const CascadeParameters parameters { classIDs, - mode == MapMode::Continuous ? timePoint : Clock::time_point::max(), + timePoint, mode == MapMode::Continuous ? transitionOptions : immediateTransition }; @@ -382,7 +382,7 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) { const PropertyEvaluationParameters parameters { z, - mode == MapMode::Continuous ? timePoint : Clock::time_point::max(), + timePoint, zoomHistory, mode == MapMode::Continuous ? util::DEFAULT_FADE_DURATION : Duration::zero() };