diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-11-26 22:38:14 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-11-27 17:47:02 +0200 |
commit | 1f0820c8e82810fb957cb1cd17fb4327debfc0e5 (patch) | |
tree | 976533b4a2b03ab033143ebcd013199222c7a9ca /include/mbgl/map | |
parent | 044e92f5e8ff2049702aa9ff6bbf4eecf9d86fa7 (diff) | |
download | qtlocation-mapboxgl-1f0820c8e82810fb957cb1cd17fb4327debfc0e5.tar.gz |
[core] Added MapDebugOptions
Map debug options are now cycled up to all debug options enabled, then
back to none.
Diffstat (limited to 'include/mbgl/map')
-rw-r--r-- | include/mbgl/map/map.hpp | 7 | ||||
-rw-r--r-- | include/mbgl/map/mode.hpp | 28 |
2 files changed, 29 insertions, 6 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 35895660f2..43c3b1452e 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -168,12 +168,13 @@ public: void onLowMemory(); // Debug - void setDebug(bool value); - void toggleDebug(); - bool getDebug() const; + void setDebug(MapDebugOptions); + void cycleDebugOptions(); + MapDebugOptions getDebug() const; void setCollisionDebug(bool value); void toggleCollisionDebug(); bool getCollisionDebug() const; + bool isFullyLoaded() const; void dumpDebugLogs() const; diff --git a/include/mbgl/map/mode.hpp b/include/mbgl/map/mode.hpp index 8b65baf99f..0fe2c46dd8 100644 --- a/include/mbgl/map/mode.hpp +++ b/include/mbgl/map/mode.hpp @@ -5,7 +5,9 @@ namespace mbgl { -enum class MapMode : uint8_t { +using EnumType = uint32_t; + +enum class MapMode : EnumType { Continuous, // continually updating map Still, // a once-off still image }; @@ -14,18 +16,38 @@ enum class MapMode : uint8_t { // being shared. In a shared GL context case, we need to make sure that the // correct GL configurations are in use - they might have changed between render // calls. -enum class GLContextMode : uint8_t { +enum class GLContextMode : EnumType { Unique, Shared, }; // We can choose to constrain the map both horizontally or vertically, or only // vertically e.g. while panning. -enum class ConstrainMode : uint8_t { +enum class ConstrainMode : EnumType { HeightOnly, WidthAndHeight, }; +enum class MapDebugOptions : EnumType { + NoDebug = 0, + TileBorders = 1 << 1, + ParseStatus = 1 << 2, + Timestamps = 1 << 3, +}; + +inline MapDebugOptions operator| (const MapDebugOptions& lhs, const MapDebugOptions& rhs) { + return MapDebugOptions(static_cast<EnumType>(lhs) | static_cast<EnumType>(rhs)); +} + +inline MapDebugOptions& operator|=(MapDebugOptions& lhs, const MapDebugOptions& rhs) { + lhs = lhs | rhs; + return lhs; +} + +inline bool operator& (const MapDebugOptions& lhs, const MapDebugOptions& rhs) { + return static_cast<EnumType>(lhs) & static_cast<EnumType>(rhs); +} + } // namespace mbgl #endif // MBGL_MAP_MODE |