blob: b2141e95402aa2e9c82d82c2d7647a38e63f9cce (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#pragma once
#include <mbgl/gfx/renderable.hpp>
#include <mbgl/gl/renderer_backend.hpp>
#include <memory>
#include <functional>
namespace mbgl {
namespace gl {
class HeadlessBackend final : public gl::RendererBackend, public gfx::Renderable {
public:
HeadlessBackend(Size = { 256, 256 }, gfx::ContextMode = gfx::ContextMode::Unique);
~HeadlessBackend() override;
gfx::Renderable& getDefaultRenderable() override;
Size getFramebufferSize() const;
void updateAssumedState() override;
void setSize(Size);
PremultipliedImage readStillImage();
class Impl {
public:
virtual ~Impl() = default;
virtual gl::ProcAddress getExtensionFunctionPointer(const char*) = 0;
virtual void activateContext() = 0;
virtual void deactivateContext() {}
};
private:
// Implementation specific functions
gl::ProcAddress getExtensionFunctionPointer(const char*) override;
void activate() override;
void deactivate() override;
void createImpl();
private:
std::unique_ptr<Impl> impl;
float pixelRatio;
bool active = false;
};
} // namespace gl
} // namespace mbgl
|