diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2018-01-24 22:25:29 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2018-02-09 20:28:54 +0200 |
commit | fb65d258314cef797afacad9359f8ce1ae461a94 (patch) | |
tree | d989eedf5d8b8b95744831a2bbec58539e937551 /include/mbgl/renderer | |
parent | c3bf7c55a1f648e57c3853d555ff5f63c989f8c4 (diff) | |
download | qtlocation-mapboxgl-fb65d258314cef797afacad9359f8ce1ae461a94.tar.gz |
[core] Make RendererObserver a public interface
Needed by backends implementing asyncronous rendering
Diffstat (limited to 'include/mbgl/renderer')
-rw-r--r-- | include/mbgl/renderer/renderer_observer.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/mbgl/renderer/renderer_observer.hpp b/include/mbgl/renderer/renderer_observer.hpp new file mode 100644 index 0000000000..551b5c803e --- /dev/null +++ b/include/mbgl/renderer/renderer_observer.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include <exception> + +namespace mbgl { + +class RendererObserver { +public: + virtual ~RendererObserver() = default; + + enum class RenderMode : uint32_t { + Partial, + Full + }; + + // Signals that a repaint is required + virtual void onInvalidate() {} + + // Resource failed to download / parse + virtual void onResourceError(std::exception_ptr) {} + + // First frame + virtual void onWillStartRenderingMap() {} + + // Start of frame, initial is the first frame for this map + virtual void onWillStartRenderingFrame() {} + + // End of frame, boolean flags that a repaint is required + virtual void onDidFinishRenderingFrame(RenderMode, bool) {} + + // Final frame + virtual void onDidFinishRenderingMap() {} +}; + +} // namespace mbgl |