summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-02-01 15:12:10 -0500
committerKonstantin Käfer <mail@kkaefer.com>2018-05-24 10:48:43 +0200
commit7ff62fa6537b30d1bc333e18be87dd23c77faf59 (patch)
treea51fd3d6c919faa4b80041347ff0f468e21bb860
parent0212fd385cd991ef37c0efe0c1210948fd4d36fc (diff)
downloadqtlocation-mapboxgl-upstream/wrap-gl-functions.tar.gz
[core] wrap glGetString in `MBGL_CHECK_ERROR` tooupstream/wrap-gl-functions
-rw-r--r--src/mbgl/gl/context.cpp4
-rw-r--r--test/api/custom_layer.test.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index c6352d3e84..4afbe5af1e 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -287,7 +287,7 @@ UniqueTexture Context::createTexture() {
bool Context::supportsVertexArrays() const {
static bool blacklisted = []() {
- const std::string renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
+ const std::string renderer = reinterpret_cast<const char*>(MBGL_CHECK_ERROR(glGetString(GL_RENDERER)));
Log::Info(Event::General, "GPU Identifier: %s", renderer.c_str());
@@ -318,7 +318,7 @@ bool Context::supportsProgramBinaries() const {
// https://chromium.googlesource.com/chromium/src/gpu/+/master/config/gpu_driver_bug_list.json#2316
// Blacklist Vivante GC4000 due to bugs when linking loaded programs:
// https://github.com/mapbox/mapbox-gl-native/issues/10704
- const std::string renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
+ const std::string renderer = reinterpret_cast<const char*>(MBGL_CHECK_ERROR(glGetString(GL_RENDERER)));
if (renderer.find("Adreno (TM) 3") != std::string::npos
|| renderer.find("Adreno (TM) 4") != std::string::npos
|| renderer.find("Adreno (TM) 5") != std::string::npos
diff --git a/test/api/custom_layer.test.cpp b/test/api/custom_layer.test.cpp
index 6cb148a349..a94cf122bf 100644
--- a/test/api/custom_layer.test.cpp
+++ b/test/api/custom_layer.test.cpp
@@ -48,7 +48,7 @@ public:
MBGL_CHECK_ERROR(glCompileShader(fragmentShader));
MBGL_CHECK_ERROR(glAttachShader(program, fragmentShader));
MBGL_CHECK_ERROR(glLinkProgram(program));
- a_pos = glGetAttribLocation(program, "a_pos");
+ a_pos = MBGL_CHECK_ERROR(glGetAttribLocation(program, "a_pos"));
GLfloat triangle[] = { 0, 0.5, 0.5, -0.5, -0.5, -0.5 };
MBGL_CHECK_ERROR(glGenBuffers(1, &buffer));