summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2015-01-13 19:48:26 +1100
committerLeith Bade <leith@mapbox.com>2015-01-13 19:48:26 +1100
commit7cce089d7809d2e3c64c8119969771e151a4add9 (patch)
treecc6d0505bfcbc622290b69a007d92c93b399b372
parentaa955171d70f1fddc1e4531b9df32a3cfd5caf93 (diff)
parentf20a17a2919fffc4baa9dadc294c3ebb4459a2ff (diff)
downloadqtlocation-mapboxgl-7cce089d7809d2e3c64c8119969771e151a4add9.tar.gz
Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
-rw-r--r--platform/default/glfw_view.cpp16
-rw-r--r--src/mbgl/util/token.hpp4
2 files changed, 8 insertions, 12 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp
index 295e106621..1118bc23a7 100644
--- a/platform/default/glfw_view.cpp
+++ b/platform/default/glfw_view.cpp
@@ -58,13 +58,11 @@ void GLFWView::initialize(mbgl::Map *map_) {
glfwSetWindowUserPointer(window, this);
glfwMakeContextCurrent(window);
+ glfwSwapInterval(1);
int width, height;
glfwGetWindowSize(window, &width, &height);
- int fbWidth, fbHeight;
- glfwGetFramebufferSize(window, &fbWidth, &fbHeight);
-
- resize(window, 0, 0);
+ resize(window, width, height);
glfwSetCursorPosCallback(window, mouseMove);
glfwSetMouseButtonCallback(window, mouseClick);
@@ -281,12 +279,6 @@ int GLFWView::run() {
map->start();
while (!glfwWindowShouldClose(window)) {
- if (map->needsSwap()) {
- glfwSwapBuffers(window);
- map->swapped();
- fps();
- }
-
glfwWaitEvents();
}
@@ -310,7 +302,9 @@ void GLFWView::notify() {
}
void GLFWView::swap() {
- glfwPostEmptyEvent();
+ glfwSwapBuffers(window);
+ map->swapped();
+ fps();
}
void GLFWView::notifyMapChange(mbgl::MapChange /*change*/, mbgl::timestamp /*delay*/) {
diff --git a/src/mbgl/util/token.hpp b/src/mbgl/util/token.hpp
index 64192a99f9..455190aabf 100644
--- a/src/mbgl/util/token.hpp
+++ b/src/mbgl/util/token.hpp
@@ -8,6 +8,8 @@
namespace mbgl {
namespace util {
+const static std::string tokenReservedChars = "{}()[]<>$=:;.,^";
+
// Replaces {tokens} in a string by calling the lookup function.
template <typename Lookup>
std::string replaceTokens(const std::string &source, const Lookup &lookup) {
@@ -22,7 +24,7 @@ std::string replaceTokens(const std::string &source, const Lookup &lookup) {
result.append(pos, brace);
pos = brace;
if (pos != end) {
- for (brace++; brace != end && (std::isalnum(*brace) || *brace == '_'); brace++);
+ for (brace++; brace != end && tokenReservedChars.find(*brace) == std::string::npos; brace++);
if (brace != end && *brace == '}') {
result.append(lookup({ pos + 1, brace }));
pos = brace + 1;