Browse Source

GL: use StringIterable in Context::addDisabledWorkarounds().

No backwards compatibility include, as this is a pretty rarely used API.
pull/605/head
Vladimír Vondruš 4 years ago
parent
commit
d30b820f3e
  1. 5
      src/Magnum/GL/Context.cpp
  2. 10
      src/Magnum/GL/Context.h
  3. 5
      src/Magnum/GL/Implementation/driverSpecific.cpp

5
src/Magnum/GL/Context.cpp

@ -28,6 +28,7 @@
#include <algorithm> /* std::lower_bound() */ #include <algorithm> /* std::lower_bound() */
#include <Corrade/Containers/EnumSet.hpp> #include <Corrade/Containers/EnumSet.hpp>
#include <Corrade/Containers/GrowableArray.h> #include <Corrade/Containers/GrowableArray.h>
#include <Corrade/Containers/StringIterable.h>
#include <Corrade/Utility/Arguments.h> #include <Corrade/Utility/Arguments.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include <Corrade/Utility/Macros.h> /* CORRADE_THREAD_LOCAL */ #include <Corrade/Utility/Macros.h> /* CORRADE_THREAD_LOCAL */
@ -1268,10 +1269,6 @@ Containers::ArrayView<const Extension> Context::Configuration::disabledExtension
return _disabledExtensions; return _disabledExtensions;
} }
Context::Configuration& Context::Configuration::addDisabledWorkarounds(std::initializer_list<Containers::StringView> workarounds) {
return addDisabledWorkarounds(Containers::arrayView(workarounds));
}
Context::Configuration& Context::Configuration::addDisabledExtensions(Containers::ArrayView<const Extension> extensions) { Context::Configuration& Context::Configuration::addDisabledExtensions(Containers::ArrayView<const Extension> extensions) {
arrayAppend(_disabledExtensions, extensions); arrayAppend(_disabledExtensions, extensions);
return *this; return *this;

10
src/Magnum/GL/Context.h

@ -1113,9 +1113,7 @@ class MAGNUM_GL_EXPORT Context::Configuration {
* Corresponds to the `--magnum-disable-workarounds` * Corresponds to the `--magnum-disable-workarounds`
* @ref GL-Context-usage-command-line "command-line option". * @ref GL-Context-usage-command-line "command-line option".
*/ */
Configuration& addDisabledWorkarounds(Containers::ArrayView<const Containers::StringView> workarounds); Configuration& addDisabledWorkarounds(const Containers::StringIterable& workarounds);
/** @overload */
Configuration& addDisabledWorkarounds(std::initializer_list<Containers::StringView> workarounds);
/** @brief Disabled extensions */ /** @brief Disabled extensions */
Containers::ArrayView<const Extension> disabledExtensions() const; Containers::ArrayView<const Extension> disabledExtensions() const;
@ -1147,11 +1145,7 @@ class MAGNUM_GL_EXPORT Context::Configuration {
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
#define MAGNUM_GL_CONTEXT_CONFIGURATION_SUBCLASS_IMPLEMENTATION(Type) \ #define MAGNUM_GL_CONTEXT_CONFIGURATION_SUBCLASS_IMPLEMENTATION(Type) \
Type& addDisabledWorkarounds(Containers::ArrayView<const Containers::StringView> workarounds) { \ Type& addDisabledWorkarounds(const Containers::StringIterable& workarounds) { \
GL::Context::Configuration::addDisabledWorkarounds(workarounds); \
return *this; \
} \
Type& addDisabledWorkarounds(std::initializer_list<Containers::StringView> workarounds) { \
GL::Context::Configuration::addDisabledWorkarounds(workarounds); \ GL::Context::Configuration::addDisabledWorkarounds(workarounds); \
return *this; \ return *this; \
} \ } \

5
src/Magnum/GL/Implementation/driverSpecific.cpp

@ -23,8 +23,9 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/Containers/StringView.h>
#include <Corrade/Containers/GrowableArray.h> #include <Corrade/Containers/GrowableArray.h>
#include <Corrade/Containers/StringView.h>
#include <Corrade/Containers/StringIterable.h>
#include "Magnum/GL/Context.h" #include "Magnum/GL/Context.h"
#include "Magnum/GL/Extensions.h" #include "Magnum/GL/Extensions.h"
@ -751,7 +752,7 @@ void Context::setupDriverWorkarounds() {
#endif #endif
} }
Context::Configuration& Context::Configuration::addDisabledWorkarounds(Containers::ArrayView<const Containers::StringView> workarounds) { Context::Configuration& Context::Configuration::addDisabledWorkarounds(const Containers::StringIterable& workarounds) {
arrayReserve(_disabledWorkarounds, _disabledWorkarounds.size() + workarounds.size()); arrayReserve(_disabledWorkarounds, _disabledWorkarounds.size() + workarounds.size());
for(const Containers::StringView workaround: workarounds) { for(const Containers::StringView workaround: workarounds) {

Loading…
Cancel
Save