diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-04-01 14:05:37 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-04-02 12:28:12 +0200 |
commit | 9331acf8e68e428e70c1f73ccb90147e71c586fd (patch) | |
tree | df0d36b3192e96f11817ca9caa490e7075a96eeb /src/mbgl/renderer/frame_history.cpp | |
parent | 440864063e916e92eed1b1fe15453e067cbf2781 (diff) | |
download | qtlocation-mapboxgl-9331acf8e68e428e70c1f73ccb90147e71c586fd.tar.gz |
Add typedefs for std::chrono::steady_clock types
Diffstat (limited to 'src/mbgl/renderer/frame_history.cpp')
-rw-r--r-- | src/mbgl/renderer/frame_history.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mbgl/renderer/frame_history.cpp b/src/mbgl/renderer/frame_history.cpp index 21925fa312..478520c510 100644 --- a/src/mbgl/renderer/frame_history.cpp +++ b/src/mbgl/renderer/frame_history.cpp @@ -3,11 +3,11 @@ using namespace mbgl; // Record frame history that will be used to calculate fading params -void FrameHistory::record(std::chrono::steady_clock::time_point now, float zoom) { +void FrameHistory::record(TimePoint now, float zoom) { // first frame ever if (!history.size()) { - history.emplace_back(FrameSnapshot{std::chrono::steady_clock::time_point::min(), zoom}); - history.emplace_back(FrameSnapshot{std::chrono::steady_clock::time_point::min(), zoom}); + history.emplace_back(FrameSnapshot{TimePoint::min(), zoom}); + history.emplace_back(FrameSnapshot{TimePoint::min(), zoom}); } if (history.size() > 0 || history.back().z != zoom) { @@ -15,7 +15,7 @@ void FrameHistory::record(std::chrono::steady_clock::time_point now, float zoom) } } -bool FrameHistory::needsAnimation(const std::chrono::steady_clock::duration duration) const { +bool FrameHistory::needsAnimation(const Duration duration) const { if (!history.size()) { return false; } @@ -47,9 +47,8 @@ bool FrameHistory::needsAnimation(const std::chrono::steady_clock::duration dura return false; } -FadeProperties FrameHistory::getFadeProperties(std::chrono::steady_clock::duration duration) -{ - const std::chrono::steady_clock::time_point currentTime = std::chrono::steady_clock::now(); +FadeProperties FrameHistory::getFadeProperties(Duration duration) { + const TimePoint currentTime = Clock::now(); // Remove frames until only one is outside the duration, or until there are only three while (history.size() > 3 && history[1].now + duration < currentTime) { |