diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-06-26 08:50:49 -0700 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-06-26 16:19:06 -0700 |
commit | 24a00231f3f6cf119e3e7e349d1b43ff36750ca9 (patch) | |
tree | c210eec15bbfdc2f389416da6dc5e3847fb668ed | |
parent | 150fc6b643e0f10d2fb98d056ee4ea6a159596fb (diff) | |
download | qtlocation-mapboxgl-24a00231f3f6cf119e3e7e349d1b43ff36750ca9.tar.gz |
[core] fix render doesn’t flag style mutation
-rw-r--r-- | src/mbgl/map/map.cpp | 4 | ||||
-rw-r--r-- | test/map/map.test.cpp | 26 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 37442770fa..d52315d19c 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -238,8 +238,8 @@ void Map::Impl::render(View& view) { transform.getState(), style->impl->getGlyphURL(), style->impl->spriteLoaded, - style->getTransitionOptions(), - style->getLight()->impl, + style->impl->getTransitionOptions(), + style->impl->getLight()->impl, style->impl->getImageImpls(), style->impl->getSourceImpls(), style->impl->getLayerImpls(), diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index bed46f2c3e..a820590fb4 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -280,6 +280,32 @@ TEST(Map, StyleExpiredWithAnnotations) { EXPECT_EQ(1u, fileSource.requests.size()); } +TEST(Map, StyleExpiredWithRender) { + // Rendering should not prevent revalidation of an expired style. + + using namespace std::chrono_literals; + + MapTest test; + FakeFileSource fileSource; + + Map map(test.backend, test.view.getSize(), 1, fileSource, test.threadPool, MapMode::Still); + map.getStyle().loadURL("mapbox://styles/test"); + EXPECT_EQ(1u, fileSource.requests.size()); + + Response response; + response.data = std::make_shared<std::string>(util::read_file("test/fixtures/api/empty.json")); + response.expires = util::now() - 1h; + + fileSource.respond(Resource::Style, response); + EXPECT_EQ(1u, fileSource.requests.size()); + + map.render(test.view); + EXPECT_EQ(1u, fileSource.requests.size()); + + fileSource.respond(Resource::Style, response); + EXPECT_EQ(1u, fileSource.requests.size()); +} + TEST(Map, StyleEarlyMutation) { // An early mutation should not prevent the initial style load. |