diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-07-21 16:36:31 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-07-26 09:50:38 -0700 |
commit | d4cb498d7abc612029c575fb290eb649a4697d57 (patch) | |
tree | 9e9221873a3c51ef538402f1f7dec4055cb828e5 /platform | |
parent | 32bd1d54fa777035920b58e653905e4592ef187c (diff) | |
download | qtlocation-mapboxgl-d4cb498d7abc612029c575fb290eb649a4697d57.tar.gz |
[all] Merge View into RendererBackend
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/src/android_renderer_frontend.cpp | 5 | ||||
-rw-r--r-- | platform/android/src/android_renderer_frontend.hpp | 4 | ||||
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 4 | ||||
-rwxr-xr-x | platform/android/src/native_map_view.hpp | 8 | ||||
-rw-r--r-- | platform/darwin/src/MGLRendererFrontend.h | 9 | ||||
-rw-r--r-- | platform/default/mbgl/gl/headless_backend.hpp | 3 | ||||
-rw-r--r-- | platform/default/mbgl/gl/headless_frontend.cpp | 2 | ||||
-rw-r--r-- | platform/glfw/glfw_renderer_frontend.cpp | 2 | ||||
-rw-r--r-- | platform/glfw/glfw_view.hpp | 6 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 5 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 5 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 1 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl_p.hpp | 8 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl_renderer_frontend_p.cpp | 7 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl_renderer_frontend_p.hpp | 4 |
15 files changed, 25 insertions, 48 deletions
diff --git a/platform/android/src/android_renderer_frontend.cpp b/platform/android/src/android_renderer_frontend.cpp index 41e44d297a..597bebe40d 100644 --- a/platform/android/src/android_renderer_frontend.cpp +++ b/platform/android/src/android_renderer_frontend.cpp @@ -1,6 +1,5 @@ #include "android_renderer_frontend.hpp" -#include <mbgl/map/view.hpp> #include <mbgl/renderer/backend_scope.hpp> #include <mbgl/renderer/renderer.hpp> @@ -37,13 +36,13 @@ void AndroidRendererFrontend::update(std::shared_ptr<UpdateParameters> params) { asyncInvalidate.send(); } -void AndroidRendererFrontend::render(View& view) { +void AndroidRendererFrontend::render() { assert (renderer); if (!updateParameters) return; BackendScope guard { backend }; - renderer->render(view, *updateParameters); + renderer->render(*updateParameters); } void AndroidRendererFrontend::onLowMemory() { diff --git a/platform/android/src/android_renderer_frontend.hpp b/platform/android/src/android_renderer_frontend.hpp index 59ece88f19..107bbbe0b6 100644 --- a/platform/android/src/android_renderer_frontend.hpp +++ b/platform/android/src/android_renderer_frontend.hpp @@ -13,9 +13,7 @@ namespace mbgl { -class View; class Renderer; -class View; class RenderedQueryOptions; class SourceQueryOptions; @@ -31,7 +29,7 @@ public: void setObserver(RendererObserver&) override; void update(std::shared_ptr<UpdateParameters>) override; - void render(View& view); + void render(); // Feature querying std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const RenderedQueryOptions&) const; diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 17f55d9827..fa9e90ddc6 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -107,7 +107,7 @@ NativeMapView::~NativeMapView() { } /** - * From mbgl::View + * From mbgl::RendererBackend */ void NativeMapView::bind() { setFramebufferBinding(0); @@ -275,7 +275,7 @@ void NativeMapView::render(jni::JNIEnv& env) { framebufferSizeChanged = false; } - rendererFrontend->render(*this); + rendererFrontend->render(); if(snapshot){ snapshot = false; diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp index 387593350a..ba1545728a 100755 --- a/platform/android/src/native_map_view.hpp +++ b/platform/android/src/native_map_view.hpp @@ -4,7 +4,6 @@ #include <mbgl/map/change.hpp> #include <mbgl/map/camera.hpp> #include <mbgl/map/map.hpp> -#include <mbgl/map/view.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/util/run_loop.hpp> @@ -38,7 +37,7 @@ namespace android { class AndroidRendererFrontend; -class NativeMapView : public View, public RendererBackend, public MapObserver { +class NativeMapView : public RendererBackend, public MapObserver { public: static constexpr auto Name() { return "com/mapbox/mapboxsdk/maps/NativeMapView"; }; @@ -55,12 +54,9 @@ public: virtual ~NativeMapView(); - // mbgl::View // - - void bind() override; - // mbgl::RendererBackend // + void bind() override; void updateAssumedState() override; // Deprecated // diff --git a/platform/darwin/src/MGLRendererFrontend.h b/platform/darwin/src/MGLRendererFrontend.h index 3611577f2e..76904d008b 100644 --- a/platform/darwin/src/MGLRendererFrontend.h +++ b/platform/darwin/src/MGLRendererFrontend.h @@ -13,12 +13,10 @@ class MGLRenderFrontend : public mbgl::RendererFrontend { public: - MGLRenderFrontend(std::unique_ptr<mbgl::Renderer> renderer_, MGLMapView* nativeView_, mbgl::RendererBackend& mbglBackend_, mbgl::View& mbglView_, bool async = false) + MGLRenderFrontend(std::unique_ptr<mbgl::Renderer> renderer_, MGLMapView* nativeView_, mbgl::RendererBackend& mbglBackend_, bool async = false) : renderer(std::move(renderer_)) , nativeView(nativeView_) - , mbglBackend(mbglBackend_) - , mbglView(mbglView_) { - + , mbglBackend(mbglBackend_) { if (async) { asyncInvalidate.emplace([&]() { [nativeView setNeedsGLDisplay]; @@ -51,7 +49,7 @@ public: mbgl::BackendScope guard { mbglBackend, mbgl::BackendScope::ScopeType::Implicit }; - renderer->render(mbglView, *updateParameters); + renderer->render(*updateParameters); } mbgl::Renderer* getRenderer() { @@ -67,7 +65,6 @@ private: std::unique_ptr<mbgl::Renderer> renderer; __weak MGLMapView *nativeView = nullptr; mbgl::RendererBackend& mbglBackend; - mbgl::View& mbglView; std::shared_ptr<mbgl::UpdateParameters> updateParameters; mbgl::optional<mbgl::util::AsyncTask> asyncInvalidate; }; diff --git a/platform/default/mbgl/gl/headless_backend.hpp b/platform/default/mbgl/gl/headless_backend.hpp index d845e9930c..8d86ea8c47 100644 --- a/platform/default/mbgl/gl/headless_backend.hpp +++ b/platform/default/mbgl/gl/headless_backend.hpp @@ -1,6 +1,5 @@ #pragma once -#include <mbgl/map/view.hpp> #include <mbgl/renderer/renderer_backend.hpp> #include <memory> @@ -10,7 +9,7 @@ namespace mbgl { class HeadlessDisplay; -class HeadlessBackend : public View, public RendererBackend { +class HeadlessBackend : public RendererBackend { public: HeadlessBackend(Size = { 256, 256 }); ~HeadlessBackend() override; diff --git a/platform/default/mbgl/gl/headless_frontend.cpp b/platform/default/mbgl/gl/headless_frontend.cpp index 3f34d8eeba..ad03706be7 100644 --- a/platform/default/mbgl/gl/headless_frontend.cpp +++ b/platform/default/mbgl/gl/headless_frontend.cpp @@ -17,7 +17,7 @@ HeadlessFrontend::HeadlessFrontend(Size size_, float pixelRatio_, FileSource& fi asyncInvalidate([this] { if (renderer && updateParameters) { mbgl::BackendScope guard { backend }; - renderer->render(backend, *updateParameters); + renderer->render(*updateParameters); } }), renderer(std::make_unique<Renderer>(backend, pixelRatio, fileSource, scheduler)) { diff --git a/platform/glfw/glfw_renderer_frontend.cpp b/platform/glfw/glfw_renderer_frontend.cpp index d0fefadf14..73205f1c56 100644 --- a/platform/glfw/glfw_renderer_frontend.cpp +++ b/platform/glfw/glfw_renderer_frontend.cpp @@ -32,7 +32,7 @@ void GLFWRendererFrontend::render() { mbgl::BackendScope guard { glfwView, mbgl::BackendScope::ScopeType::Implicit }; - renderer->render(glfwView, *updateParameters); + renderer->render(*updateParameters); } mbgl::Renderer* GLFWRendererFrontend::getRenderer() { diff --git a/platform/glfw/glfw_view.hpp b/platform/glfw/glfw_view.hpp index 12035f3e39..ccde4f027f 100644 --- a/platform/glfw/glfw_view.hpp +++ b/platform/glfw/glfw_view.hpp @@ -1,7 +1,6 @@ #pragma once #include <mbgl/map/map.hpp> -#include <mbgl/map/view.hpp> #include <mbgl/renderer/renderer_backend.hpp> #include <mbgl/util/run_loop.hpp> #include <mbgl/util/timer.hpp> @@ -10,7 +9,7 @@ struct GLFWwindow; class GLFWRendererFrontend; -class GLFWView : public mbgl::View, public mbgl::RendererBackend, public mbgl::MapObserver { +class GLFWView : public mbgl::RendererBackend, public mbgl::MapObserver { public: GLFWView(bool fullscreen = false, bool benchmark = false); ~GLFWView() override; @@ -37,12 +36,11 @@ public: void invalidate(); - // mbgl::View implementation - void bind() override; mbgl::Size getSize() const; mbgl::Size getFramebufferSize() const; // mbgl::RendererBackend implementation + void bind() override; void updateAssumedState() override; // mbgl::MapObserver implementation diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 83ea4a8d8f..175e1f125d 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -6,7 +6,6 @@ #import <OpenGLES/EAGL.h> #include <mbgl/map/map.hpp> -#include <mbgl/map/view.hpp> #include <mbgl/annotation/annotation.hpp> #include <mbgl/map/camera.hpp> #include <mbgl/map/mode.hpp> @@ -455,7 +454,7 @@ public: _mbglThreadPool = mbgl::sharedThreadPool(); auto renderer = std::make_unique<mbgl::Renderer>(*_mbglView, scaleFactor, *mbglFileSource, *_mbglThreadPool, mbgl::GLContextMode::Unique); - _rendererFrontend = std::make_unique<MGLRenderFrontend>(std::move(renderer), self, *_mbglView, *_mbglView); + _rendererFrontend = std::make_unique<MGLRenderFrontend>(std::move(renderer), self, *_mbglView); _mbglMap = new mbgl::Map(*_rendererFrontend, *_mbglView, self.size, scaleFactor, *mbglFileSource, *_mbglThreadPool, mbgl::MapMode::Continuous, mbgl::ConstrainMode::None, mbgl::ViewportMode::Default); // start paused if in IB @@ -5417,7 +5416,7 @@ public: return _annotationViewReuseQueueByIdentifier[identifier]; } -class MBGLView : public mbgl::View, public mbgl::RendererBackend, public mbgl::MapObserver +class MBGLView : public mbgl::RendererBackend, public mbgl::MapObserver { public: MBGLView(MGLMapView* nativeView_) : nativeView(nativeView_) { diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 6707f59628..5dbb134ef5 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -24,7 +24,6 @@ #import "MGLImageSource.h" #import <mbgl/map/map.hpp> -#import <mbgl/map/view.hpp> #import <mbgl/style/style.hpp> #import <mbgl/annotation/annotation.hpp> #import <mbgl/map/camera.hpp> @@ -275,7 +274,7 @@ public: _mbglThreadPool = mbgl::sharedThreadPool(); auto renderer = std::make_unique<mbgl::Renderer>(*_mbglView, [NSScreen mainScreen].backingScaleFactor, *mbglFileSource, *_mbglThreadPool, mbgl::GLContextMode::Unique); - _rendererFrontend = std::make_unique<MGLRenderFrontend>(std::move(renderer), self, *_mbglView, *_mbglView, true); + _rendererFrontend = std::make_unique<MGLRenderFrontend>(std::move(renderer), self, *_mbglView, true); _mbglMap = new mbgl::Map(*_rendererFrontend, *_mbglView, self.size, [NSScreen mainScreen].backingScaleFactor, *mbglFileSource, *_mbglThreadPool, mbgl::MapMode::Continuous, mbgl::ConstrainMode::None, mbgl::ViewportMode::Default); // Install the OpenGL layer. Interface Builder’s synchronous drawing means @@ -2763,7 +2762,7 @@ public: } /// Adapter responsible for bridging calls from mbgl to MGLMapView and Cocoa. -class MGLMapViewImpl : public mbgl::View, public mbgl::RendererBackend, public mbgl::MapObserver { +class MGLMapViewImpl : public mbgl::RendererBackend, public mbgl::MapObserver { public: MGLMapViewImpl(MGLMapView *nativeView_) : nativeView(nativeView_) {} diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index 6faffb5ffb..eeb0bece12 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -1502,7 +1502,6 @@ QMapboxGLPrivate::QMapboxGLPrivate(QMapboxGL *q, const QMapboxGLSettings &settin frontend = std::make_unique<QMapboxGLRendererFrontend>( std::make_unique<mbgl::Renderer>(*this, pixelRatio, *fileSourceObj, *threadPool, static_cast<mbgl::GLContextMode>(settings.contextMode())), - *this, *this); connect(frontend.get(), SIGNAL(updated()), this, SLOT(invalidate())); diff --git a/platform/qt/src/qmapboxgl_p.hpp b/platform/qt/src/qmapboxgl_p.hpp index 0fa9f6e8e4..7b0dd8c192 100644 --- a/platform/qt/src/qmapboxgl_p.hpp +++ b/platform/qt/src/qmapboxgl_p.hpp @@ -4,7 +4,6 @@ #include "qmapboxgl_renderer_frontend_p.hpp" #include <mbgl/map/map.hpp> -#include <mbgl/map/view.hpp> #include <mbgl/renderer/renderer_backend.hpp> #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/storage/default_file_source.hpp> @@ -13,7 +12,7 @@ #include <QObject> #include <QSize> -class QMapboxGLPrivate : public QObject, public mbgl::View, public mbgl::RendererBackend, public mbgl::MapObserver +class QMapboxGLPrivate : public QObject, public mbgl::RendererBackend, public mbgl::MapObserver { Q_OBJECT @@ -23,11 +22,8 @@ public: mbgl::Size framebufferSize() const; - - // mbgl::View implementation. - void bind() final; - // mbgl::RendererBackend implementation. + void bind() final; void updateAssumedState() final; void activate() final {} void deactivate() final {} diff --git a/platform/qt/src/qmapboxgl_renderer_frontend_p.cpp b/platform/qt/src/qmapboxgl_renderer_frontend_p.cpp index d7d9e9c7b7..ea60851eb4 100644 --- a/platform/qt/src/qmapboxgl_renderer_frontend_p.cpp +++ b/platform/qt/src/qmapboxgl_renderer_frontend_p.cpp @@ -3,10 +3,9 @@ #include <mbgl/renderer/backend_scope.hpp> #include <mbgl/renderer/renderer.hpp> -QMapboxGLRendererFrontend::QMapboxGLRendererFrontend(std::unique_ptr<mbgl::Renderer> renderer_, mbgl::RendererBackend& backend_, mbgl::View& view_) +QMapboxGLRendererFrontend::QMapboxGLRendererFrontend(std::unique_ptr<mbgl::Renderer> renderer_, mbgl::RendererBackend& backend_) : renderer(std::move(renderer_)) - , backend(backend_) - , view(view_) { + , backend(backend_) { } QMapboxGLRendererFrontend::~QMapboxGLRendererFrontend() = default; @@ -34,5 +33,5 @@ void QMapboxGLRendererFrontend::render() { // The OpenGL implementation automatically enables the OpenGL context for us. mbgl::BackendScope scope { backend, mbgl::BackendScope::ScopeType::Implicit }; - renderer->render(view, *updateParameters); + renderer->render(*updateParameters); } diff --git a/platform/qt/src/qmapboxgl_renderer_frontend_p.hpp b/platform/qt/src/qmapboxgl_renderer_frontend_p.hpp index d7e414e5f9..c5e2bacc34 100644 --- a/platform/qt/src/qmapboxgl_renderer_frontend_p.hpp +++ b/platform/qt/src/qmapboxgl_renderer_frontend_p.hpp @@ -6,7 +6,6 @@ #include <QObject> namespace mbgl { - class View; class Renderer; } // namespace mbgl @@ -15,7 +14,7 @@ class QMapboxGLRendererFrontend : public QObject, public mbgl::RendererFrontend Q_OBJECT public: - explicit QMapboxGLRendererFrontend(std::unique_ptr<mbgl::Renderer>, mbgl::RendererBackend&, mbgl::View&); + explicit QMapboxGLRendererFrontend(std::unique_ptr<mbgl::Renderer>, mbgl::RendererBackend&); ~QMapboxGLRendererFrontend() override; void reset() override; @@ -32,6 +31,5 @@ signals: private: std::unique_ptr<mbgl::Renderer> renderer; mbgl::RendererBackend& backend; - mbgl::View& view; std::shared_ptr<mbgl::UpdateParameters> updateParameters; }; |