diff options
Diffstat (limited to 'platform/default')
-rw-r--r-- | platform/default/mbgl/gl/headless_backend.cpp | 4 | ||||
-rw-r--r-- | platform/default/mbgl/gl/headless_backend.hpp | 2 | ||||
-rw-r--r-- | platform/default/mbgl/gl/headless_frontend.cpp | 30 | ||||
-rw-r--r-- | platform/default/mbgl/gl/headless_frontend.hpp | 4 |
4 files changed, 24 insertions, 16 deletions
diff --git a/platform/default/mbgl/gl/headless_backend.cpp b/platform/default/mbgl/gl/headless_backend.cpp index ba08aecab7..f785865667 100644 --- a/platform/default/mbgl/gl/headless_backend.cpp +++ b/platform/default/mbgl/gl/headless_backend.cpp @@ -21,8 +21,8 @@ public: gl::Framebuffer framebuffer; }; -HeadlessBackend::HeadlessBackend(Size size_) - : size(size_) { +HeadlessBackend::HeadlessBackend(Size size_, GLContextMode mode_) + : RendererBackend(mode_), size(size_) { } HeadlessBackend::~HeadlessBackend() { diff --git a/platform/default/mbgl/gl/headless_backend.hpp b/platform/default/mbgl/gl/headless_backend.hpp index 7757037533..3768fef15c 100644 --- a/platform/default/mbgl/gl/headless_backend.hpp +++ b/platform/default/mbgl/gl/headless_backend.hpp @@ -9,7 +9,7 @@ namespace mbgl { class HeadlessBackend : public RendererBackend { public: - HeadlessBackend(Size = { 256, 256 }); + HeadlessBackend(Size = { 256, 256 }, GLContextMode = GLContextMode::Automatic); ~HeadlessBackend() override; void bind() override; diff --git a/platform/default/mbgl/gl/headless_frontend.cpp b/platform/default/mbgl/gl/headless_frontend.cpp index 4263d2b148..16c477dd00 100644 --- a/platform/default/mbgl/gl/headless_frontend.cpp +++ b/platform/default/mbgl/gl/headless_frontend.cpp @@ -11,18 +11,26 @@ HeadlessFrontend::HeadlessFrontend(float pixelRatio_, FileSource& fileSource, Sc : HeadlessFrontend({ 256, 256 }, pixelRatio_, fileSource, scheduler, programCacheDir, mode, localFontFamily) { } -HeadlessFrontend::HeadlessFrontend(Size size_, float pixelRatio_, FileSource& fileSource, Scheduler& scheduler, const optional<std::string> programCacheDir, GLContextMode mode, const optional<std::string> localFontFamily) +HeadlessFrontend::HeadlessFrontend(Size size_, + float pixelRatio_, + FileSource& fileSource, + Scheduler& scheduler, + const optional<std::string> programCacheDir, + GLContextMode mode, + const optional<std::string> localFontFamily) : size(size_), - pixelRatio(pixelRatio_), - backend({ static_cast<uint32_t>(size.width * pixelRatio), - static_cast<uint32_t>(size.height * pixelRatio) }), - asyncInvalidate([this] { - if (renderer && updateParameters) { - mbgl::BackendScope guard { backend }; - renderer->render(*updateParameters); - } - }), - renderer(std::make_unique<Renderer>(backend, pixelRatio, fileSource, scheduler, mode, programCacheDir, localFontFamily)) { + pixelRatio(pixelRatio_), + backend({ static_cast<uint32_t>(size.width * pixelRatio), + static_cast<uint32_t>(size.height * pixelRatio) }, + mode), + asyncInvalidate([this] { + if (renderer && updateParameters) { + mbgl::BackendScope guard{ backend }; + renderer->render(*updateParameters); + } + }), + renderer(std::make_unique<Renderer>( + backend, pixelRatio, fileSource, scheduler, mode, programCacheDir, localFontFamily)) { } HeadlessFrontend::~HeadlessFrontend() = default; diff --git a/platform/default/mbgl/gl/headless_frontend.hpp b/platform/default/mbgl/gl/headless_frontend.hpp index 8ae617d37b..eab922945b 100644 --- a/platform/default/mbgl/gl/headless_frontend.hpp +++ b/platform/default/mbgl/gl/headless_frontend.hpp @@ -19,8 +19,8 @@ class TransformState; class HeadlessFrontend : public RendererFrontend { public: - HeadlessFrontend(float pixelRatio_, FileSource&, Scheduler&, const optional<std::string> programCacheDir = {}, GLContextMode mode = GLContextMode::Unique, const optional<std::string> localFontFamily = {}); - HeadlessFrontend(Size, float pixelRatio_, FileSource&, Scheduler&, const optional<std::string> programCacheDir = {}, GLContextMode mode = GLContextMode::Unique, const optional<std::string> localFontFamily = {}); + HeadlessFrontend(float pixelRatio_, FileSource&, Scheduler&, const optional<std::string> programCacheDir = {}, GLContextMode mode = GLContextMode::Automatic, const optional<std::string> localFontFamily = {}); + HeadlessFrontend(Size, float pixelRatio_, FileSource&, Scheduler&, const optional<std::string> programCacheDir = {}, GLContextMode mode = GLContextMode::Automatic, const optional<std::string> localFontFamily = {}); ~HeadlessFrontend() override; void reset() override; |