[build] move headless rendering files to platform/default
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/gl/extension.hpp>
|
||||
|
||||
#include <mbgl/map/backend.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class HeadlessDisplay;
|
||||
|
||||
class HeadlessBackend : public Backend {
|
||||
public:
|
||||
HeadlessBackend();
|
||||
HeadlessBackend(std::shared_ptr<HeadlessDisplay>);
|
||||
~HeadlessBackend() override;
|
||||
|
||||
void invalidate() override;
|
||||
void activate() override;
|
||||
void deactivate() override;
|
||||
void notifyMapChange(MapChange) override;
|
||||
|
||||
void setMapChangeCallback(std::function<void(MapChange)>&& cb) { mapChangeCallback = std::move(cb); }
|
||||
|
||||
struct Impl {
|
||||
virtual ~Impl() {}
|
||||
virtual void activateContext() = 0;
|
||||
virtual void deactivateContext() {}
|
||||
};
|
||||
|
||||
private:
|
||||
// Implementation specific functions
|
||||
static gl::glProc initializeExtension(const char*);
|
||||
|
||||
bool hasContext() const { return bool(impl); }
|
||||
bool hasDisplay();
|
||||
|
||||
void createContext();
|
||||
|
||||
private:
|
||||
void destroyContext();
|
||||
|
||||
void activateContext();
|
||||
void deactivateContext();
|
||||
|
||||
std::unique_ptr<Impl> impl;
|
||||
std::shared_ptr<HeadlessDisplay> display;
|
||||
|
||||
bool extensionsLoaded = false;
|
||||
bool active = false;
|
||||
|
||||
std::function<void(MapChange)> mapChangeCallback;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
@@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class HeadlessDisplay {
|
||||
public:
|
||||
HeadlessDisplay();
|
||||
~HeadlessDisplay();
|
||||
|
||||
template <typename DisplayAttribute>
|
||||
DisplayAttribute attribute() const;
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
std::unique_ptr<Impl> impl;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
@@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/map/view.hpp>
|
||||
#include <mbgl/gl/framebuffer.hpp>
|
||||
#include <mbgl/gl/renderbuffer.hpp>
|
||||
#include <mbgl/util/optional.hpp>
|
||||
#include <mbgl/util/image.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
namespace gl {
|
||||
class Context;
|
||||
} // namespace gl
|
||||
|
||||
class OffscreenView : public View {
|
||||
public:
|
||||
OffscreenView(gl::Context&, Size size = { 256, 256 });
|
||||
|
||||
void bind() override;
|
||||
|
||||
PremultipliedImage readStillImage();
|
||||
|
||||
public:
|
||||
const Size size;
|
||||
|
||||
private:
|
||||
gl::Context& context;
|
||||
optional<gl::Framebuffer> framebuffer;
|
||||
optional<gl::Renderbuffer<gl::RenderbufferType::RGBA>> color;
|
||||
optional<gl::Renderbuffer<gl::RenderbufferType::DepthStencil>> depthStencil;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user