diff options
Diffstat (limited to 'include/mbgl/renderer/frame_history.hpp')
-rw-r--r-- | include/mbgl/renderer/frame_history.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/mbgl/renderer/frame_history.hpp b/include/mbgl/renderer/frame_history.hpp new file mode 100644 index 0000000000..a5dbe21bca --- /dev/null +++ b/include/mbgl/renderer/frame_history.hpp @@ -0,0 +1,32 @@ +#ifndef MBGL_RENDERER_FRAME_HISTORY +#define MBGL_RENDERER_FRAME_HISTORY + +#include <deque> +#include <cassert> +#include <cmath> + +#include <mbgl/platform/platform.hpp> +#include <mbgl/util/time.hpp> + +namespace mbgl { + +struct FrameSnapshot { + explicit inline FrameSnapshot(timestamp t, float z) : t(t), z(z) {} + float t; + float z; +}; + +class FrameHistory { +public: + // Record frame history that will be used to calculate fading params + void record(timestamp now, float zoom); + + bool needsAnimation(timestamp duration) const; + +public: + std::deque<FrameSnapshot> history; +}; + +} + +#endif |