From d30b820f3e39ee9892cf7e4a390a9b578b707af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 7 Nov 2022 20:55:21 +0100 Subject: [PATCH] GL: use StringIterable in Context::addDisabledWorkarounds(). No backwards compatibility include, as this is a pretty rarely used API. --- src/Magnum/GL/Context.cpp | 5 +---- src/Magnum/GL/Context.h | 10 ++-------- src/Magnum/GL/Implementation/driverSpecific.cpp | 5 +++-- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 58de84b38..281cf95b3 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -28,6 +28,7 @@ #include /* std::lower_bound() */ #include #include +#include #include #include #include /* CORRADE_THREAD_LOCAL */ @@ -1268,10 +1269,6 @@ Containers::ArrayView Context::Configuration::disabledExtension return _disabledExtensions; } -Context::Configuration& Context::Configuration::addDisabledWorkarounds(std::initializer_list workarounds) { - return addDisabledWorkarounds(Containers::arrayView(workarounds)); -} - Context::Configuration& Context::Configuration::addDisabledExtensions(Containers::ArrayView extensions) { arrayAppend(_disabledExtensions, extensions); return *this; diff --git a/src/Magnum/GL/Context.h b/src/Magnum/GL/Context.h index 862f771df..4f2d202e9 100644 --- a/src/Magnum/GL/Context.h +++ b/src/Magnum/GL/Context.h @@ -1113,9 +1113,7 @@ class MAGNUM_GL_EXPORT Context::Configuration { * Corresponds to the `--magnum-disable-workarounds` * @ref GL-Context-usage-command-line "command-line option". */ - Configuration& addDisabledWorkarounds(Containers::ArrayView workarounds); - /** @overload */ - Configuration& addDisabledWorkarounds(std::initializer_list workarounds); + Configuration& addDisabledWorkarounds(const Containers::StringIterable& workarounds); /** @brief Disabled extensions */ Containers::ArrayView disabledExtensions() const; @@ -1147,11 +1145,7 @@ class MAGNUM_GL_EXPORT Context::Configuration { #ifndef DOXYGEN_GENERATING_OUTPUT #define MAGNUM_GL_CONTEXT_CONFIGURATION_SUBCLASS_IMPLEMENTATION(Type) \ - Type& addDisabledWorkarounds(Containers::ArrayView workarounds) { \ - GL::Context::Configuration::addDisabledWorkarounds(workarounds); \ - return *this; \ - } \ - Type& addDisabledWorkarounds(std::initializer_list workarounds) { \ + Type& addDisabledWorkarounds(const Containers::StringIterable& workarounds) { \ GL::Context::Configuration::addDisabledWorkarounds(workarounds); \ return *this; \ } \ diff --git a/src/Magnum/GL/Implementation/driverSpecific.cpp b/src/Magnum/GL/Implementation/driverSpecific.cpp index e206e5fec..f3ad80a69 100644 --- a/src/Magnum/GL/Implementation/driverSpecific.cpp +++ b/src/Magnum/GL/Implementation/driverSpecific.cpp @@ -23,8 +23,9 @@ DEALINGS IN THE SOFTWARE. */ -#include #include +#include +#include #include "Magnum/GL/Context.h" #include "Magnum/GL/Extensions.h" @@ -751,7 +752,7 @@ void Context::setupDriverWorkarounds() { #endif } -Context::Configuration& Context::Configuration::addDisabledWorkarounds(Containers::ArrayView workarounds) { +Context::Configuration& Context::Configuration::addDisabledWorkarounds(const Containers::StringIterable& workarounds) { arrayReserve(_disabledWorkarounds, _disabledWorkarounds.size() + workarounds.size()); for(const Containers::StringView workaround: workarounds) {