diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-07-05 20:08:51 +0300 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-07-18 10:45:12 +0200 |
commit | 46c43510d7ac5fe078010d5f0f5d39c4d5df3305 (patch) | |
tree | 5dc78959e174dc0e83198a4d92e86f65f33bb168 /src | |
parent | ee205ca9ca3f808fa2cc16295ebde0a7c3867381 (diff) | |
download | qtlocation-mapboxgl-46c43510d7ac5fe078010d5f0f5d39c4d5df3305.tar.gz |
[core] rename backend to renderer backend
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/renderer/backend_scope.cpp (renamed from src/mbgl/map/backend_scope.cpp) | 6 | ||||
-rw-r--r-- | src/mbgl/renderer/layers/render_custom_layer.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/render_style.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/renderer.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/renderer_backend.cpp (renamed from src/mbgl/map/backend.cpp) | 28 | ||||
-rw-r--r-- | src/mbgl/renderer/renderer_impl.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/renderer_impl.hpp | 7 |
7 files changed, 25 insertions, 26 deletions
diff --git a/src/mbgl/map/backend_scope.cpp b/src/mbgl/renderer/backend_scope.cpp index 824ad4498b..5d57421c48 100644 --- a/src/mbgl/map/backend_scope.cpp +++ b/src/mbgl/renderer/backend_scope.cpp @@ -1,5 +1,5 @@ -#include <mbgl/map/backend_scope.hpp> -#include <mbgl/map/backend.hpp> +#include <mbgl/renderer/backend_scope.hpp> +#include <mbgl/renderer/renderer_backend.hpp> #include <mbgl/util/thread_local.hpp> #include <cassert> @@ -8,7 +8,7 @@ namespace mbgl { static util::ThreadLocal<BackendScope> currentScope; -BackendScope::BackendScope(Backend& backend_, ScopeType scopeType_) +BackendScope::BackendScope(RendererBackend& backend_, ScopeType scopeType_) : priorScope(currentScope.get()), nextScope(nullptr), backend(backend_), 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 <mbgl/renderer/paint_parameters.hpp> #include <mbgl/style/layers/custom_layer_impl.hpp> #include <mbgl/map/transform_state.hpp> -#include <mbgl/map/backend_scope.hpp> +#include <mbgl/renderer/backend_scope.hpp> 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 <mbgl/renderer/layers/render_line_layer.hpp> #include <mbgl/renderer/layers/render_raster_layer.hpp> #include <mbgl/renderer/layers/render_symbol_layer.hpp> +#include <mbgl/renderer/backend_scope.hpp> #include <mbgl/renderer/style_diff.hpp> #include <mbgl/renderer/image_manager.hpp> #include <mbgl/renderer/query.hpp> @@ -24,7 +25,6 @@ #include <mbgl/sprite/sprite_loader.hpp> #include <mbgl/text/glyph_manager.hpp> #include <mbgl/geometry/line_atlas.hpp> -#include <mbgl/map/backend_scope.hpp> #include <mbgl/tile/tile.hpp> #include <mbgl/util/math.hpp> #include <mbgl/util/string.hpp> 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/map/backend.cpp b/src/mbgl/renderer/renderer_backend.cpp index 83c2fed00b..159ef432b3 100644 --- a/src/mbgl/map/backend.cpp +++ b/src/mbgl/renderer/renderer_backend.cpp @@ -1,5 +1,5 @@ -#include <mbgl/map/backend.hpp> -#include <mbgl/map/backend_scope.hpp> +#include <mbgl/renderer/renderer_backend.hpp> +#include <mbgl/renderer/backend_scope.hpp> #include <mbgl/gl/context.hpp> #include <mbgl/gl/extension.hpp> #include <mbgl/gl/debugging.hpp> @@ -8,62 +8,62 @@ namespace mbgl { -Backend::Backend() = default; +RendererBackend::RendererBackend() = default; -gl::Context& Backend::getContext() { +gl::Context& RendererBackend::getContext() { assert(BackendScope::exists()); std::call_once(initialized, [this] { context = std::make_unique<gl::Context>(); context->enableDebugging(); context->initializeExtensions( - std::bind(&Backend::initializeExtension, this, std::placeholders::_1)); + std::bind(&RendererBackend::initializeExtension, this, std::placeholders::_1)); }); return *context; } -PremultipliedImage Backend::readFramebuffer(const Size& size) const { +PremultipliedImage RendererBackend::readFramebuffer(const Size& size) const { assert(context); return context->readFramebuffer<PremultipliedImage>(size); } -void Backend::assumeFramebufferBinding(const gl::FramebufferID fbo) { +void RendererBackend::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) { +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 Backend::assumeScissorTest(bool enabled) { +void RendererBackend::assumeScissorTest(bool enabled) { getContext().scissorTest.setCurrentValue(enabled); assert(gl::value::ScissorTest::Get() == getContext().scissorTest.getCurrentValue()); } -bool Backend::implicitFramebufferBound() { +bool RendererBackend::implicitFramebufferBound() { return getContext().bindFramebuffer.getCurrentValue() == ImplicitFramebufferBinding; } -void Backend::setFramebufferBinding(const gl::FramebufferID fbo) { +void RendererBackend::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) { +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 Backend::setScissorTest(bool enabled) { +void RendererBackend::setScissorTest(bool enabled) { getContext().scissorTest = enabled; assert(gl::value::ScissorTest::Get() == getContext().scissorTest.getCurrentValue()); } -Backend::~Backend() = default; +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 <mbgl/renderer/painter.hpp> #include <mbgl/renderer/update_parameters.hpp> #include <mbgl/map/transform_state.hpp> -#include <mbgl/map/backend_scope.hpp> +#include <mbgl/renderer/backend_scope.hpp> 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 <mbgl/renderer/renderer.hpp> +#include <mbgl/renderer/renderer_backend.hpp> #include <mbgl/renderer/renderer_observer.hpp> #include <mbgl/renderer/render_style_observer.hpp> #include <mbgl/style/style.hpp> -#include <mbgl/map/backend.hpp> - #include <memory> #include <string> @@ -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<std::string> programCacheDir); ~Impl() final; @@ -47,7 +46,7 @@ public: private: friend class Renderer; - Backend& backend; + RendererBackend& backend; RendererObserver* observer; |