diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-12-04 09:46:50 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-12-04 11:50:05 +0200 |
commit | 1e2cd1e086c3053f1cea075d7641b7f56cc7dfbf (patch) | |
tree | 4a27d48c36aff4f9532e9ab66d7444aabec6ad25 /platform/glfw | |
parent | 27536631d01d623bb4a08c3e85f2a62a6d187a12 (diff) | |
download | qtlocation-mapboxgl-1e2cd1e086c3053f1cea075d7641b7f56cc7dfbf.tar.gz |
[core] Remove Map::cycleDebugOptions
Diffstat (limited to 'platform/glfw')
-rw-r--r-- | platform/glfw/glfw_view.cpp | 26 | ||||
-rw-r--r-- | platform/glfw/glfw_view.hpp | 1 |
2 files changed, 26 insertions, 1 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp index 9a2fefaade..74dda734c0 100644 --- a/platform/glfw/glfw_view.cpp +++ b/platform/glfw/glfw_view.cpp @@ -180,7 +180,7 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action, glfwSetWindowShouldClose(window, true); break; case GLFW_KEY_TAB: - view->map->cycleDebugOptions(); + view->cycleDebugOptions(); break; case GLFW_KEY_X: if (!mods) @@ -496,6 +496,30 @@ void GLFWView::updateAnimatedAnnotations() { } } +void GLFWView::cycleDebugOptions() { + auto debug = map->getDebug(); +#if not MBGL_USE_GLES2 + if (debug & mbgl::MapDebugOptions::StencilClip) + debug = mbgl::MapDebugOptions::NoDebug; + else if (debug & mbgl::MapDebugOptions::Overdraw) + debug = mbgl::MapDebugOptions::StencilClip; +#else + if (debug & mbgl::MapDebugOptions::Overdraw) debug = mbgl::MapDebugOptions::NoDebug; +#endif // MBGL_USE_GLES2 + else if (debug & mbgl::MapDebugOptions::Collision) + debug = mbgl::MapDebugOptions::Overdraw; + else if (debug & mbgl::MapDebugOptions::Timestamps) + debug = debug | mbgl::MapDebugOptions::Collision; + else if (debug & mbgl::MapDebugOptions::ParseStatus) + debug = debug | mbgl::MapDebugOptions::Timestamps; + else if (debug & mbgl::MapDebugOptions::TileBorders) + debug = debug | mbgl::MapDebugOptions::ParseStatus; + else + debug = mbgl::MapDebugOptions::TileBorders; + + map->setDebug(debug); +} + void GLFWView::clearAnnotations() { for (const auto& id : annotationIDs) { map->removeAnnotation(id); diff --git a/platform/glfw/glfw_view.hpp b/platform/glfw/glfw_view.hpp index dbe6ceb046..9233bddfb9 100644 --- a/platform/glfw/glfw_view.hpp +++ b/platform/glfw/glfw_view.hpp @@ -88,6 +88,7 @@ private: void updateAnimatedAnnotations(); void toggleCustomSource(); + void cycleDebugOptions(); void clearAnnotations(); void popAnnotation(); |