summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2018-05-17 14:54:18 -0400
committerAnsis Brammanis <ansis@mapbox.com>2018-05-17 14:54:18 -0400
commitfc8f33bb3ae66c1e4da7d5db0fd1a38938a0de0b (patch)
tree1f9bc6865422f75a3130d3ec6cb495d5e1006faa
parent50c50e194d4e4f65c617dbb846c1b93ab638817c (diff)
downloadqtlocation-mapboxgl-upstream/port-antimeridian-fix-debug.tar.gz
add debug code for antimeridian flickerupstream/port-antimeridian-fix-debug
-rw-r--r--platform/glfw/glfw_view.cpp10
-rw-r--r--platform/glfw/glfw_view.hpp1
2 files changed, 11 insertions, 0 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index 362269b8e4..3eb895b8e7 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -54,6 +54,8 @@ GLFWView::GLFWView(bool fullscreen_, bool benchmark_)
width = videoMode->width;
height = videoMode->height;
}
+ width = 800;
+ height = 500;
glfwWindowHint(GLFW_COCOA_GRAPHICS_SWITCHING, GL_TRUE);
@@ -525,6 +527,14 @@ void GLFWView::run() {
}
glfwPollEvents();
+ auto *view = reinterpret_cast<GLFWView *>(glfwGetWindowUserPointer(window));
+ if ((frameCount / 30) % 2 == 0) {
+ view->map->setLatLng(mbgl::LatLng(0, 170));
+ } else {
+ view->map->setLatLng(mbgl::LatLng(0, -170));
+ }
+
+ frameCount++;
if (dirty && rendererFrontend) {
dirty = false;
diff --git a/platform/glfw/glfw_view.hpp b/platform/glfw/glfw_view.hpp
index d5acf697f7..20c584ee2f 100644
--- a/platform/glfw/glfw_view.hpp
+++ b/platform/glfw/glfw_view.hpp
@@ -107,6 +107,7 @@ private:
int frames = 0;
float frameTime = 0;
double lastReported = 0;
+ int frameCount = 0;
int width = 1024;
int height = 768;