From f49a9ca1de70c8249738ca42ab1c8c86fecf1623 Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Thu, 20 Sep 2018 09:40:18 +0300 Subject: [core] Don't log GL renderer string on every context initialization Commit 1c53dc9ca8d9 ([core] Refactor vertex array object extension initialization) changed where the GL renderer string is checked in order to prevent the vertex array extension initialization in certain platforms and in doing so made the logging of that string more frequent, once per context initialization instead of at most once per process. This is a lot more verbose, specially when running unit tests, so make sure that string is logged at most once as it was previously. --- src/mbgl/gl/context.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index cf7b80741f..18ab38e684 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -124,8 +124,11 @@ void Context::initializeExtensions(const std::function(MBGL_CHECK_ERROR(glGetString(GL_RENDERER))); - Log::Info(Event::General, "GPU Identifier: %s", renderer.c_str()); + static const std::string renderer = []() { + std::string r = reinterpret_cast(MBGL_CHECK_ERROR(glGetString(GL_RENDERER))); + Log::Info(Event::General, "GPU Identifier: %s", r.c_str()); + return r; + }(); // Block ANGLE on Direct3D since the debugging extension is causing crashes if (!(renderer.find("ANGLE") != std::string::npos -- cgit v1.2.1