From 46c43510d7ac5fe078010d5f0f5d39c4d5df3305 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Wed, 5 Jul 2017 20:08:51 +0300 Subject: [core] rename backend to renderer backend --- benchmark/api/query.benchmark.cpp | 2 +- benchmark/api/render.benchmark.cpp | 3 +- bin/render.cpp | 2 +- cmake/core-files.cmake | 8 +-- include/mbgl/map/backend.hpp | 84 ------------------------ include/mbgl/map/backend_scope.hpp | 31 --------- include/mbgl/renderer/backend_scope.hpp | 31 +++++++++ include/mbgl/renderer/renderer.hpp | 4 +- include/mbgl/renderer/renderer_backend.hpp | 84 ++++++++++++++++++++++++ platform/default/mbgl/gl/headless_backend.cpp | 2 +- platform/default/mbgl/gl/headless_backend.hpp | 4 +- platform/default/thread_local.cpp | 2 +- src/mbgl/map/backend.cpp | 69 ------------------- src/mbgl/map/backend_scope.cpp | 47 ------------- src/mbgl/renderer/backend_scope.cpp | 47 +++++++++++++ src/mbgl/renderer/layers/render_custom_layer.cpp | 2 +- src/mbgl/renderer/render_style.cpp | 2 +- src/mbgl/renderer/renderer.cpp | 2 +- src/mbgl/renderer/renderer_backend.cpp | 69 +++++++++++++++++++ src/mbgl/renderer/renderer_impl.cpp | 4 +- src/mbgl/renderer/renderer_impl.hpp | 7 +- test/api/annotations.test.cpp | 2 +- test/api/api_misuse.test.cpp | 2 +- test/api/custom_layer.test.cpp | 2 +- test/api/query.test.cpp | 2 +- test/api/render_missing.test.cpp | 2 +- test/api/repeated_render.test.cpp | 2 +- test/gl/object.test.cpp | 2 +- test/map/map.test.cpp | 2 +- test/map/prefetch.test.cpp | 2 +- test/tile/annotation_tile.test.cpp | 2 +- test/util/memory.test.cpp | 2 +- test/util/offscreen_texture.test.cpp | 2 +- 33 files changed, 264 insertions(+), 266 deletions(-) delete mode 100644 include/mbgl/map/backend.hpp delete mode 100644 include/mbgl/map/backend_scope.hpp create mode 100644 include/mbgl/renderer/backend_scope.hpp create mode 100644 include/mbgl/renderer/renderer_backend.hpp delete mode 100644 src/mbgl/map/backend.cpp delete mode 100644 src/mbgl/map/backend_scope.cpp create mode 100644 src/mbgl/renderer/backend_scope.cpp create mode 100644 src/mbgl/renderer/renderer_backend.cpp diff --git a/benchmark/api/query.benchmark.cpp b/benchmark/api/query.benchmark.cpp index fa5f3f4d31..db8e597dd3 100644 --- a/benchmark/api/query.benchmark.cpp +++ b/benchmark/api/query.benchmark.cpp @@ -2,11 +2,11 @@ #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/benchmark/api/render.benchmark.cpp b/benchmark/api/render.benchmark.cpp index 1a00d9df12..28e155358b 100644 --- a/benchmark/api/render.benchmark.cpp +++ b/benchmark/api/render.benchmark.cpp @@ -3,12 +3,11 @@ #include #include #include -#include -#include #include #include #include #include +#include #include #include #include diff --git a/bin/render.cpp b/bin/render.cpp index fedd8bbda6..59461e5183 100644 --- a/bin/render.cpp +++ b/bin/render.cpp @@ -1,5 +1,4 @@ #include -#include #include #include @@ -9,6 +8,7 @@ #include #include #include +#include #include #pragma GCC diagnostic push diff --git a/cmake/core-files.cmake b/cmake/core-files.cmake index d22aa58fef..d9bd3f79cb 100644 --- a/cmake/core-files.cmake +++ b/cmake/core-files.cmake @@ -101,16 +101,12 @@ set(MBGL_CORE_FILES src/mbgl/layout/symbol_projection.hpp # map - include/mbgl/map/backend.hpp - include/mbgl/map/backend_scope.hpp include/mbgl/map/camera.hpp include/mbgl/map/change.hpp include/mbgl/map/map.hpp include/mbgl/map/map_observer.hpp include/mbgl/map/mode.hpp include/mbgl/map/view.hpp - src/mbgl/map/backend.cpp - src/mbgl/map/backend_scope.cpp src/mbgl/map/map.cpp src/mbgl/map/transform.cpp src/mbgl/map/transform.hpp @@ -159,9 +155,12 @@ set(MBGL_CORE_FILES src/mbgl/programs/uniforms.hpp # renderer + include/mbgl/renderer/backend_scope.hpp include/mbgl/renderer/query.hpp include/mbgl/renderer/renderer.hpp + include/mbgl/renderer/renderer_backend.hpp include/mbgl/renderer/renderer_frontend.hpp + src/mbgl/renderer/backend_scope.cpp src/mbgl/renderer/bucket.hpp src/mbgl/renderer/bucket_parameters.cpp src/mbgl/renderer/bucket_parameters.hpp @@ -199,6 +198,7 @@ set(MBGL_CORE_FILES src/mbgl/renderer/render_tile.cpp src/mbgl/renderer/render_tile.hpp src/mbgl/renderer/renderer.cpp + src/mbgl/renderer/renderer_backend.cpp src/mbgl/renderer/renderer_impl.cpp src/mbgl/renderer/renderer_impl.hpp src/mbgl/renderer/renderer_observer.hpp diff --git a/include/mbgl/map/backend.hpp b/include/mbgl/map/backend.hpp deleted file mode 100644 index 3347086571..0000000000 --- a/include/mbgl/map/backend.hpp +++ /dev/null @@ -1,84 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include -#include - -namespace mbgl { - -namespace gl { -class Context; -using ProcAddress = void (*)(); -using FramebufferID = uint32_t; -} // namespace gl - -class Backend { -public: - Backend(); - virtual ~Backend(); - - // Returns the backend's context which manages OpenGL state. - gl::Context& getContext(); - - // Called prior to rendering to update the internally assumed OpenGL state. - virtual void updateAssumedState() = 0; - - inline virtual BackendScope::ScopeType getScopeType() const { - return BackendScope::ScopeType::Explicit; - }; - -protected: - // Called with the name of an OpenGL extension that should be loaded. Backend implementations - // must call the API-specific version that obtains the function pointer for this function, - // or a null pointer if unsupported/unavailable. - virtual gl::ProcAddress initializeExtension(const char*) = 0; - - // Called when the backend's GL context needs to be made active or inactive. These are called, - // as a matched pair, in four situations: - // - // 1. When releasing GL resources during Map destruction - // 2. When calling a CustomLayerInitializeFunction, during Map::addLayer - // 3. When calling a CustomLayerDeinitializeFunction, during Map::removeLayer - // 4. When rendering for Map::renderStill - // - // They are *not* called for Map::render; it is assumed that the correct context is already - // activated prior to calling Map::render. - virtual void activate() = 0; - virtual void deactivate() = 0; - - // Reads the color pixel data from the currently bound framebuffer. - PremultipliedImage readFramebuffer(const Size&) const; - - // A constant to signal that a framebuffer is bound, but with an unknown ID. - static constexpr const gl::FramebufferID ImplicitFramebufferBinding = - std::numeric_limits::max(); - - // Tells the renderer that OpenGL state has already been set by the windowing toolkit. - // It sets the internal assumed state to the supplied values. - void assumeFramebufferBinding(gl::FramebufferID fbo); - void assumeViewport(int32_t x, int32_t y, const Size&); - void assumeScissorTest(bool); - - // Returns true when assumed framebuffer binding hasn't changed from the implicit binding. - bool implicitFramebufferBound(); - - // Triggers an OpenGL state update if the internal assumed state doesn't match the - // supplied values. - void setFramebufferBinding(gl::FramebufferID fbo); - void setViewport(int32_t x, int32_t y, const Size&); - void setScissorTest(bool); - -protected: - std::unique_ptr context; - -private: - std::once_flag initialized; - - friend class BackendScope; -}; - -} // namespace mbgl diff --git a/include/mbgl/map/backend_scope.hpp b/include/mbgl/map/backend_scope.hpp deleted file mode 100644 index 4985cd197f..0000000000 --- a/include/mbgl/map/backend_scope.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -namespace mbgl { - -class Backend; - -class BackendScope { -public: - // There are two types of scopes: Creating an "Implicit" scope tells Mapbox GL that the - // supporting windowing system has already activated the GL Backend and that no further actions - // are required. Creating an "Explicit" scope actually enables the GL Backend, and disables it - // when the BackendScope is destroyed. - enum class ScopeType : bool { - Implicit, - Explicit, - }; - - BackendScope(Backend&, ScopeType = ScopeType::Explicit); - ~BackendScope(); - - // Returns true when there is currently a BackendScope active in this thread. - static bool exists(); - -private: - BackendScope* priorScope; - BackendScope* nextScope; - Backend& backend; - const ScopeType scopeType; -}; - -} // namespace mbgl diff --git a/include/mbgl/renderer/backend_scope.hpp b/include/mbgl/renderer/backend_scope.hpp new file mode 100644 index 0000000000..f8a258f3df --- /dev/null +++ b/include/mbgl/renderer/backend_scope.hpp @@ -0,0 +1,31 @@ +#pragma once + +namespace mbgl { + +class RendererBackend; + +class BackendScope { +public: + // There are two types of scopes: Creating an "Implicit" scope tells Mapbox GL that the + // supporting windowing system has already activated the GL Backend and that no further actions + // are required. Creating an "Explicit" scope actually enables the GL Backend, and disables it + // when the BackendScope is destroyed. + enum class ScopeType : bool { + Implicit, + Explicit, + }; + + BackendScope(RendererBackend&, ScopeType = ScopeType::Explicit); + ~BackendScope(); + + // Returns true when there is currently a BackendScope active in this thread. + static bool exists(); + +private: + BackendScope* priorScope; + BackendScope* nextScope; + RendererBackend& backend; + const ScopeType scopeType; +}; + +} // namespace mbgl diff --git a/include/mbgl/renderer/renderer.hpp b/include/mbgl/renderer/renderer.hpp index 6626f74d3d..c209e03045 100644 --- a/include/mbgl/renderer/renderer.hpp +++ b/include/mbgl/renderer/renderer.hpp @@ -13,8 +13,8 @@ namespace mbgl { -class Backend; class FileSource; +class RendererBackend; class RendererObserver; class RenderedQueryOptions; class Scheduler; @@ -24,7 +24,7 @@ class View; class Renderer { public: - Renderer(Backend&, float pixelRatio_, FileSource&, Scheduler&, + Renderer(RendererBackend&, float pixelRatio_, FileSource&, Scheduler&, GLContextMode = GLContextMode::Unique, const optional programCacheDir = optional()); ~Renderer(); diff --git a/include/mbgl/renderer/renderer_backend.hpp b/include/mbgl/renderer/renderer_backend.hpp new file mode 100644 index 0000000000..9d967fd51b --- /dev/null +++ b/include/mbgl/renderer/renderer_backend.hpp @@ -0,0 +1,84 @@ +#pragma once + +#include +#include +#include +#include + +#include +#include + +namespace mbgl { + +namespace gl { +class Context; +using ProcAddress = void (*)(); +using FramebufferID = uint32_t; +} // namespace gl + +// The RendererBackend is used by the Renderer to facilitate +// the actual rendering. +class RendererBackend { +public: + RendererBackend(); + virtual ~RendererBackend(); + + // Returns the backend's context which manages OpenGL state. + gl::Context& getContext(); + + // Called prior to rendering to update the internally assumed OpenGL state. + virtual void updateAssumedState() = 0; + + virtual BackendScope::ScopeType getScopeType() const { + return BackendScope::ScopeType::Explicit; + } + +protected: + // Called with the name of an OpenGL extension that should be loaded. RendererBackend implementations + // must call the API-specific version that obtains the function pointer for this function, + // or a null pointer if unsupported/unavailable. + virtual gl::ProcAddress initializeExtension(const char*) = 0; + + // Called when the backend's GL context needs to be made active or inactive. These are called, + // as a matched pair, exclusively through BackendScope, in two situations: + // + // 1. When releasing GL resources during Renderer destruction + // (Including calling CustomLayerDeinitializeFunction during RenderCustomLayer destruction) + // 2. When renderering through Renderer::render() + // (Including calling CustomLayerDeinitializeFunction for newly added custom layers and + // CustomLayerDeinitializeFunction on layer removal) + virtual void activate() = 0; + virtual void deactivate() = 0; + + // Reads the color pixel data from the currently bound framebuffer. + PremultipliedImage readFramebuffer(const Size&) const; + + // A constant to signal that a framebuffer is bound, but with an unknown ID. + static constexpr const gl::FramebufferID ImplicitFramebufferBinding = + std::numeric_limits::max(); + + // Tells the renderer that OpenGL state has already been set by the windowing toolkit. + // It sets the internal assumed state to the supplied values. + void assumeFramebufferBinding(gl::FramebufferID fbo); + void assumeViewport(int32_t x, int32_t y, const Size&); + void assumeScissorTest(bool); + + // Returns true when assumed framebuffer binding hasn't changed from the implicit binding. + bool implicitFramebufferBound(); + + // Triggers an OpenGL state update if the internal assumed state doesn't match the + // supplied values. + void setFramebufferBinding(gl::FramebufferID fbo); + void setViewport(int32_t x, int32_t y, const Size&); + void setScissorTest(bool); + +protected: + std::unique_ptr context; + +private: + std::once_flag initialized; + + friend class BackendScope; +}; + +} // namespace mbgl diff --git a/platform/default/mbgl/gl/headless_backend.cpp b/platform/default/mbgl/gl/headless_backend.cpp index 82cf7b38fd..e17e8f5c11 100644 --- a/platform/default/mbgl/gl/headless_backend.cpp +++ b/platform/default/mbgl/gl/headless_backend.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include diff --git a/platform/default/mbgl/gl/headless_backend.hpp b/platform/default/mbgl/gl/headless_backend.hpp index 7b9f7f5ad3..133c2096d9 100644 --- a/platform/default/mbgl/gl/headless_backend.hpp +++ b/platform/default/mbgl/gl/headless_backend.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -9,7 +9,7 @@ namespace mbgl { class HeadlessDisplay; -class HeadlessBackend : public Backend { +class HeadlessBackend : public RendererBackend { public: HeadlessBackend(); HeadlessBackend(std::shared_ptr); diff --git a/platform/default/thread_local.cpp b/platform/default/thread_local.cpp index 6fdb1e6dc1..7abbaa0146 100644 --- a/platform/default/thread_local.cpp +++ b/platform/default/thread_local.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include diff --git a/src/mbgl/map/backend.cpp b/src/mbgl/map/backend.cpp deleted file mode 100644 index 83c2fed00b..0000000000 --- a/src/mbgl/map/backend.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include -#include -#include -#include -#include - -#include - -namespace mbgl { - -Backend::Backend() = default; - -gl::Context& Backend::getContext() { - assert(BackendScope::exists()); - std::call_once(initialized, [this] { - context = std::make_unique(); - context->enableDebugging(); - context->initializeExtensions( - std::bind(&Backend::initializeExtension, this, std::placeholders::_1)); - }); - return *context; -} - -PremultipliedImage Backend::readFramebuffer(const Size& size) const { - assert(context); - return context->readFramebuffer(size); -} - -void Backend::assumeFramebufferBinding(const gl::FramebufferID fbo) { - getContext().bindFramebuffer.setCurrentValue(fbo); - if (fbo != ImplicitFramebufferBinding) { - assert(gl::value::BindFramebuffer::Get() == getContext().bindFramebuffer.getCurrentValue()); - } -} - -void Backend::assumeViewport(int32_t x, int32_t y, const Size& size) { - getContext().viewport.setCurrentValue({ x, y, size }); - assert(gl::value::Viewport::Get() == getContext().viewport.getCurrentValue()); -} - -void Backend::assumeScissorTest(bool enabled) { - getContext().scissorTest.setCurrentValue(enabled); - assert(gl::value::ScissorTest::Get() == getContext().scissorTest.getCurrentValue()); -} - -bool Backend::implicitFramebufferBound() { - return getContext().bindFramebuffer.getCurrentValue() == ImplicitFramebufferBinding; -} - -void Backend::setFramebufferBinding(const gl::FramebufferID fbo) { - getContext().bindFramebuffer = fbo; - if (fbo != ImplicitFramebufferBinding) { - assert(gl::value::BindFramebuffer::Get() == getContext().bindFramebuffer.getCurrentValue()); - } -} - -void Backend::setViewport(int32_t x, int32_t y, const Size& size) { - getContext().viewport = { x, y, size }; - assert(gl::value::Viewport::Get() == getContext().viewport.getCurrentValue()); -} - -void Backend::setScissorTest(bool enabled) { - getContext().scissorTest = enabled; - assert(gl::value::ScissorTest::Get() == getContext().scissorTest.getCurrentValue()); -} - -Backend::~Backend() = default; - -} // namespace mbgl diff --git a/src/mbgl/map/backend_scope.cpp b/src/mbgl/map/backend_scope.cpp deleted file mode 100644 index 824ad4498b..0000000000 --- a/src/mbgl/map/backend_scope.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include -#include - -#include - -namespace mbgl { - -static util::ThreadLocal currentScope; - -BackendScope::BackendScope(Backend& backend_, ScopeType scopeType_) - : priorScope(currentScope.get()), - nextScope(nullptr), - backend(backend_), - scopeType(scopeType_) { - if (priorScope) { - assert(priorScope->nextScope == nullptr); - priorScope->nextScope = this; - } - if (scopeType == ScopeType::Explicit) { - backend.activate(); - } - - currentScope.set(this); -} - -BackendScope::~BackendScope() { - assert(nextScope == nullptr); - if (priorScope) { - priorScope->backend.activate(); - currentScope.set(priorScope); - assert(priorScope->nextScope == this); - priorScope->nextScope = nullptr; - } else { - if (scopeType == ScopeType::Explicit) { - backend.deactivate(); - } - - currentScope.set(nullptr); - } -} - -bool BackendScope::exists() { - return currentScope.get(); -} - -} // namespace mbgl diff --git a/src/mbgl/renderer/backend_scope.cpp b/src/mbgl/renderer/backend_scope.cpp new file mode 100644 index 0000000000..5d57421c48 --- /dev/null +++ b/src/mbgl/renderer/backend_scope.cpp @@ -0,0 +1,47 @@ +#include +#include +#include + +#include + +namespace mbgl { + +static util::ThreadLocal currentScope; + +BackendScope::BackendScope(RendererBackend& backend_, ScopeType scopeType_) + : priorScope(currentScope.get()), + nextScope(nullptr), + backend(backend_), + scopeType(scopeType_) { + if (priorScope) { + assert(priorScope->nextScope == nullptr); + priorScope->nextScope = this; + } + if (scopeType == ScopeType::Explicit) { + backend.activate(); + } + + currentScope.set(this); +} + +BackendScope::~BackendScope() { + assert(nextScope == nullptr); + if (priorScope) { + priorScope->backend.activate(); + currentScope.set(priorScope); + assert(priorScope->nextScope == this); + priorScope->nextScope = nullptr; + } else { + if (scopeType == ScopeType::Explicit) { + backend.deactivate(); + } + + currentScope.set(nullptr); + } +} + +bool BackendScope::exists() { + return currentScope.get(); +} + +} // namespace mbgl diff --git a/src/mbgl/renderer/layers/render_custom_layer.cpp b/src/mbgl/renderer/layers/render_custom_layer.cpp index 81b8ac301b..30649137c7 100644 --- a/src/mbgl/renderer/layers/render_custom_layer.cpp +++ b/src/mbgl/renderer/layers/render_custom_layer.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include namespace mbgl { diff --git a/src/mbgl/renderer/render_style.cpp b/src/mbgl/renderer/render_style.cpp index a0f1fd4049..2bf903fe5f 100644 --- a/src/mbgl/renderer/render_style.cpp +++ b/src/mbgl/renderer/render_style.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -24,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/src/mbgl/renderer/renderer.cpp b/src/mbgl/renderer/renderer.cpp index 11d7726c79..3c9715cd50 100644 --- a/src/mbgl/renderer/renderer.cpp +++ b/src/mbgl/renderer/renderer.cpp @@ -5,7 +5,7 @@ namespace mbgl { -Renderer::Renderer(Backend& backend, +Renderer::Renderer(RendererBackend& backend, float pixelRatio_, FileSource& fileSource_, Scheduler& scheduler_, diff --git a/src/mbgl/renderer/renderer_backend.cpp b/src/mbgl/renderer/renderer_backend.cpp new file mode 100644 index 0000000000..159ef432b3 --- /dev/null +++ b/src/mbgl/renderer/renderer_backend.cpp @@ -0,0 +1,69 @@ +#include +#include +#include +#include +#include + +#include + +namespace mbgl { + +RendererBackend::RendererBackend() = default; + +gl::Context& RendererBackend::getContext() { + assert(BackendScope::exists()); + std::call_once(initialized, [this] { + context = std::make_unique(); + context->enableDebugging(); + context->initializeExtensions( + std::bind(&RendererBackend::initializeExtension, this, std::placeholders::_1)); + }); + return *context; +} + +PremultipliedImage RendererBackend::readFramebuffer(const Size& size) const { + assert(context); + return context->readFramebuffer(size); +} + +void RendererBackend::assumeFramebufferBinding(const gl::FramebufferID fbo) { + getContext().bindFramebuffer.setCurrentValue(fbo); + if (fbo != ImplicitFramebufferBinding) { + assert(gl::value::BindFramebuffer::Get() == getContext().bindFramebuffer.getCurrentValue()); + } +} + +void RendererBackend::assumeViewport(int32_t x, int32_t y, const Size& size) { + getContext().viewport.setCurrentValue({ x, y, size }); + assert(gl::value::Viewport::Get() == getContext().viewport.getCurrentValue()); +} + +void RendererBackend::assumeScissorTest(bool enabled) { + getContext().scissorTest.setCurrentValue(enabled); + assert(gl::value::ScissorTest::Get() == getContext().scissorTest.getCurrentValue()); +} + +bool RendererBackend::implicitFramebufferBound() { + return getContext().bindFramebuffer.getCurrentValue() == ImplicitFramebufferBinding; +} + +void RendererBackend::setFramebufferBinding(const gl::FramebufferID fbo) { + getContext().bindFramebuffer = fbo; + if (fbo != ImplicitFramebufferBinding) { + assert(gl::value::BindFramebuffer::Get() == getContext().bindFramebuffer.getCurrentValue()); + } +} + +void RendererBackend::setViewport(int32_t x, int32_t y, const Size& size) { + getContext().viewport = { x, y, size }; + assert(gl::value::Viewport::Get() == getContext().viewport.getCurrentValue()); +} + +void RendererBackend::setScissorTest(bool enabled) { + getContext().scissorTest = enabled; + assert(gl::value::ScissorTest::Get() == getContext().scissorTest.getCurrentValue()); +} + +RendererBackend::~RendererBackend() = default; + +} // namespace mbgl diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp index accdbc1332..38aaf95671 100644 --- a/src/mbgl/renderer/renderer_impl.cpp +++ b/src/mbgl/renderer/renderer_impl.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include namespace mbgl { @@ -14,7 +14,7 @@ static RendererObserver& nullObserver() { return observer; } -Renderer::Impl::Impl(Backend& backend_, +Renderer::Impl::Impl(RendererBackend& backend_, float pixelRatio_, FileSource& fileSource_, Scheduler& scheduler_, diff --git a/src/mbgl/renderer/renderer_impl.hpp b/src/mbgl/renderer/renderer_impl.hpp index 645b33b354..2294dde91e 100644 --- a/src/mbgl/renderer/renderer_impl.hpp +++ b/src/mbgl/renderer/renderer_impl.hpp @@ -1,11 +1,10 @@ #pragma once #include +#include #include #include #include -#include - #include #include @@ -25,7 +24,7 @@ class View; class Renderer::Impl : public RenderStyleObserver { public: - Impl(Backend&, float pixelRatio_, FileSource&, Scheduler&, GLContextMode, + Impl(RendererBackend&, float pixelRatio_, FileSource&, Scheduler&, GLContextMode, const optional programCacheDir); ~Impl() final; @@ -47,7 +46,7 @@ public: private: friend class Renderer; - Backend& backend; + RendererBackend& backend; RendererObserver* observer; diff --git a/test/api/annotations.test.cpp b/test/api/annotations.test.cpp index 76e66c2fa3..bc1ad54129 100644 --- a/test/api/annotations.test.cpp +++ b/test/api/annotations.test.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/api/api_misuse.test.cpp b/test/api/api_misuse.test.cpp index 742137d73d..ed5cc41a49 100644 --- a/test/api/api_misuse.test.cpp +++ b/test/api/api_misuse.test.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/api/custom_layer.test.cpp b/test/api/custom_layer.test.cpp index b3ef0719ce..da5b535a86 100644 --- a/test/api/custom_layer.test.cpp +++ b/test/api/custom_layer.test.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/api/query.test.cpp b/test/api/query.test.cpp index efb31f89c6..5135b51e8b 100644 --- a/test/api/query.test.cpp +++ b/test/api/query.test.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/test/api/render_missing.test.cpp b/test/api/render_missing.test.cpp index bce6df6305..01a0e9293b 100644 --- a/test/api/render_missing.test.cpp +++ b/test/api/render_missing.test.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/api/repeated_render.test.cpp b/test/api/repeated_render.test.cpp index d52765e2a5..7d61992769 100644 --- a/test/api/repeated_render.test.cpp +++ b/test/api/repeated_render.test.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/gl/object.test.cpp b/test/gl/object.test.cpp index b5a055f4ca..cf887dab40 100644 --- a/test/gl/object.test.cpp +++ b/test/gl/object.test.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index ef1d7c3d6f..93890aa9f3 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/map/prefetch.test.cpp b/test/map/prefetch.test.cpp index d14f5db492..c3ff04acfc 100644 --- a/test/map/prefetch.test.cpp +++ b/test/map/prefetch.test.cpp @@ -3,9 +3,9 @@ #include #include -#include #include #include +#include #include #include #include diff --git a/test/tile/annotation_tile.test.cpp b/test/tile/annotation_tile.test.cpp index bed0bb160e..50f1facc10 100644 --- a/test/tile/annotation_tile.test.cpp +++ b/test/tile/annotation_tile.test.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/test/util/memory.test.cpp b/test/util/memory.test.cpp index fb93699d7f..cb333129d8 100644 --- a/test/util/memory.test.cpp +++ b/test/util/memory.test.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/util/offscreen_texture.test.cpp b/test/util/offscreen_texture.test.cpp index 8c0d4f7011..d8a409de36 100644 --- a/test/util/offscreen_texture.test.cpp +++ b/test/util/offscreen_texture.test.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include -- cgit v1.2.1