| 1 | #pragma once |
| 2 | |
| 3 | #include <memory> |
| 4 | |
| 5 | namespace mbgl { |
| 6 | |
| 7 | class RendererObserver; |
| 8 | class UpdateParameters; |
| 9 | |
| 10 | // The RenderFrontend is the bridge between the Map and |
| 11 | // platform used to update and observer the Renderer |
| 12 | // |
| 13 | // It hides any threading specifics and always replies on |
| 14 | // the original thread. |
| 15 | class RendererFrontend { |
| 16 | public: |
| 17 | |
| 18 | virtual ~RendererFrontend() = default; |
| 19 | |
| 20 | // Must synchronously clean up the Renderer if set |
| 21 | virtual void reset() = 0; |
| 22 | |
| 23 | // Implementer must bind the renderer observer to the renderer in a |
| 24 | // appropriate manner so that the callbacks occur on the main thread |
| 25 | virtual void setObserver(RendererObserver&) = 0; |
| 26 | |
| 27 | // Coalescing updates is up to the implementer |
| 28 | virtual void update(std::shared_ptr<UpdateParameters>) = 0; |
| 29 | }; |
| 30 | |
| 31 | } // namespace mbgl |
| 32 | |