diff options
-rw-r--r-- | platform/default/mbgl/gl/headless_backend.cpp | 2 | ||||
-rw-r--r-- | platform/default/mbgl/renderer/async_renderer_frontend.cpp | 7 | ||||
-rw-r--r-- | platform/default/mbgl/renderer/async_renderer_frontend.hpp | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/platform/default/mbgl/gl/headless_backend.cpp b/platform/default/mbgl/gl/headless_backend.cpp index 9076be4cbb..82660331fa 100644 --- a/platform/default/mbgl/gl/headless_backend.cpp +++ b/platform/default/mbgl/gl/headless_backend.cpp @@ -12,7 +12,7 @@ namespace mbgl { HeadlessBackend::HeadlessBackend() = default; HeadlessBackend::~HeadlessBackend() { - BackendScope guard { *this, getScopeType() }; + BackendScope guard { *this }; context.reset(); } diff --git a/platform/default/mbgl/renderer/async_renderer_frontend.cpp b/platform/default/mbgl/renderer/async_renderer_frontend.cpp index 37b4e60cf6..230d0bb820 100644 --- a/platform/default/mbgl/renderer/async_renderer_frontend.cpp +++ b/platform/default/mbgl/renderer/async_renderer_frontend.cpp @@ -1,13 +1,16 @@ #include "async_renderer_frontend.hpp" + +#include <mbgl/renderer/backend_scope.hpp> #include <mbgl/renderer/renderer.hpp> namespace mbgl { -AsyncRendererFrontend::AsyncRendererFrontend(std::unique_ptr<Renderer> renderer_, View& view_) +AsyncRendererFrontend::AsyncRendererFrontend(std::unique_ptr<Renderer> renderer_, RendererBackend& backend, View& view_) : renderer(std::move(renderer_)) , view(view_) - , asyncInvalidate([this] { + , asyncInvalidate([&] { if (renderer && updateParameters) { + BackendScope guard { backend }; renderer->render(view, *updateParameters); } }) { diff --git a/platform/default/mbgl/renderer/async_renderer_frontend.hpp b/platform/default/mbgl/renderer/async_renderer_frontend.hpp index 00cf3a480c..e1b2f780cd 100644 --- a/platform/default/mbgl/renderer/async_renderer_frontend.hpp +++ b/platform/default/mbgl/renderer/async_renderer_frontend.hpp @@ -10,11 +10,12 @@ namespace mbgl { class Renderer; +class RendererBackend; // Default implementation for RendererFrontend class AsyncRendererFrontend : public mbgl::RendererFrontend { public: - AsyncRendererFrontend(std::unique_ptr<Renderer>, View&); + AsyncRendererFrontend(std::unique_ptr<Renderer>, RendererBackend&, View&); ~AsyncRendererFrontend() override; void reset() override; |