- Do not carry it over everywhere as parameter, it is a shared instance anyway and the lifecycle is pretty much the app lifecycle from the moment we instantiate a map. - Rename to BackgroundScheduler because it is a Scheduler that will do tasks in the background, we don't make assumptions if it is a thread pool or a single thread. - Most importantly, remove the dependency from `core` on `platform`.
38 lines
975 B
C++
38 lines
975 B
C++
#pragma once
|
|
|
|
#include "qmapboxgl.hpp"
|
|
|
|
#include <mbgl/gfx/renderable.hpp>
|
|
#include <mbgl/gl/renderer_backend.hpp>
|
|
|
|
class QMapboxGLRendererBackend final : public mbgl::gl::RendererBackend,
|
|
public mbgl::gfx::Renderable {
|
|
public:
|
|
QMapboxGLRendererBackend(mbgl::gfx::ContextMode);
|
|
~QMapboxGLRendererBackend() override;
|
|
|
|
void updateFramebuffer(quint32 fbo, const mbgl::Size&);
|
|
void restoreFramebufferBinding();
|
|
|
|
// mbgl::gfx::RendererBackend implementation
|
|
public:
|
|
mbgl::gfx::Renderable& getDefaultRenderable() override {
|
|
return *this;
|
|
}
|
|
|
|
protected:
|
|
// No-op, implicit mode.
|
|
void activate() override {}
|
|
void deactivate() override {}
|
|
|
|
// mbgl::gl::RendererBackend implementation
|
|
protected:
|
|
mbgl::gl::ProcAddress getExtensionFunctionPointer(const char*) override;
|
|
void updateAssumedState() override;
|
|
|
|
private:
|
|
quint32 m_fbo = 0;
|
|
|
|
Q_DISABLE_COPY(QMapboxGLRendererBackend)
|
|
};
|