summaryrefslogtreecommitdiff
path: root/include/mbgl/renderer/renderer_frontend.hpp
blob: 2eac1a55c32ed58815e55c60ab3a0dab8f334099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include <memory>

namespace mbgl {

class RendererObserver;
struct UpdateParameters;

// The RenderFrontend is the bridge between the Map and
// platform used to update and observer the Renderer
//
// It hides any threading specifics and always replies on
// the original thread.
class RendererFrontend {
public:

    virtual ~RendererFrontend() = default;

    // Must synchronously clean up the Renderer if set
    virtual void reset() = 0;

    // Implementer must bind the renderer observer to the renderer in a
    // appropriate manner so that the callbacks occur on the main thread
    virtual void setObserver(RendererObserver&) = 0;

    // Coalescing updates is up to the implementer
    virtual void update(std::shared_ptr<UpdateParameters>) = 0;
};

} // namespace mbgl