summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2015-10-20 10:47:24 -0700
committerBruno de Oliveira Abinader <bruno@mapbox.com>2015-10-22 16:02:39 -0700
commit5fa144647d83316a20e861c08fd5b6179312ad08 (patch)
tree1c27221ee02e1f9fb257e3998e52c6c9e898d472 /test
parent7a51a53cac2bb283eb82a5f7835adaa05bbc7b1e (diff)
downloadqtlocation-mapboxgl-5fa144647d83316a20e861c08fd5b6179312ad08.tar.gz
[core] Added GLContextMode to MapData
Adding new mbgl::GLContextMode enum to mbgl::Map ctor, which gets stored in MapData. In shared GL context environments, we cannot assume that the GL state that has been left since the last draw is the same, so we reset the GL configurations to their default values.
Diffstat (limited to 'test')
-rw-r--r--test/miscellaneous/map_context.cpp2
-rw-r--r--test/miscellaneous/style_parser.cpp3
-rw-r--r--test/style/resource_loading.cpp2
3 files changed, 4 insertions, 3 deletions
diff --git a/test/miscellaneous/map_context.cpp b/test/miscellaneous/map_context.cpp
index ec88862f05..fac21ee959 100644
--- a/test/miscellaneous/map_context.cpp
+++ b/test/miscellaneous/map_context.cpp
@@ -13,7 +13,7 @@ TEST(MapContext, DoubleStyleLoad) {
std::shared_ptr<HeadlessDisplay> display = std::make_shared<HeadlessDisplay>();
HeadlessView view(display, 1, 512, 512);
DefaultFileSource fileSource(nullptr);
- MapData data(MapMode::Continuous, view.getPixelRatio());
+ MapData data(MapMode::Continuous, GLContextMode::Unique, view.getPixelRatio());
util::Thread<MapContext> context({"Map", util::ThreadType::Map, util::ThreadPriority::Regular}, view, fileSource, data);
diff --git a/test/miscellaneous/style_parser.cpp b/test/miscellaneous/style_parser.cpp
index e88d798411..cbb896bac4 100644
--- a/test/miscellaneous/style_parser.cpp
+++ b/test/miscellaneous/style_parser.cpp
@@ -39,9 +39,10 @@ TEST_P(StyleParserTest, ParseStyle) {
Log::setObserver(std::unique_ptr<Log::Observer>(observer));
MapMode mapMode = MapMode::Continuous;
+ GLContextMode contextMode = GLContextMode::Unique;
const float pixelRatio = 1.0f;
- MapData data(mapMode, pixelRatio);
+ MapData data(mapMode, contextMode, pixelRatio);
StyleParser parser(data);
parser.parse(styleDoc);
diff --git a/test/style/resource_loading.cpp b/test/style/resource_loading.cpp
index d4cb929196..e0c4590c7c 100644
--- a/test/style/resource_loading.cpp
+++ b/test/style/resource_loading.cpp
@@ -23,7 +23,7 @@ public:
MockMapContext(View& view,
FileSource& fileSource,
const std::function<void(std::exception_ptr error)>& callback)
- : data_(MapMode::Still, view.getPixelRatio()),
+ : data_(MapMode::Still, GLContextMode::Unique, view.getPixelRatio()),
transform_(view),
callback_(callback) {
util::ThreadContext::setFileSource(&fileSource);