summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-02-08 15:57:58 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-02-10 18:04:45 -0600
commit0bbc6b814cbec44be7026a0bac83d56e4d71a287 (patch)
treea35b1729e934cccc0b8f537c2618d16c125ddb3e /test
parent0b3873c7b55699117d0c61891c32c69baf196c14 (diff)
downloadqtlocation-mapboxgl-0bbc6b814cbec44be7026a0bac83d56e4d71a287.tar.gz
[core] Restore support for GL implementations without VAO extension
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/map/no_vao/expected.pngbin0 -> 9832 bytes
-rw-r--r--test/map/map.test.cpp19
2 files changed, 19 insertions, 0 deletions
diff --git a/test/fixtures/map/no_vao/expected.png b/test/fixtures/map/no_vao/expected.png
new file mode 100644
index 0000000000..d5b7c42762
--- /dev/null
+++ b/test/fixtures/map/no_vao/expected.png
Binary files differ
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index fd3bfe58d7..aec181e058 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -6,6 +6,7 @@
#include <mbgl/map/map.hpp>
#include <mbgl/gl/headless_backend.hpp>
#include <mbgl/gl/offscreen_view.hpp>
+#include <mbgl/gl/context.hpp>
#include <mbgl/util/default_thread_pool.hpp>
#include <mbgl/sprite/sprite_image.hpp>
#include <mbgl/storage/network_status.hpp>
@@ -305,6 +306,24 @@ TEST(Map, AddLayer) {
test::checkImage("test/fixtures/map/add_layer", test::render(map, test.view));
}
+TEST(Map, WithoutVAOExtension) {
+ MapTest test;
+
+ test.backend.getContext().disableVAOExtension = true;
+
+#ifdef MBGL_ASSET_ZIP
+ // Regenerate with `cd test/fixtures/api/ && zip -r assets.zip assets/`
+ DefaultFileSource fileSource(":memory:", "test/fixtures/api/assets.zip");
+#else
+ DefaultFileSource fileSource(":memory:", "test/fixtures/api/assets");
+#endif
+
+ Map map(test.backend, test.view.size, 1, fileSource, test.threadPool, MapMode::Still);
+ map.setStyleJSON(util::read_file("test/fixtures/api/water.json"));
+
+ test::checkImage("test/fixtures/map/no_vao", test::render(map, test.view), 0.002);
+}
+
TEST(Map, RemoveLayer) {
MapTest test;