From 7ff62fa6537b30d1bc333e18be87dd23c77faf59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 1 Feb 2018 15:12:10 -0500 Subject: [core] wrap glGetString in `MBGL_CHECK_ERROR` too --- src/mbgl/gl/context.cpp | 4 ++-- test/api/custom_layer.test.cpp | 2 +- 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(glGetString(GL_RENDERER)); + const std::string renderer = reinterpret_cast(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(glGetString(GL_RENDERER)); + const std::string renderer = reinterpret_cast(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)); -- cgit v1.2.1