summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-08-22 12:57:11 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-08-22 12:57:11 +0300
commit1c633072fcea7ad153ab6f8ec40dd72d83541ead (patch)
treefa90c930a58672fa48bf46840f6b88ec645864f0 /include
parentc53896caefc96a8c18ab746026330ddc4fc0338e (diff)
downloadqtlocation-mapboxgl-1c633072fcea7ad153ab6f8ec40dd72d83541ead.tar.gz
Bump Mapbox GL Native
mapbox-gl-native @ bd15e273dce767458d335aeb1f50aa081390d593
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/actor/scheduler.hpp15
-rw-r--r--include/mbgl/style/style.hpp6
-rw-r--r--include/mbgl/util/constants.hpp4
-rw-r--r--include/mbgl/util/run_loop.hpp12
-rw-r--r--include/mbgl/util/tileset.hpp3
5 files changed, 22 insertions, 18 deletions
diff --git a/include/mbgl/actor/scheduler.hpp b/include/mbgl/actor/scheduler.hpp
index 83689c3348..d8a26ebeab 100644
--- a/include/mbgl/actor/scheduler.hpp
+++ b/include/mbgl/actor/scheduler.hpp
@@ -21,18 +21,21 @@ class Mailbox;
Subject to these constraints, processing can happen on whatever thread in the
pool is available.
- * `RunLoop` is a `Scheduler` that is typically used to create a mailbox and
- `ActorRef` for an object that lives on the main thread and is not itself wrapped
- as an `Actor`:
-
- auto mailbox = std::make_shared<Mailbox>(*util::RunLoop::Get());
+ * `Scheduler::GetCurrent()` is typically used to create a mailbox and `ActorRef`
+ for an object that lives on the main thread and is not itself wrapped an
+ `Actor`. The underlying implementation of this Scheduler should usually be
+ a `RunLoop`
+ auto mailbox = std::make_shared<Mailbox>(*Scheduler::Get());
Actor<Worker> worker(threadPool, ActorRef<Foo>(*this, mailbox));
*/
-
class Scheduler {
public:
virtual ~Scheduler() = default;
virtual void schedule(std::weak_ptr<Mailbox>) = 0;
+
+ // Set/Get the current Scheduler for this thread
+ static Scheduler* GetCurrent();
+ static void SetCurrent(Scheduler*);
};
} // namespace mbgl
diff --git a/include/mbgl/style/style.hpp b/include/mbgl/style/style.hpp
index cb84922b4d..d6fdbd8f2c 100644
--- a/include/mbgl/style/style.hpp
+++ b/include/mbgl/style/style.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/style/transition_options.hpp>
+#include <mbgl/map/camera.hpp>
#include <mbgl/util/geo.hpp>
#include <string>
@@ -32,10 +33,7 @@ public:
// Defaults
std::string getName() const;
- LatLng getDefaultLatLng() const;
- double getDefaultZoom() const;
- double getDefaultBearing() const;
- double getDefaultPitch() const;
+ CameraOptions getDefaultCamera() const;
// TransitionOptions
TransitionOptions getTransitionOptions() const;
diff --git a/include/mbgl/util/constants.hpp b/include/mbgl/util/constants.hpp
index c2250c6f2e..eb5c201793 100644
--- a/include/mbgl/util/constants.hpp
+++ b/include/mbgl/util/constants.hpp
@@ -19,7 +19,8 @@ constexpr float tileSize = 512;
*
* Positions are stored as signed 16bit integers.
* One bit is lost for signedness to support features extending past the left edge of the tile.
- * One bit is lost because the line vertex buffer packs 1 bit of other data into the int.
+ * One bit is lost because the line vertex buffer used to pack 1 bit of other data into the int.
+ * This is no longer the case but we're reserving this bit anyway.
* One bit is lost to support features extending past the extent on the right edge of the tile.
* This leaves us with 2^13 = 8192
*/
@@ -37,6 +38,7 @@ constexpr double MIN_ZOOM = 0.0;
constexpr double MAX_ZOOM = 25.5;
constexpr float MIN_ZOOM_F = MIN_ZOOM;
constexpr float MAX_ZOOM_F = MAX_ZOOM;
+constexpr uint8_t DEFAULT_MAX_ZOOM = 22;
constexpr uint8_t DEFAULT_PREFETCH_ZOOM_DELTA = 4;
diff --git a/include/mbgl/util/run_loop.hpp b/include/mbgl/util/run_loop.hpp
index 14352ca823..acbea80273 100644
--- a/include/mbgl/util/run_loop.hpp
+++ b/include/mbgl/util/run_loop.hpp
@@ -62,6 +62,12 @@ public:
push(task);
return std::make_unique<WorkRequest>(task);
}
+
+ void schedule(std::weak_ptr<Mailbox> mailbox) override {
+ invoke([mailbox] () {
+ Mailbox::maybeReceive(mailbox);
+ });
+ }
class Impl;
@@ -72,12 +78,6 @@ private:
void push(std::shared_ptr<WorkTask>);
- void schedule(std::weak_ptr<Mailbox> mailbox) override {
- invoke([mailbox] () {
- Mailbox::maybeReceive(mailbox);
- });
- }
-
void withMutex(std::function<void()>&& fn) {
std::lock_guard<std::mutex> lock(mutex);
fn();
diff --git a/include/mbgl/util/tileset.hpp b/include/mbgl/util/tileset.hpp
index 2fa19d3f53..61aa47d4ea 100644
--- a/include/mbgl/util/tileset.hpp
+++ b/include/mbgl/util/tileset.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/util/range.hpp>
+#include <mbgl/util/constants.hpp>
#include <vector>
#include <string>
@@ -18,7 +19,7 @@ public:
Scheme scheme;
Tileset(std::vector<std::string> tiles_ = std::vector<std::string>(),
- Range<uint8_t> zoomRange_ = { 0, 22 },
+ Range<uint8_t> zoomRange_ = { 0, util::DEFAULT_MAX_ZOOM },
std::string attribution_ = {},
Scheme scheme_ = Scheme::XYZ)
: tiles(std::move(tiles_)),