diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-06 16:15:27 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-18 01:26:22 +0200 |
commit | 8f96dea8220074059438e9d732d9ce89bddd7fd9 (patch) | |
tree | de2f72ef5189fb3fa6225260cddfbbd92b90a121 | |
parent | 15621b066c494a43502ccf3b0b7a0bea4920ac46 (diff) | |
download | qtlocation-mapboxgl-8f96dea8220074059438e9d732d9ce89bddd7fd9.tar.gz |
[core] Remove default transition duration
-rw-r--r-- | include/mbgl/map/map.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/map/update.hpp | 17 | ||||
-rw-r--r-- | src/mbgl/map/map.cpp | 9 | ||||
-rw-r--r-- | src/mbgl/map/map_context.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/map/map_data.hpp | 17 |
5 files changed, 10 insertions, 38 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 6edc7f6d2c..3de9dc8891 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -75,9 +75,6 @@ public: void setDefaultFadeDuration(const Duration&); Duration getDefaultFadeDuration() const; - void setDefaultTransitionDuration(const Duration&); - Duration getDefaultTransitionDuration() const; - void setStyleURL(const std::string& url); void setStyleJSON(const std::string& json, const std::string& base = ""); std::string getStyleURL() const; diff --git a/include/mbgl/map/update.hpp b/include/mbgl/map/update.hpp index dbabff5bff..e47feea949 100644 --- a/include/mbgl/map/update.hpp +++ b/include/mbgl/map/update.hpp @@ -5,19 +5,18 @@ namespace mbgl { -enum class Update : uint32_t { +enum class Update : uint8_t { Nothing = 0, Dimensions = 1 << 1, - DefaultTransition = 1 << 2, - Classes = 1 << 3, - RecalculateStyle = 1 << 4, - RenderStill = 1 << 5, - Repaint = 1 << 6, - Annotations = 1 << 7, + Classes = 1 << 2, + RecalculateStyle = 1 << 3, + RenderStill = 1 << 4, + Repaint = 1 << 5, + Annotations = 1 << 6, }; inline Update operator| (const Update& lhs, const Update& rhs) { - return Update(static_cast<uint32_t>(lhs) | static_cast<uint32_t>(rhs)); + return Update(static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs)); } inline Update& operator|=(Update& lhs, const Update& rhs) { @@ -26,7 +25,7 @@ inline Update& operator|=(Update& lhs, const Update& rhs) { } inline bool operator& (const Update& lhs, const Update& rhs) { - return static_cast<uint32_t>(lhs) & static_cast<uint32_t>(rhs); + return static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs); } } // namespace mbgl diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index f93d0120b1..b531643ed3 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -549,15 +549,6 @@ Duration Map::getDefaultFadeDuration() const { return data->getDefaultFadeDuration(); } -void Map::setDefaultTransitionDuration(const Duration& duration) { - data->setDefaultTransitionDuration(duration); - update(Update::DefaultTransition); -} - -Duration Map::getDefaultTransitionDuration() const { - return data->getDefaultTransitionDuration(); -} - void Map::setSourceTileCacheSize(size_t size) { context->invoke(&MapContext::setSourceTileCacheSize, size); } diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 93724ea745..b03218da1f 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -150,7 +150,7 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base) // created but before a style is loaded data.loading = true; - updateAsync(Update::DefaultTransition | Update::Classes | Update::RecalculateStyle | Update::Annotations); + updateAsync(Update::Classes | Update::RecalculateStyle | Update::Annotations); } void MapContext::update() { diff --git a/src/mbgl/map/map_data.hpp b/src/mbgl/map/map_data.hpp index 2aa52dd874..0c3c97ff7a 100644 --- a/src/mbgl/map/map_data.hpp +++ b/src/mbgl/map/map_data.hpp @@ -25,12 +25,10 @@ public: , pixelRatio(pixelRatio_) , annotationManager(pixelRatio) , animationTime(Duration::zero()) - , defaultFadeDuration(mode_ == MapMode::Continuous ? Milliseconds(300) : Duration::zero()) - , defaultTransitionDuration(Duration::zero()) { + , defaultFadeDuration(mode_ == MapMode::Continuous ? Milliseconds(300) : Duration::zero()) { assert(pixelRatio > 0); } - inline MapDebugOptions getDebug() const { return debugOptions; } @@ -77,18 +75,6 @@ public: defaultFadeDuration = duration; } - inline Duration getDefaultTransitionDuration() const { - return defaultTransitionDuration; - } - - inline void setDefaultTransitionDuration(const Duration& duration) { - if (mode == MapMode::Still) { - return; - } - - defaultTransitionDuration = duration; - } - util::exclusive<AnnotationManager> getAnnotationManager() { return util::exclusive<AnnotationManager>( &annotationManager, @@ -107,7 +93,6 @@ private: std::atomic<MapDebugOptions> debugOptions { MapDebugOptions::NoDebug }; std::atomic<Duration> animationTime; std::atomic<Duration> defaultFadeDuration; - std::atomic<Duration> defaultTransitionDuration; // TODO: make private public: |