diff options
author | Mike Morris <michael.patrick.morris@gmail.com> | 2015-08-25 14:40:40 -0400 |
---|---|---|
committer | Mike Morris <michael.patrick.morris@gmail.com> | 2015-08-25 14:40:40 -0400 |
commit | f251bcb3044f520258b662054f8011e50f4e7fbe (patch) | |
tree | 62d931865469ce446e64ec2bd99b7bb658622028 /platform | |
parent | 3fea9d38782f9c42a606206b1318f1e5508cf62a (diff) | |
parent | 4540c3c0e8c80de4f0074c1c4328840ebf708470 (diff) | |
download | qtlocation-mapboxgl-f251bcb3044f520258b662054f8011e50f4e7fbe.tar.gz |
Merge branch 'before-render' into node
Diffstat (limited to 'platform')
-rw-r--r-- | platform/default/default_styles.cpp | 10 | ||||
-rw-r--r-- | platform/default/glfw_view.cpp | 6 | ||||
-rw-r--r-- | platform/default/headless_view.cpp | 19 | ||||
-rw-r--r-- | platform/default/sqlite_cache.cpp | 2 | ||||
-rw-r--r-- | platform/ios/MGLMapView.mm | 18 |
5 files changed, 37 insertions, 18 deletions
diff --git a/platform/default/default_styles.cpp b/platform/default/default_styles.cpp index e25d96e4c9..9ee5414974 100644 --- a/platform/default/default_styles.cpp +++ b/platform/default/default_styles.cpp @@ -4,11 +4,11 @@ namespace mbgl { namespace util { const std::vector<std::pair<std::string, std::string>> defaultStyles = { - { "asset://styles/mapbox-streets-v7.json", "Mapbox Streets" }, - { "asset://styles/emerald-v7.json", "Emerald" }, - { "asset://styles/light-v7.json", "Light" }, - { "asset://styles/dark-v7.json", "Dark" }, - { "asset://styles/satellite-v7.json", "Satellite" } + { "asset://styles/streets-v8.json", "Mapbox Streets" }, + { "asset://styles/emerald-v8.json", "Emerald" }, + { "asset://styles/light-v8.json", "Light" }, + { "asset://styles/dark-v8.json", "Dark" }, + { "asset://styles/satellite-v8.json", "Satellite" } }; } // end namespace util diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 8453845d1e..19f3379947 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -386,7 +386,11 @@ void GLFWView::invalidate() { glfwPostEmptyEvent(); } -void GLFWView::swap() { +void GLFWView::beforeRender() { + // no-op +} + +void GLFWView::afterRender() { glfwSwapBuffers(window); } diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp index 2d65277850..a582ed579a 100644 --- a/platform/default/headless_view.cpp +++ b/platform/default/headless_view.cpp @@ -114,10 +114,10 @@ bool HeadlessView::isActive() { return std::this_thread::get_id() == thread; } -void HeadlessView::resize(const uint16_t width, const uint16_t height) { - activate(); +void HeadlessView::resizeFramebuffer() { + assert(isActive()); - dimensions = {{ width, height }}; + if (!needsResize) return; clearBuffers(); @@ -158,7 +158,12 @@ void HeadlessView::resize(const uint16_t width, const uint16_t height) { throw std::runtime_error(error); } - deactivate(); + needsResize = false; +} + +void HeadlessView::resize(const uint16_t width, const uint16_t height) { + dimensions = {{ width, height }}; + needsResize = true; } std::unique_ptr<StillImage> HeadlessView::readStillImage() { @@ -293,7 +298,11 @@ void HeadlessView::invalidate() { // no-op } -void HeadlessView::swap() { +void HeadlessView::beforeRender() { + resizeFramebuffer(); +} + +void HeadlessView::afterRender() { // no-op } diff --git a/platform/default/sqlite_cache.cpp b/platform/default/sqlite_cache.cpp index 775c2a68a1..9d5d0541e8 100644 --- a/platform/default/sqlite_cache.cpp +++ b/platform/default/sqlite_cache.cpp @@ -217,7 +217,7 @@ void SQLiteCache::Impl::put(const Resource& resource, std::shared_ptr<const Resp putStmt->bind(6 /* expires */, response->expires); std::string data; - if (resource.kind != Resource::Image) { + if (resource.kind != Resource::SpriteImage) { // Do not compress images, since they are typically compressed already. data = util::compress(response->data); } diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 391763b945..803cef9f5b 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -39,10 +39,11 @@ class MBGLView; -NSString *const MGLDefaultStyleName = @"mapbox-streets"; -NSString *const MGLStyleVersion = @"7"; +NSString *const MGLDefaultStyleName = @"streets"; NSString *const MGLDefaultStyleMarkerSymbolName = @"default_marker"; -NSString *const MGLMapboxSetupDocumentationURLDisplayString = @"mapbox.com/guides/first-steps-gl-ios"; +NSString *const MGLMapboxSetupDocumentationURLDisplayString = @"mapbox.com/guides/first-steps-ios-sdk"; + +NSUInteger const MGLStyleVersion = 8; const NSTimeInterval MGLAnimationDuration = 0.3; const CGSize MGLAnnotationUpdateViewportOutset = {150, 150}; @@ -190,9 +191,9 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) if ( ! styleURL) { - styleURL = MGLURLForBundledStyleNamed([NSString stringWithFormat:@"%@-v%@", + styleURL = MGLURLForBundledStyleNamed([NSString stringWithFormat:@"%@-v%lu", MGLDefaultStyleName.lowercaseString, - MGLStyleVersion]); + (unsigned long)MGLStyleVersion]); } if ( ! [styleURL scheme]) @@ -2942,7 +2943,12 @@ class MBGLView : public mbgl::View waitUntilDone:NO]; } - void swap() override + void beforeRender() override + { + // no-op + } + + void afterRender() override { // no-op } |