summaryrefslogtreecommitdiff
path: root/include/mbgl/map
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/map')
-rw-r--r--include/mbgl/map/backend.hpp9
-rw-r--r--include/mbgl/map/map.hpp25
-rw-r--r--include/mbgl/map/query.hpp43
3 files changed, 8 insertions, 69 deletions
diff --git a/include/mbgl/map/backend.hpp b/include/mbgl/map/backend.hpp
index 434f68779c..3347086571 100644
--- a/include/mbgl/map/backend.hpp
+++ b/include/mbgl/map/backend.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/map/view.hpp>
+#include <mbgl/map/backend_scope.hpp>
#include <mbgl/util/image.hpp>
#include <mbgl/util/size.hpp>
@@ -15,8 +16,6 @@ using ProcAddress = void (*)();
using FramebufferID = uint32_t;
} // namespace gl
-class BackendScope;
-
class Backend {
public:
Backend();
@@ -28,9 +27,9 @@ public:
// Called prior to rendering to update the internally assumed OpenGL state.
virtual void updateAssumedState() = 0;
- // Called when the map needs to be rendered; the backend should call Map::render() at some point
- // in the near future. (Not called for Map::renderStill() mode.)
- virtual void invalidate() = 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
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 22ac100c40..14f42d7fd5 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -4,13 +4,10 @@
#include <mbgl/util/chrono.hpp>
#include <mbgl/map/map_observer.hpp>
#include <mbgl/map/mode.hpp>
-#include <mbgl/util/geo.hpp>
-#include <mbgl/util/feature.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/size.hpp>
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/map/camera.hpp>
-#include <mbgl/map/query.hpp>
#include <cstdint>
#include <string>
@@ -24,6 +21,7 @@ class Backend;
class View;
class FileSource;
class Scheduler;
+class RendererFrontend;
namespace style {
class Image;
@@ -32,30 +30,25 @@ class Style;
class Map : private util::noncopyable {
public:
- explicit Map(Backend&,
+ explicit Map(RendererFrontend&,
MapObserver&,
Size size,
float pixelRatio,
FileSource&,
Scheduler&,
MapMode mapMode = MapMode::Continuous,
- GLContextMode contextMode = GLContextMode::Unique,
ConstrainMode constrainMode = ConstrainMode::HeightOnly,
- ViewportMode viewportMode = ViewportMode::Default,
- optional<std::string> programCacheDir = optional<std::string>());
+ ViewportMode viewportMode = ViewportMode::Default);
~Map();
// Register a callback that will get called (on the render thread) when all resources have
// been loaded and a complete render occurs.
using StillImageCallback = std::function<void (std::exception_ptr)>;
- void renderStill(View&, StillImageCallback callback);
+ void renderStill(StillImageCallback callback);
// Triggers a repaint.
void triggerRepaint();
- // Main render function.
- void render(View&);
-
style::Style& getStyle();
const style::Style& getStyle() const;
@@ -150,13 +143,6 @@ public:
void updateAnnotation(AnnotationID, const Annotation&);
void removeAnnotation(AnnotationID);
- // Feature queries
- std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const RenderedQueryOptions& options = {});
- std::vector<Feature> queryRenderedFeatures(const ScreenBox&, const RenderedQueryOptions& options = {});
- std::vector<Feature> querySourceFeatures(const std::string& sourceID, const SourceQueryOptions& options = {});
-
- AnnotationIDs queryPointAnnotations(const ScreenBox&);
-
// Tile prefetching
//
// When loading a map, if `PrefetchZoomDelta` is set to any number greater than 0, the map will
@@ -166,9 +152,6 @@ public:
void setPrefetchZoomDelta(uint8_t delta);
uint8_t getPrefetchZoomDelta() const;
- // Memory
- void onLowMemory();
-
// Debug
void setDebug(MapDebugOptions);
void cycleDebugOptions();
diff --git a/include/mbgl/map/query.hpp b/include/mbgl/map/query.hpp
deleted file mode 100644
index b9d5f21a44..0000000000
--- a/include/mbgl/map/query.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#pragma once
-
-#include <mbgl/util/optional.hpp>
-#include <mbgl/style/filter.hpp>
-
-#include <string>
-#include <vector>
-
-namespace mbgl {
-
-/**
- * Options for query rendered features.
- */
-class RenderedQueryOptions {
-public:
- RenderedQueryOptions(optional<std::vector<std::string>> layerIDs_ = optional<std::vector<std::string>>(),
- optional<style::Filter> filter_ = optional<style::Filter>())
- : layerIDs(std::move(layerIDs_)),
- filter(std::move(filter_)) {}
-
- /** layerIDs to include in the query */
- optional<std::vector<std::string>> layerIDs;
-
- optional<style::Filter> filter;
-};
-
-/**
- * Options for query source features
- */
-class SourceQueryOptions {
-public:
- SourceQueryOptions(optional<std::vector<std::string>> sourceLayers_ = optional<std::vector<std::string>> (),
- optional<style::Filter> filter_ = optional<style::Filter>())
- : sourceLayers(std::move(sourceLayers_)),
- filter(std::move(filter_)) {}
-
- // Required for VectorSource, ignored for GeoJSONSource
- optional<std::vector<std::string>> sourceLayers;
-
- optional<style::Filter> filter;
-};
-
-} // namespace mbgl