Browse Source

Adapted to Corrade changes.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
99ff54d3d9
  1. 8
      src/Magnum/AbstractObject.cpp
  2. 6
      src/Magnum/AbstractObject.h
  3. 2
      src/Magnum/AbstractQuery.cpp
  4. 4
      src/Magnum/AbstractQuery.h
  5. 13
      src/Magnum/AbstractShaderProgram.cpp
  6. 14
      src/Magnum/AbstractShaderProgram.h
  7. 11
      src/Magnum/AbstractTexture.cpp
  8. 8
      src/Magnum/AbstractTexture.h
  9. 4
      src/Magnum/Audio/AbstractImporter.cpp
  10. 4
      src/Magnum/Audio/AbstractImporter.h
  11. 4
      src/Magnum/Audio/Buffer.h
  12. 2
      src/Magnum/Audio/Test/AbstractImporterTest.cpp
  13. 20
      src/Magnum/Buffer.cpp
  14. 20
      src/Magnum/Buffer.h
  15. 18
      src/Magnum/DebugOutput.cpp
  16. 20
      src/Magnum/DebugOutput.h
  17. 2
      src/Magnum/Framebuffer.cpp
  18. 2
      src/Magnum/Framebuffer.h
  19. 4
      src/Magnum/Implementation/BufferState.h
  20. 6
      src/Magnum/Implementation/DebugState.h
  21. 2
      src/Magnum/Implementation/TextureState.h
  22. 2
      src/Magnum/Mesh.cpp
  23. 4
      src/Magnum/Mesh.h
  24. 2
      src/Magnum/MeshTools/Interleave.h
  25. 2
      src/Magnum/Renderbuffer.cpp
  26. 4
      src/Magnum/Renderbuffer.h
  27. 3
      src/Magnum/Shader.cpp
  28. 4
      src/Magnum/Shader.h
  29. 18
      src/Magnum/Test/CubeMapTextureArrayGLTest.cpp
  30. 24
      src/Magnum/Test/CubeMapTextureGLTest.cpp
  31. 19
      src/Magnum/Test/RectangleTextureGLTest.cpp
  32. 30
      src/Magnum/Test/TextureArrayGLTest.cpp
  33. 48
      src/Magnum/Test/TextureGLTest.cpp
  34. 8
      src/Magnum/Text/AbstractFont.cpp
  35. 8
      src/Magnum/Text/AbstractFont.h
  36. 8
      src/Magnum/Text/AbstractFontConverter.cpp
  37. 8
      src/Magnum/Text/AbstractFontConverter.h
  38. 2
      src/Magnum/Text/Renderer.cpp
  39. 2
      src/Magnum/Text/Test/AbstractFontConverterTest.cpp
  40. 4
      src/Magnum/Text/Test/AbstractFontTest.cpp
  41. 4
      src/Magnum/Trade/AbstractImporter.cpp
  42. 4
      src/Magnum/Trade/AbstractImporter.h
  43. 4
      src/Magnum/Trade/Test/AbstractImporterTest.cpp
  44. 8
      src/Magnum/TransformFeedback.cpp
  45. 4
      src/Magnum/TransformFeedback.h
  46. 4
      src/MagnumPlugins/MagnumFont/MagnumFont.cpp
  47. 2
      src/MagnumPlugins/MagnumFont/MagnumFont.h
  48. 4
      src/MagnumPlugins/ObjImporter/ObjImporter.cpp
  49. 2
      src/MagnumPlugins/ObjImporter/ObjImporter.h
  50. 2
      src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp
  51. 4
      src/MagnumPlugins/TgaImporter/TgaImporter.cpp
  52. 2
      src/MagnumPlugins/TgaImporter/TgaImporter.h
  53. 2
      src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp
  54. 2
      src/MagnumPlugins/WavAudioImporter/WavImporter.cpp
  55. 2
      src/MagnumPlugins/WavAudioImporter/WavImporter.h

8
src/Magnum/AbstractObject.cpp

@ -26,7 +26,7 @@
#include "AbstractObject.h" #include "AbstractObject.h"
#include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Assert.h>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include "Magnum/Context.h" #include "Magnum/Context.h"
#include "Magnum/Extensions.h" #include "Magnum/Extensions.h"
@ -129,9 +129,9 @@ Int AbstractObject::maxLabelLength() {
return value; return value;
} }
void AbstractObject::labelImplementationNoOp(GLenum, GLuint, Containers::ArrayReference<const char>) {} void AbstractObject::labelImplementationNoOp(GLenum, GLuint, Containers::ArrayView<const char>) {}
void AbstractObject::labelImplementationKhr(const GLenum identifier, const GLuint name, const Containers::ArrayReference<const char> label) { void AbstractObject::labelImplementationKhr(const GLenum identifier, const GLuint name, const Containers::ArrayView<const char> label) {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
glObjectLabel(identifier, name, label.size(), label); glObjectLabel(identifier, name, label.size(), label);
#elif !defined(CORRADE_TARGET_NACL) #elif !defined(CORRADE_TARGET_NACL)
@ -144,7 +144,7 @@ void AbstractObject::labelImplementationKhr(const GLenum identifier, const GLuin
#endif #endif
} }
void AbstractObject::labelImplementationExt(const GLenum identifier, const GLuint name, const Containers::ArrayReference<const char> label) { void AbstractObject::labelImplementationExt(const GLenum identifier, const GLuint name, const Containers::ArrayView<const char> label) {
#ifndef CORRADE_TARGET_NACL #ifndef CORRADE_TARGET_NACL
const GLenum type = extTypeFromKhrIdentifier(identifier); const GLenum type = extTypeFromKhrIdentifier(identifier);
glLabelObjectEXT(type, name, label.size(), label); glLabelObjectEXT(type, name, label.size(), label);

6
src/Magnum/AbstractObject.h

@ -107,9 +107,9 @@ class MAGNUM_EXPORT AbstractObject {
private: private:
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
static MAGNUM_LOCAL void labelImplementationNoOp(GLenum, GLuint, Containers::ArrayReference<const char> label); static MAGNUM_LOCAL void labelImplementationNoOp(GLenum, GLuint, Containers::ArrayView<const char> label);
static MAGNUM_LOCAL void labelImplementationExt(GLenum identifier, GLuint name, Containers::ArrayReference<const char> label); static MAGNUM_LOCAL void labelImplementationExt(GLenum identifier, GLuint name, Containers::ArrayView<const char> label);
static MAGNUM_LOCAL void labelImplementationKhr(GLenum identifier, GLuint name, Containers::ArrayReference<const char> label); static MAGNUM_LOCAL void labelImplementationKhr(GLenum identifier, GLuint name, Containers::ArrayView<const char> label);
static MAGNUM_LOCAL std::string getLabelImplementationNoOp(GLenum, GLuint); static MAGNUM_LOCAL std::string getLabelImplementationNoOp(GLenum, GLuint);
static MAGNUM_LOCAL std::string getLabelImplementationExt(GLenum identifier, GLuint name); static MAGNUM_LOCAL std::string getLabelImplementationExt(GLenum identifier, GLuint name);
static MAGNUM_LOCAL std::string getLabelImplementationKhr(GLenum identifier, GLuint name); static MAGNUM_LOCAL std::string getLabelImplementationKhr(GLenum identifier, GLuint name);

2
src/Magnum/AbstractQuery.cpp

@ -85,7 +85,7 @@ std::string AbstractQuery::label() const {
#endif #endif
} }
AbstractQuery& AbstractQuery::setLabelInternal(const Containers::ArrayReference<const char> label) { AbstractQuery& AbstractQuery::setLabelInternal(const Containers::ArrayView<const char> label) {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_QUERY, _id, label); Context::current()->state().debug->labelImplementation(GL_QUERY, _id, label);
#else #else

4
src/Magnum/AbstractQuery.h

@ -31,7 +31,7 @@
*/ */
#endif #endif
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Assert.h>
#include "Magnum/AbstractObject.h" #include "Magnum/AbstractObject.h"
@ -182,7 +182,7 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
private: private:
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
AbstractQuery& setLabelInternal(Containers::ArrayReference<const char> label); AbstractQuery& setLabelInternal(Containers::ArrayView<const char> label);
#endif #endif
void MAGNUM_LOCAL createImplementationDefault(); void MAGNUM_LOCAL createImplementationDefault();

13
src/Magnum/AbstractShaderProgram.cpp

@ -25,6 +25,8 @@
#include "AbstractShaderProgram.h" #include "AbstractShaderProgram.h"
#include <Corrade/Containers/Array.h>
#include "Magnum/Context.h" #include "Magnum/Context.h"
#include "Magnum/Extensions.h" #include "Magnum/Extensions.h"
#include "Magnum/Shader.h" #include "Magnum/Shader.h"
@ -259,7 +261,7 @@ std::string AbstractShaderProgram::label() const {
#endif #endif
} }
AbstractShaderProgram& AbstractShaderProgram::setLabelInternal(const Containers::ArrayReference<const char> label) { AbstractShaderProgram& AbstractShaderProgram::setLabelInternal(const Containers::ArrayView<const char> label) {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_PROGRAM, _id, label); Context::current()->state().debug->labelImplementation(GL_PROGRAM, _id, label);
#else #else
@ -301,21 +303,22 @@ void AbstractShaderProgram::attachShaders(std::initializer_list<std::reference_w
for(Shader& s: shaders) attachShader(s); for(Shader& s: shaders) attachShader(s);
} }
void AbstractShaderProgram::bindAttributeLocationInternal(const UnsignedInt location, const Containers::ArrayReference<const char> name) { void AbstractShaderProgram::bindAttributeLocationInternal(const UnsignedInt location, const Containers::ArrayView<const char> name) {
glBindAttribLocation(_id, location, name); glBindAttribLocation(_id, location, name);
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
void AbstractShaderProgram::bindFragmentDataLocationInternal(const UnsignedInt location, const Containers::ArrayReference<const char> name) { void AbstractShaderProgram::bindFragmentDataLocationInternal(const UnsignedInt location, const Containers::ArrayView<const char> name) {
glBindFragDataLocation(_id, location, name); glBindFragDataLocation(_id, location, name);
} }
void AbstractShaderProgram::bindFragmentDataLocationIndexedInternal(const UnsignedInt location, UnsignedInt index, const Containers::ArrayReference<const char> name) { void AbstractShaderProgram::bindFragmentDataLocationIndexedInternal(const UnsignedInt location, UnsignedInt index, const Containers::ArrayView<const char> name) {
glBindFragDataLocationIndexed(_id, location, index, name); glBindFragDataLocationIndexed(_id, location, index, name);
} }
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
void AbstractShaderProgram::setTransformFeedbackOutputs(const std::initializer_list<std::string> outputs, const TransformFeedbackBufferMode bufferMode) { void AbstractShaderProgram::setTransformFeedbackOutputs(const std::initializer_list<std::string> outputs, const TransformFeedbackBufferMode bufferMode) {
/** @todo VLAs */
Containers::Array<const char*> names{outputs.size()}; Containers::Array<const char*> names{outputs.size()};
Int i = 0; Int i = 0;
@ -392,7 +395,7 @@ bool AbstractShaderProgram::link(std::initializer_list<std::reference_wrapper<Ab
return allSuccess; return allSuccess;
} }
Int AbstractShaderProgram::uniformLocationInternal(const Containers::ArrayReference<const char> name) { Int AbstractShaderProgram::uniformLocationInternal(const Containers::ArrayView<const char> name) {
GLint location = glGetUniformLocation(_id, name); GLint location = glGetUniformLocation(_id, name);
if(location == -1) if(location == -1)
Warning() << "AbstractShaderProgram: location of uniform \'" + std::string{name, name.size()} + "\' cannot be retrieved!"; Warning() << "AbstractShaderProgram: location of uniform \'" + std::string{name, name.size()} + "\' cannot be retrieved!";

14
src/Magnum/AbstractShaderProgram.h

@ -31,7 +31,7 @@
#include <functional> #include <functional>
#include <string> #include <string>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include "Magnum/AbstractObject.h" #include "Magnum/AbstractObject.h"
#include "Magnum/Attribute.h" #include "Magnum/Attribute.h"
@ -387,7 +387,7 @@ comes in handy.
@see @ref portability-shaders @see @ref portability-shaders
@todo Use Containers::ArrayReference for setting uniform arrays? @todo Use Containers::ArrayView for setting uniform arrays?
@todo `GL_NUM_{PROGRAM,SHADER}_BINARY_FORMATS` + `GL_{PROGRAM,SHADER}_BINARY_FORMATS` (vector), (@extension{ARB,ES2_compatibility}) @todo `GL_NUM_{PROGRAM,SHADER}_BINARY_FORMATS` + `GL_{PROGRAM,SHADER}_BINARY_FORMATS` (vector), (@extension{ARB,ES2_compatibility})
*/ */
class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
@ -994,13 +994,13 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
private: private:
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
AbstractShaderProgram& setLabelInternal(Containers::ArrayReference<const char> label); AbstractShaderProgram& setLabelInternal(Containers::ArrayView<const char> label);
#endif #endif
void bindAttributeLocationInternal(UnsignedInt location, Containers::ArrayReference<const char> name); void bindAttributeLocationInternal(UnsignedInt location, Containers::ArrayView<const char> name);
void bindFragmentDataLocationIndexedInternal(UnsignedInt location, UnsignedInt index, Containers::ArrayReference<const char> name); void bindFragmentDataLocationIndexedInternal(UnsignedInt location, UnsignedInt index, Containers::ArrayView<const char> name);
void bindFragmentDataLocationInternal(UnsignedInt location, Containers::ArrayReference<const char> name); void bindFragmentDataLocationInternal(UnsignedInt location, Containers::ArrayView<const char> name);
Int uniformLocationInternal(Containers::ArrayReference<const char> name); Int uniformLocationInternal(Containers::ArrayView<const char> name);
#ifndef MAGNUM_BUILD_DEPRECATED #ifndef MAGNUM_BUILD_DEPRECATED
void use(); void use();

11
src/Magnum/AbstractTexture.cpp

@ -25,6 +25,8 @@
#include "AbstractTexture.h" #include "AbstractTexture.h"
#include <Corrade/Containers/Array.h>
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
#include "Magnum/BufferImage.h" #include "Magnum/BufferImage.h"
#endif #endif
@ -164,17 +166,18 @@ void AbstractTexture::bind(const Int firstTextureUnit, std::initializer_list<Abs
Context::current()->state().texture->bindMultiImplementation(firstTextureUnit, {textures.begin(), textures.size()}); Context::current()->state().texture->bindMultiImplementation(firstTextureUnit, {textures.begin(), textures.size()});
} }
void AbstractTexture::bindImplementationFallback(const GLint firstTextureUnit, const Containers::ArrayReference<AbstractTexture* const> textures) { void AbstractTexture::bindImplementationFallback(const GLint firstTextureUnit, const Containers::ArrayView<AbstractTexture* const> textures) {
for(std::size_t i = 0; i != textures.size(); ++i) for(std::size_t i = 0; i != textures.size(); ++i)
textures && textures[i] ? textures[i]->bind(firstTextureUnit + i) : unbind(firstTextureUnit + i); textures && textures[i] ? textures[i]->bind(firstTextureUnit + i) : unbind(firstTextureUnit + i);
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
/** @todoc const Containers::ArrayReference makes Doxygen grumpy */ /** @todoc const Containers::ArrayView makes Doxygen grumpy */
void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Containers::ArrayReference<AbstractTexture* const> textures) { void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Containers::ArrayView<AbstractTexture* const> textures) {
Implementation::TextureState& textureState = *Context::current()->state().texture; Implementation::TextureState& textureState = *Context::current()->state().texture;
/* Create array of IDs and also update bindings in state tracker */ /* Create array of IDs and also update bindings in state tracker */
/** @todo VLAs */
Containers::Array<GLuint> ids{textures ? textures.size() : 0}; Containers::Array<GLuint> ids{textures ? textures.size() : 0};
bool different = false; bool different = false;
for(std::size_t i = 0; i != textures.size(); ++i) { for(std::size_t i = 0; i != textures.size(); ++i) {
@ -241,7 +244,7 @@ std::string AbstractTexture::label() {
return Context::current()->state().debug->getLabelImplementation(GL_TEXTURE, _id); return Context::current()->state().debug->getLabelImplementation(GL_TEXTURE, _id);
} }
AbstractTexture& AbstractTexture::setLabelInternal(const Containers::ArrayReference<const char> label) { AbstractTexture& AbstractTexture::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready(); createIfNotAlready();
Context::current()->state().debug->labelImplementation(GL_TEXTURE, _id, label); Context::current()->state().debug->labelImplementation(GL_TEXTURE, _id, label);
return *this; return *this;

8
src/Magnum/AbstractTexture.h

@ -29,7 +29,7 @@
* @brief Class @ref Magnum::AbstractTexture * @brief Class @ref Magnum::AbstractTexture
*/ */
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include "Magnum/AbstractObject.h" #include "Magnum/AbstractObject.h"
#include "Magnum/DimensionTraits.h" #include "Magnum/DimensionTraits.h"
@ -343,7 +343,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
explicit AbstractTexture(GLuint id, GLenum target, ObjectFlags flags) noexcept: _target{target}, _id{id}, _flags{flags} {} explicit AbstractTexture(GLuint id, GLenum target, ObjectFlags flags) noexcept: _target{target}, _id{id}, _flags{flags} {}
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
AbstractTexture& setLabelInternal(Containers::ArrayReference<const char> label); AbstractTexture& setLabelInternal(Containers::ArrayView<const char> label);
#endif #endif
/* Unlike bind() this also sets the texture binding unit as active */ /* Unlike bind() this also sets the texture binding unit as active */
@ -413,9 +413,9 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
static void MAGNUM_LOCAL unbindImplementationDSAEXT(GLint textureUnit); static void MAGNUM_LOCAL unbindImplementationDSAEXT(GLint textureUnit);
#endif #endif
static void MAGNUM_LOCAL bindImplementationFallback(GLint firstTextureUnit, Containers::ArrayReference<AbstractTexture* const> textures); static void MAGNUM_LOCAL bindImplementationFallback(GLint firstTextureUnit, Containers::ArrayView<AbstractTexture* const> textures);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
static void MAGNUM_LOCAL bindImplementationMulti(GLint firstTextureUnit, Containers::ArrayReference<AbstractTexture* const> textures); static void MAGNUM_LOCAL bindImplementationMulti(GLint firstTextureUnit, Containers::ArrayView<AbstractTexture* const> textures);
#endif #endif
void MAGNUM_LOCAL createImplementationDefault(); void MAGNUM_LOCAL createImplementationDefault();

4
src/Magnum/Audio/AbstractImporter.cpp

@ -35,7 +35,7 @@ AbstractImporter::AbstractImporter() = default;
AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {} AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {}
bool AbstractImporter::openData(Containers::ArrayReference<const char> data) { bool AbstractImporter::openData(Containers::ArrayView<const char> data) {
CORRADE_ASSERT(features() & Feature::OpenData, CORRADE_ASSERT(features() & Feature::OpenData,
"Audio::AbstractImporter::openData(): feature not supported", {}); "Audio::AbstractImporter::openData(): feature not supported", {});
@ -44,7 +44,7 @@ bool AbstractImporter::openData(Containers::ArrayReference<const char> data) {
return isOpened(); return isOpened();
} }
void AbstractImporter::doOpenData(Containers::ArrayReference<const char>) { void AbstractImporter::doOpenData(Containers::ArrayView<const char>) {
CORRADE_ASSERT(false, "Audio::AbstractImporter::openData(): feature advertised but not implemented", ); CORRADE_ASSERT(false, "Audio::AbstractImporter::openData(): feature advertised but not implemented", );
} }

4
src/Magnum/Audio/AbstractImporter.h

@ -103,7 +103,7 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractPlugin
* `true` on success, `false` otherwise. * `true` on success, `false` otherwise.
* @see @ref features(), @ref openFile() * @see @ref features(), @ref openFile()
*/ */
bool openData(Containers::ArrayReference<const char> data); bool openData(Containers::ArrayView<const char> data);
/** /**
* @brief Open file * @brief Open file
@ -142,7 +142,7 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractPlugin
virtual bool doIsOpened() const = 0; virtual bool doIsOpened() const = 0;
/** @brief Implementation for @ref openData() */ /** @brief Implementation for @ref openData() */
virtual void doOpenData(Containers::ArrayReference<const char> data); virtual void doOpenData(Containers::ArrayView<const char> data);
/** /**
* @brief Implementation for @ref openFile() * @brief Implementation for @ref openFile()

4
src/Magnum/Audio/Buffer.h

@ -31,7 +31,7 @@
#include <utility> #include <utility>
#include <al.h> #include <al.h>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/Audio/visibility.h" #include "Magnum/Audio/visibility.h"
@ -95,7 +95,7 @@ class Buffer {
* *
* @see @fn_al{BufferData} * @see @fn_al{BufferData}
*/ */
Buffer& setData(Format format, Containers::ArrayReference<const void> data, ALsizei frequency) { Buffer& setData(Format format, Containers::ArrayView<const void> data, ALsizei frequency) {
alBufferData(_id, ALenum(format), data, data.size(), frequency); alBufferData(_id, ALenum(format), data, data.size(), frequency);
return *this; return *this;
} }

2
src/Magnum/Audio/Test/AbstractImporterTest.cpp

@ -53,7 +53,7 @@ void AbstractImporterTest::openFile() {
bool doIsOpened() const override { return opened; } bool doIsOpened() const override { return opened; }
void doClose() override {} void doClose() override {}
void doOpenData(Containers::ArrayReference<const char> data) override { void doOpenData(Containers::ArrayView<const char> data) override {
opened = (data.size() == 1 && data[0] == '\xa5'); opened = (data.size() == 1 && data[0] == '\xa5');
} }

20
src/Magnum/Buffer.cpp

@ -25,6 +25,7 @@
#include "Buffer.h" #include "Buffer.h"
#include <Corrade/Containers/Array.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/Context.h" #include "Magnum/Context.h"
@ -239,7 +240,7 @@ std::string Buffer::label() {
#endif #endif
} }
Buffer& Buffer::setLabelInternal(const Containers::ArrayReference<const char> label) { Buffer& Buffer::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready(); createIfNotAlready();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_BUFFER, _id, label); Context::current()->state().debug->labelImplementation(GL_BUFFER, _id, label);
@ -318,12 +319,12 @@ Int Buffer::size() {
return size; return size;
} }
Buffer& Buffer::setData(const Containers::ArrayReference<const void> data, const BufferUsage usage) { Buffer& Buffer::setData(const Containers::ArrayView<const void> data, const BufferUsage usage) {
(this->*Context::current()->state().buffer->dataImplementation)(data.size(), data, usage); (this->*Context::current()->state().buffer->dataImplementation)(data.size(), data, usage);
return *this; return *this;
} }
Buffer& Buffer::setSubData(const GLintptr offset, const Containers::ArrayReference<const void> data) { Buffer& Buffer::setSubData(const GLintptr offset, const Containers::ArrayView<const void> data) {
(this->*Context::current()->state().buffer->subDataImplementation)(offset, data.size(), data); (this->*Context::current()->state().buffer->subDataImplementation)(offset, data.size(), data);
return *this; return *this;
} }
@ -377,7 +378,7 @@ void Buffer::subDataInternal(GLintptr offset, GLsizeiptr size, GLvoid* data) {
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
void Buffer::bindImplementationFallback(const Target target, const GLuint firstIndex, Containers::ArrayReference<Buffer* const> buffers) { void Buffer::bindImplementationFallback(const Target target, const GLuint firstIndex, Containers::ArrayView<Buffer* const> buffers) {
for(std::size_t i = 0; i != buffers.size(); ++i) { for(std::size_t i = 0; i != buffers.size(); ++i) {
if(buffers && buffers[i]) buffers[i]->bind(target, firstIndex + i); if(buffers && buffers[i]) buffers[i]->bind(target, firstIndex + i);
else unbind(target, firstIndex + i); else unbind(target, firstIndex + i);
@ -385,7 +386,8 @@ void Buffer::bindImplementationFallback(const Target target, const GLuint firstI
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
void Buffer::bindImplementationMulti(const Target target, const GLuint firstIndex, Containers::ArrayReference<Buffer* const> buffers) { void Buffer::bindImplementationMulti(const Target target, const GLuint firstIndex, Containers::ArrayView<Buffer* const> buffers) {
/** @todo C++1z: VLAs? */
Containers::Array<GLuint> ids{buffers ? buffers.size() : 0}; Containers::Array<GLuint> ids{buffers ? buffers.size() : 0};
if(buffers) for(std::size_t i = 0; i != buffers.size(); ++i) { if(buffers) for(std::size_t i = 0; i != buffers.size(); ++i) {
if(buffers[i]) { if(buffers[i]) {
@ -400,8 +402,8 @@ void Buffer::bindImplementationMulti(const Target target, const GLuint firstInde
} }
#endif #endif
/** @todoc const Containers::ArrayReference makes Doxygen grumpy */ /** @todoc const Containers::ArrayView makes Doxygen grumpy */
void Buffer::bindImplementationFallback(const Target target, const GLuint firstIndex, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) { void Buffer::bindImplementationFallback(const Target target, const GLuint firstIndex, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) {
for(std::size_t i = 0; i != buffers.size(); ++i) { for(std::size_t i = 0; i != buffers.size(); ++i) {
if(buffers && std::get<0>(buffers[i])) if(buffers && std::get<0>(buffers[i]))
std::get<0>(buffers[i])->bind(target, firstIndex + i, std::get<1>(buffers[i]), std::get<2>(buffers[i])); std::get<0>(buffers[i])->bind(target, firstIndex + i, std::get<1>(buffers[i]), std::get<2>(buffers[i]));
@ -410,8 +412,8 @@ void Buffer::bindImplementationFallback(const Target target, const GLuint firstI
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
/** @todoc const Containers::ArrayReference makes Doxygen grumpy */ /** @todoc const Containers::ArrayView makes Doxygen grumpy */
void Buffer::bindImplementationMulti(const Target target, const GLuint firstIndex, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) { void Buffer::bindImplementationMulti(const Target target, const GLuint firstIndex, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) {
/** @todo use ArrayTuple */ /** @todo use ArrayTuple */
Containers::Array<GLuint> ids{buffers ? buffers.size() : 0}; Containers::Array<GLuint> ids{buffers ? buffers.size() : 0};
Containers::Array<GLintptr> offsetsSizes{buffers ? buffers.size()*2 : 0}; Containers::Array<GLintptr> offsetsSizes{buffers ? buffers.size()*2 : 0};

20
src/Magnum/Buffer.h

@ -48,7 +48,7 @@ namespace Magnum {
/** /**
@brief Buffer usage @brief Buffer usage
@see @ref Buffer, @ref Buffer::setData(Containers::ArrayReference<const void>, BufferUsage) @see @ref Buffer, @ref Buffer::setData(Containers::ArrayView<const void>, BufferUsage)
*/ */
enum class BufferUsage: GLenum { enum class BufferUsage: GLenum {
/** Set once by the application and used infrequently for drawing. */ /** Set once by the application and used infrequently for drawing. */
@ -141,10 +141,10 @@ data updates.
## Data updating ## Data updating
Default way to set or update buffer data with @ref setData() or @ref setSubData() Default way to set or update buffer data with @ref setData() or @ref setSubData()
is to use @ref Corrade::Containers::ArrayReference. See its documentation for is to use @ref Corrade::Containers::ArrayView. See its documentation for
more information about automatic conversions etc. more information about automatic conversions etc.
@code @code
Containers::ArrayReference<Vector3> data; Containers::ArrayView<Vector3> data;
buffer.setData(data, BufferUsage::StaticDraw); buffer.setData(data, BufferUsage::StaticDraw);
@endcode @endcode
There is also overload for array-like containers from STL, such as `std::vector` There is also overload for array-like containers from STL, such as `std::vector`
@ -1086,7 +1086,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @fn_gl_extension{NamedBufferData,EXT,direct_state_access}, * @fn_gl_extension{NamedBufferData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{BufferData} * eventually @fn_gl{BindBuffer} and @fn_gl{BufferData}
*/ */
Buffer& setData(Containers::ArrayReference<const void> data, BufferUsage usage); Buffer& setData(Containers::ArrayView<const void> data, BufferUsage usage);
/** @overload */ /** @overload */
template<class T> Buffer& setData(const std::vector<T>& data, BufferUsage usage) { template<class T> Buffer& setData(const std::vector<T>& data, BufferUsage usage) {
@ -1114,7 +1114,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @fn_gl_extension{NamedBufferSubData,EXT,direct_state_access}, * @fn_gl_extension{NamedBufferSubData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{BufferSubData} * eventually @fn_gl{BindBuffer} and @fn_gl{BufferSubData}
*/ */
Buffer& setSubData(GLintptr offset, Containers::ArrayReference<const void> data); Buffer& setSubData(GLintptr offset, Containers::ArrayView<const void> data);
/** @overload */ /** @overload */
template<class T> Buffer& setSubData(GLintptr offset, const std::vector<T>& data) { template<class T> Buffer& setSubData(GLintptr offset, const std::vector<T>& data) {
@ -1310,14 +1310,14 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
TargetHint MAGNUM_LOCAL bindSomewhereInternal(TargetHint hint); TargetHint MAGNUM_LOCAL bindSomewhereInternal(TargetHint hint);
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayReference<Buffer* const> buffers); static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayView<Buffer* const> buffers);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayReference<Buffer* const> buffers); static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView<Buffer* const> buffers);
#endif #endif
static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers); static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers); static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers);
#endif #endif
static void MAGNUM_LOCAL copyImplementationDefault(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); static void MAGNUM_LOCAL copyImplementationDefault(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
@ -1337,7 +1337,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
void MAGNUM_LOCAL createIfNotAlready(); void MAGNUM_LOCAL createIfNotAlready();
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Buffer& setLabelInternal(Containers::ArrayReference<const char> label); Buffer& setLabelInternal(Containers::ArrayView<const char> label);
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

18
src/Magnum/DebugOutput.cpp

@ -272,13 +272,13 @@ Debug operator<<(Debug debug, const DebugOutput::Severity value) {
} }
#endif #endif
void DebugMessage::insertInternal(const Source source, const Type type, const UnsignedInt id, const DebugOutput::Severity severity, const Containers::ArrayReference<const char> string) { void DebugMessage::insertInternal(const Source source, const Type type, const UnsignedInt id, const DebugOutput::Severity severity, const Containers::ArrayView<const char> string) {
Context::current()->state().debug->messageInsertImplementation(source, type, id, severity, string); Context::current()->state().debug->messageInsertImplementation(source, type, id, severity, string);
} }
void DebugMessage::insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, const Containers::ArrayReference<const char>) {} void DebugMessage::insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, const Containers::ArrayView<const char>) {}
void DebugMessage::insertImplementationKhr(const Source source, const Type type, const UnsignedInt id, const DebugOutput::Severity severity, const Containers::ArrayReference<const char> string) { void DebugMessage::insertImplementationKhr(const Source source, const Type type, const UnsignedInt id, const DebugOutput::Severity severity, const Containers::ArrayView<const char> string) {
#ifndef CORRADE_TARGET_NACL #ifndef CORRADE_TARGET_NACL
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
glDebugMessageInsert glDebugMessageInsert
@ -296,7 +296,7 @@ void DebugMessage::insertImplementationKhr(const Source source, const Type type,
#endif #endif
} }
void DebugMessage::insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, const Containers::ArrayReference<const char> string) { void DebugMessage::insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, const Containers::ArrayView<const char> string) {
#ifndef CORRADE_TARGET_NACL #ifndef CORRADE_TARGET_NACL
glInsertEventMarkerEXT(string.size(), string.data()); glInsertEventMarkerEXT(string.size(), string.data());
#else #else
@ -306,7 +306,7 @@ void DebugMessage::insertImplementationExt(Source, Type, UnsignedInt, DebugOutpu
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
void DebugMessage::insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, const Containers::ArrayReference<const char> string) { void DebugMessage::insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, const Containers::ArrayView<const char> string) {
glStringMarkerGREMEDY(string.size(), string.data()); glStringMarkerGREMEDY(string.size(), string.data());
} }
#endif #endif
@ -364,7 +364,7 @@ Int DebugGroup::maxStackDepth() {
return value; return value;
} }
void DebugGroup::pushInternal(const Source source, const UnsignedInt id, const Containers::ArrayReference<const char> message) { void DebugGroup::pushInternal(const Source source, const UnsignedInt id, const Containers::ArrayView<const char> message) {
CORRADE_ASSERT(!_active, "DebugGroup::push(): group is already active", ); CORRADE_ASSERT(!_active, "DebugGroup::push(): group is already active", );
Context::current()->state().debug->pushGroupImplementation(source, id, message); Context::current()->state().debug->pushGroupImplementation(source, id, message);
_active = true; _active = true;
@ -376,9 +376,9 @@ void DebugGroup::pop() {
_active = false; _active = false;
} }
void DebugGroup::pushImplementationNoOp(Source, UnsignedInt, Containers::ArrayReference<const char>) {} void DebugGroup::pushImplementationNoOp(Source, UnsignedInt, Containers::ArrayView<const char>) {}
void DebugGroup::pushImplementationKhr(const Source source, const UnsignedInt id, const Containers::ArrayReference<const char> message) { void DebugGroup::pushImplementationKhr(const Source source, const UnsignedInt id, const Containers::ArrayView<const char> message) {
#ifndef CORRADE_TARGET_NACL #ifndef CORRADE_TARGET_NACL
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
glPushDebugGroup glPushDebugGroup
@ -394,7 +394,7 @@ void DebugGroup::pushImplementationKhr(const Source source, const UnsignedInt id
#endif #endif
} }
void DebugGroup::pushImplementationExt(Source, UnsignedInt, const Containers::ArrayReference<const char> message) { void DebugGroup::pushImplementationExt(Source, UnsignedInt, const Containers::ArrayView<const char> message) {
#ifndef CORRADE_TARGET_NACL #ifndef CORRADE_TARGET_NACL
glPushGroupMarkerEXT(message.size(), message.data()); glPushGroupMarkerEXT(message.size(), message.data());
#else #else

20
src/Magnum/DebugOutput.h

@ -32,7 +32,7 @@
#endif #endif
#include <string> #include <string>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include "Magnum/OpenGL.h" #include "Magnum/OpenGL.h"
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
@ -675,12 +675,12 @@ class MAGNUM_EXPORT DebugMessage {
DebugMessage() = delete; DebugMessage() = delete;
private: private:
static void insertInternal(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayReference<const char> string); static void insertInternal(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string);
static MAGNUM_LOCAL void insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayReference<const char>); static MAGNUM_LOCAL void insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char>);
static MAGNUM_LOCAL void insertImplementationKhr(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayReference<const char> string); static MAGNUM_LOCAL void insertImplementationKhr(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string);
static MAGNUM_LOCAL void insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayReference<const char> string); static MAGNUM_LOCAL void insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> string);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
static MAGNUM_LOCAL void insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayReference<const char> string); static MAGNUM_LOCAL void insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> string);
#endif #endif
}; };
@ -880,11 +880,11 @@ class MAGNUM_EXPORT DebugGroup {
void pop(); void pop();
private: private:
void pushInternal(Source source, UnsignedInt id, Containers::ArrayReference<const char> message); void pushInternal(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
static MAGNUM_LOCAL void pushImplementationNoOp(Source source, UnsignedInt id, Containers::ArrayReference<const char> message); static MAGNUM_LOCAL void pushImplementationNoOp(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
static MAGNUM_LOCAL void pushImplementationKhr(Source source, UnsignedInt id, Containers::ArrayReference<const char> message); static MAGNUM_LOCAL void pushImplementationKhr(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
static MAGNUM_LOCAL void pushImplementationExt(Source source, UnsignedInt id, Containers::ArrayReference<const char> message); static MAGNUM_LOCAL void pushImplementationExt(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
static MAGNUM_LOCAL void popImplementationNoOp(); static MAGNUM_LOCAL void popImplementationNoOp();
static MAGNUM_LOCAL void popImplementationKhr(); static MAGNUM_LOCAL void popImplementationKhr();

2
src/Magnum/Framebuffer.cpp

@ -140,7 +140,7 @@ std::string Framebuffer::label() {
return Context::current()->state().debug->getLabelImplementation(GL_FRAMEBUFFER, _id); return Context::current()->state().debug->getLabelImplementation(GL_FRAMEBUFFER, _id);
} }
Framebuffer& Framebuffer::setLabelInternal(const Containers::ArrayReference<const char> label) { Framebuffer& Framebuffer::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready(); createIfNotAlready();
Context::current()->state().debug->labelImplementation(GL_FRAMEBUFFER, _id, label); Context::current()->state().debug->labelImplementation(GL_FRAMEBUFFER, _id, label);
return *this; return *this;

2
src/Magnum/Framebuffer.h

@ -722,7 +722,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Framebuffer& setLabelInternal(Containers::ArrayReference<const char> label); Framebuffer& setLabelInternal(Containers::ArrayView<const char> label);
#endif #endif
void MAGNUM_LOCAL renderbufferImplementationDefault(BufferAttachment attachment, Renderbuffer& renderbuffer); void MAGNUM_LOCAL renderbufferImplementationDefault(BufferAttachment attachment, Renderbuffer& renderbuffer);

4
src/Magnum/Implementation/BufferState.h

@ -49,8 +49,8 @@ struct BufferState {
void reset(); void reset();
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
void(*bindBasesImplementation)(Buffer::Target, UnsignedInt, Containers::ArrayReference<Buffer* const>); void(*bindBasesImplementation)(Buffer::Target, UnsignedInt, Containers::ArrayView<Buffer* const>);
void(*bindRangesImplementation)(Buffer::Target, UnsignedInt, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>>); void(*bindRangesImplementation)(Buffer::Target, UnsignedInt, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>>);
void(*copyImplementation)(Buffer&, Buffer&, GLintptr, GLintptr, GLsizeiptr); void(*copyImplementation)(Buffer&, Buffer&, GLintptr, GLintptr, GLsizeiptr);
#endif #endif
void(Buffer::*createImplementation)(); void(Buffer::*createImplementation)();

6
src/Magnum/Implementation/DebugState.h

@ -40,12 +40,12 @@ struct DebugState {
explicit DebugState(Context& context, std::vector<std::string>& extensions); explicit DebugState(Context& context, std::vector<std::string>& extensions);
std::string(*getLabelImplementation)(GLenum, GLuint); std::string(*getLabelImplementation)(GLenum, GLuint);
void(*labelImplementation)(GLenum, GLuint, Containers::ArrayReference<const char>); void(*labelImplementation)(GLenum, GLuint, Containers::ArrayView<const char>);
void(*messageInsertImplementation)(DebugMessage::Source, DebugMessage::Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayReference<const char>); void(*messageInsertImplementation)(DebugMessage::Source, DebugMessage::Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char>);
void(*controlImplementation)(GLenum, GLenum, GLenum, std::initializer_list<UnsignedInt>, bool); void(*controlImplementation)(GLenum, GLenum, GLenum, std::initializer_list<UnsignedInt>, bool);
void(*callbackImplementation)(DebugOutput::Callback, const void*); void(*callbackImplementation)(DebugOutput::Callback, const void*);
void(*pushGroupImplementation)(DebugGroup::Source, UnsignedInt, Containers::ArrayReference<const char>); void(*pushGroupImplementation)(DebugGroup::Source, UnsignedInt, Containers::ArrayView<const char>);
void(*popGroupImplementation)(); void(*popGroupImplementation)();
GLint maxLabelLength, maxLoggedMessages, maxMessageLength, maxStackDepth; GLint maxLabelLength, maxLoggedMessages, maxMessageLength, maxStackDepth;

2
src/Magnum/Implementation/TextureState.h

@ -39,7 +39,7 @@ struct TextureState {
void reset(); void reset();
void(*unbindImplementation)(GLint); void(*unbindImplementation)(GLint);
void(*bindMultiImplementation)(GLint, Containers::ArrayReference<AbstractTexture* const>); void(*bindMultiImplementation)(GLint, Containers::ArrayView<AbstractTexture* const>);
void(AbstractTexture::*createImplementation)(); void(AbstractTexture::*createImplementation)();
void(AbstractTexture::*bindImplementation)(GLint); void(AbstractTexture::*bindImplementation)(GLint);
void(AbstractTexture::*parameteriImplementation)(GLenum, GLint); void(AbstractTexture::*parameteriImplementation)(GLenum, GLint);

2
src/Magnum/Mesh.cpp

@ -199,7 +199,7 @@ std::string Mesh::label() {
#endif #endif
} }
Mesh& Mesh::setLabelInternal(const Containers::ArrayReference<const char> label) { Mesh& Mesh::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready(); createIfNotAlready();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_VERTEX_ARRAY, _id, label); Context::current()->state().debug->labelImplementation(GL_VERTEX_ARRAY, _id, label);

4
src/Magnum/Mesh.h

@ -30,7 +30,7 @@
*/ */
#include <vector> #include <vector>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include <Corrade/Utility/ConfigurationValue.h> #include <Corrade/Utility/ConfigurationValue.h>
#include "Magnum/AbstractObject.h" #include "Magnum/AbstractObject.h"
@ -884,7 +884,7 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
void MAGNUM_LOCAL createIfNotAlready(); void MAGNUM_LOCAL createIfNotAlready();
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Mesh& setLabelInternal(Containers::ArrayReference<const char> label); Mesh& setLabelInternal(Containers::ArrayView<const char> label);
#endif #endif
/* Computing stride of interleaved vertex attributes */ /* Computing stride of interleaved vertex attributes */

2
src/Magnum/MeshTools/Interleave.h

@ -162,7 +162,7 @@ parameters.
arrays have the same size. The passed buffer must also be large enough to arrays have the same size. The passed buffer must also be large enough to
contain the interleaved data. contain the interleaved data.
*/ */
template<class T, class ...U> void interleaveInto(Containers::ArrayReference<char> buffer, const T& first, const U&... next) { template<class T, class ...U> void interleaveInto(Containers::ArrayView<char> buffer, const T& first, const U&... next) {
/* Verify expected buffer size */ /* Verify expected buffer size */
const std::size_t attributeCount = Implementation::AttributeCount{}(first, next...); const std::size_t attributeCount = Implementation::AttributeCount{}(first, next...);
const std::size_t stride = Implementation::Stride{}(first, next...); const std::size_t stride = Implementation::Stride{}(first, next...);

2
src/Magnum/Renderbuffer.cpp

@ -111,7 +111,7 @@ std::string Renderbuffer::label() {
return Context::current()->state().debug->getLabelImplementation(GL_RENDERBUFFER, _id); return Context::current()->state().debug->getLabelImplementation(GL_RENDERBUFFER, _id);
} }
Renderbuffer& Renderbuffer::setLabelInternal(const Containers::ArrayReference<const char> label) { Renderbuffer& Renderbuffer::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready(); createIfNotAlready();
Context::current()->state().debug->labelImplementation(GL_RENDERBUFFER, _id, label); Context::current()->state().debug->labelImplementation(GL_RENDERBUFFER, _id, label);
return *this; return *this;

4
src/Magnum/Renderbuffer.h

@ -29,7 +29,7 @@
* @brief Class @ref Magnum::Renderbuffer * @brief Class @ref Magnum::Renderbuffer
*/ */
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include "Magnum/AbstractObject.h" #include "Magnum/AbstractObject.h"
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
@ -235,7 +235,7 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
void MAGNUM_LOCAL createIfNotAlready(); void MAGNUM_LOCAL createIfNotAlready();
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Renderbuffer& setLabelInternal(Containers::ArrayReference<const char> label); Renderbuffer& setLabelInternal(Containers::ArrayView<const char> label);
#endif #endif
void MAGNUM_LOCAL storageImplementationDefault(RenderbufferFormat internalFormat, const Vector2i& size); void MAGNUM_LOCAL storageImplementationDefault(RenderbufferFormat internalFormat, const Vector2i& size);

3
src/Magnum/Shader.cpp

@ -662,7 +662,7 @@ std::string Shader::label() const {
#endif #endif
} }
Shader& Shader::setLabelInternal(const Containers::ArrayReference<const char> label) { Shader& Shader::setLabelInternal(const Containers::ArrayView<const char> label) {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_SHADER, _id, label); Context::current()->state().debug->labelImplementation(GL_SHADER, _id, label);
#else #else
@ -715,6 +715,7 @@ bool Shader::compile(std::initializer_list<std::reference_wrapper<Shader>> shade
CORRADE_ASSERT(shader._sources.size() > 1, "Shader::compile(): no files added", false); CORRADE_ASSERT(shader._sources.size() > 1, "Shader::compile(): no files added", false);
maxSourceCount = std::max(shader._sources.size(), maxSourceCount); maxSourceCount = std::max(shader._sources.size(), maxSourceCount);
} }
/** @todo ArrayTuple/VLAs */
Containers::Array<const GLchar*> pointers(maxSourceCount); Containers::Array<const GLchar*> pointers(maxSourceCount);
Containers::Array<GLint> sizes(maxSourceCount); Containers::Array<GLint> sizes(maxSourceCount);

4
src/Magnum/Shader.h

@ -32,7 +32,7 @@
#include <functional> #include <functional>
#include <string> #include <string>
#include <vector> #include <vector>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include "Magnum/AbstractObject.h" #include "Magnum/AbstractObject.h"
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
@ -587,7 +587,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
bool compile() { return compile({*this}); } bool compile() { return compile({*this}); }
private: private:
Shader& setLabelInternal(Containers::ArrayReference<const char> label); Shader& setLabelInternal(Containers::ArrayView<const char> label);
Type _type; Type _type;
GLuint _id; GLuint _id;

18
src/Magnum/Test/CubeMapTextureArrayGLTest.cpp

@ -276,8 +276,8 @@ void CubeMapTextureArrayGLTest::image() {
CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
} }
void CubeMapTextureArrayGLTest::imageBuffer() { void CubeMapTextureArrayGLTest::imageBuffer() {
@ -296,7 +296,7 @@ void CubeMapTextureArrayGLTest::imageBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
} }
namespace { namespace {
@ -367,8 +367,8 @@ void CubeMapTextureArrayGLTest::subImage() {
CORRADE_COMPARE(image.size(), Vector3i(4, 4, 6)); CORRADE_COMPARE(image.size(), Vector3i(4, 4, 6));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container);
} }
void CubeMapTextureArrayGLTest::subImageBuffer() { void CubeMapTextureArrayGLTest::subImageBuffer() {
@ -389,7 +389,7 @@ void CubeMapTextureArrayGLTest::subImageBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i(4, 4, 6)); CORRADE_COMPARE(image.size(), Vector3i(4, 4, 6));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container);
} }
void CubeMapTextureArrayGLTest::subImageQuery() { void CubeMapTextureArrayGLTest::subImageQuery() {
@ -410,8 +410,8 @@ void CubeMapTextureArrayGLTest::subImageQuery() {
CORRADE_COMPARE(image.size(), Vector3i(2, 2, 4)); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 4));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{SubData}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{SubData}, TestSuite::Compare::Container);
} }
void CubeMapTextureArrayGLTest::subImageQueryBuffer() { void CubeMapTextureArrayGLTest::subImageQueryBuffer() {
@ -432,7 +432,7 @@ void CubeMapTextureArrayGLTest::subImageQueryBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i(2, 2, 4)); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 4));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{SubData}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{SubData}, TestSuite::Compare::Container);
} }
void CubeMapTextureArrayGLTest::generateMipmap() { void CubeMapTextureArrayGLTest::generateMipmap() {

24
src/Magnum/Test/CubeMapTextureGLTest.cpp

@ -361,8 +361,8 @@ void CubeMapTextureGLTest::imageFull() {
CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{DataFull}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{DataFull}, TestSuite::Compare::Container);
} }
void CubeMapTextureGLTest::imageFullBuffer() { void CubeMapTextureGLTest::imageFullBuffer() {
@ -381,7 +381,7 @@ void CubeMapTextureGLTest::imageFullBuffer() {
CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6));
const auto imageData = image.buffer().data<UnsignedByte>(); const auto imageData = image.buffer().data<UnsignedByte>();
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{DataFull}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{DataFull}, TestSuite::Compare::Container);
} }
#endif #endif
@ -407,8 +407,8 @@ void CubeMapTextureGLTest::image() {
CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE(image.size(), Vector2i(2));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
#endif #endif
} }
@ -428,7 +428,7 @@ void CubeMapTextureGLTest::imageBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE(image.size(), Vector2i(2));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
#endif #endif
} }
#endif #endif
@ -460,8 +460,8 @@ void CubeMapTextureGLTest::subImage() {
CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container);
#endif #endif
} }
@ -483,7 +483,7 @@ void CubeMapTextureGLTest::subImageBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container);
#endif #endif
} }
#endif #endif
@ -508,8 +508,8 @@ void CubeMapTextureGLTest::subImageQuery() {
CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1)); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
} }
void CubeMapTextureGLTest::subImageQueryBuffer() { void CubeMapTextureGLTest::subImageQueryBuffer() {
@ -531,7 +531,7 @@ void CubeMapTextureGLTest::subImageQueryBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1)); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
} }
#endif #endif

19
src/Magnum/Test/RectangleTextureGLTest.cpp

@ -23,6 +23,7 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/Containers/Array.h>
#include <Corrade/TestSuite/Compare/Container.h> #include <Corrade/TestSuite/Compare/Container.h>
#include "Magnum/configure.h" #include "Magnum/configure.h"
@ -249,8 +250,8 @@ void RectangleTextureGLTest::image() {
CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE(image.size(), Vector2i(2));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
} }
void RectangleTextureGLTest::imageBuffer() { void RectangleTextureGLTest::imageBuffer() {
@ -269,7 +270,7 @@ void RectangleTextureGLTest::imageBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE(image.size(), Vector2i(2));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
} }
namespace { namespace {
@ -301,8 +302,8 @@ void RectangleTextureGLTest::subImage() {
CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container);
} }
void RectangleTextureGLTest::subImageBuffer() { void RectangleTextureGLTest::subImageBuffer() {
@ -323,7 +324,7 @@ void RectangleTextureGLTest::subImageBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{SubDataComplete}, TestSuite::Compare::Container);
} }
void RectangleTextureGLTest::subImageQuery() { void RectangleTextureGLTest::subImageQuery() {
@ -344,8 +345,8 @@ void RectangleTextureGLTest::subImageQuery() {
CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.size(), Vector2i{2});
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
} }
void RectangleTextureGLTest::subImageQueryBuffer() { void RectangleTextureGLTest::subImageQueryBuffer() {
@ -366,7 +367,7 @@ void RectangleTextureGLTest::subImageQueryBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.size(), Vector2i{2});
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data}, TestSuite::Compare::Container);
} }
void RectangleTextureGLTest::invalidateImage() { void RectangleTextureGLTest::invalidateImage() {

30
src/Magnum/Test/TextureArrayGLTest.cpp

@ -618,8 +618,8 @@ void TextureArrayGLTest::image1D() {
CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE(image.size(), Vector2i(2));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data1D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data1D}, TestSuite::Compare::Container);
} }
void TextureArrayGLTest::image1DBuffer() { void TextureArrayGLTest::image1DBuffer() {
@ -638,7 +638,7 @@ void TextureArrayGLTest::image1DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE(image.size(), Vector2i(2));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data1D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data1D}, TestSuite::Compare::Container);
} }
#endif #endif
@ -673,8 +673,8 @@ void TextureArrayGLTest::image2D() {
CORRADE_COMPARE(image.size(), Vector3i(2)); CORRADE_COMPARE(image.size(), Vector3i(2));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data2D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data2D}, TestSuite::Compare::Container);
#endif #endif
} }
@ -698,7 +698,7 @@ void TextureArrayGLTest::image2DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i(2)); CORRADE_COMPARE(image.size(), Vector3i(2));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data2D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data2D}, TestSuite::Compare::Container);
#endif #endif
} }
@ -735,8 +735,8 @@ void TextureArrayGLTest::subImage1D() {
CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{SubData1DComplete}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{SubData1DComplete}, TestSuite::Compare::Container);
} }
void TextureArrayGLTest::subImage1DBuffer() { void TextureArrayGLTest::subImage1DBuffer() {
@ -757,7 +757,7 @@ void TextureArrayGLTest::subImage1DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{SubData1DComplete}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{SubData1DComplete}, TestSuite::Compare::Container);
} }
void TextureArrayGLTest::subImage1DQuery() { void TextureArrayGLTest::subImage1DQuery() {
@ -778,7 +778,7 @@ void TextureArrayGLTest::subImage1DQuery() {
CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.size(), Vector2i{2});
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayReference<const UnsignedByte>{Data1D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>{Data1D}, TestSuite::Compare::Container);
} }
void TextureArrayGLTest::subImage1DQueryBuffer() { void TextureArrayGLTest::subImage1DQueryBuffer() {
@ -799,7 +799,7 @@ void TextureArrayGLTest::subImage1DQueryBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.size(), Vector2i{2});
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data1D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data1D}, TestSuite::Compare::Container);
} }
#endif #endif
@ -858,7 +858,7 @@ void TextureArrayGLTest::subImage2D() {
CORRADE_COMPARE(image.size(), Vector3i(4)); CORRADE_COMPARE(image.size(), Vector3i(4));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayReference<const UnsignedByte>{SubData2DComplete}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>{SubData2DComplete}, TestSuite::Compare::Container);
#endif #endif
} }
@ -884,7 +884,7 @@ void TextureArrayGLTest::subImage2DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i(4)); CORRADE_COMPARE(image.size(), Vector3i(4));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{SubData2DComplete}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{SubData2DComplete}, TestSuite::Compare::Container);
#endif #endif
} }
@ -907,7 +907,7 @@ void TextureArrayGLTest::subImage2DQuery() {
CORRADE_COMPARE(image.size(), Vector3i{2}); CORRADE_COMPARE(image.size(), Vector3i{2});
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayReference<const UnsignedByte>{Data2D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>{Data2D}, TestSuite::Compare::Container);
} }
void TextureArrayGLTest::subImage2DQueryBuffer() { void TextureArrayGLTest::subImage2DQueryBuffer() {
@ -928,7 +928,7 @@ void TextureArrayGLTest::subImage2DQueryBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i{2}); CORRADE_COMPARE(image.size(), Vector3i{2});
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data2D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data2D}, TestSuite::Compare::Container);
} }
void TextureArrayGLTest::generateMipmap1D() { void TextureArrayGLTest::generateMipmap1D() {

48
src/Magnum/Test/TextureGLTest.cpp

@ -818,8 +818,8 @@ void TextureGLTest::image1D() {
CORRADE_COMPARE(image.size(), 2); CORRADE_COMPARE(image.size(), 2);
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data1D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data1D}, TestSuite::Compare::Container);
} }
void TextureGLTest::image1DBuffer() { void TextureGLTest::image1DBuffer() {
@ -835,7 +835,7 @@ void TextureGLTest::image1DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), 2); CORRADE_COMPARE(image.size(), 2);
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data1D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data1D}, TestSuite::Compare::Container);
} }
#endif #endif
@ -861,8 +861,8 @@ void TextureGLTest::image2D() {
CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE(image.size(), Vector2i(2));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data2D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data2D}, TestSuite::Compare::Container);
#endif #endif
} }
@ -882,7 +882,7 @@ void TextureGLTest::image2DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE(image.size(), Vector2i(2));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data2D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data2D}, TestSuite::Compare::Container);
#endif #endif
} }
#endif #endif
@ -918,8 +918,8 @@ void TextureGLTest::image3D() {
CORRADE_COMPARE(image.size(), Vector3i(2)); CORRADE_COMPARE(image.size(), Vector3i(2));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{Data3D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{Data3D}, TestSuite::Compare::Container);
#endif #endif
} }
@ -939,7 +939,7 @@ void TextureGLTest::image3DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i(2)); CORRADE_COMPARE(image.size(), Vector3i(2));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data3D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data3D}, TestSuite::Compare::Container);
#endif #endif
} }
#endif #endif
@ -967,8 +967,8 @@ void TextureGLTest::subImage1D() {
CORRADE_COMPARE(image.size(), 4); CORRADE_COMPARE(image.size(), 4);
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{SubData1DComplete}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{SubData1DComplete}, TestSuite::Compare::Container);
} }
void TextureGLTest::subImage1DBuffer() { void TextureGLTest::subImage1DBuffer() {
@ -986,7 +986,7 @@ void TextureGLTest::subImage1DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), 4); CORRADE_COMPARE(image.size(), 4);
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{SubData1DComplete}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{SubData1DComplete}, TestSuite::Compare::Container);
} }
void TextureGLTest::subImage1DQuery() { void TextureGLTest::subImage1DQuery() {
@ -1005,7 +1005,7 @@ void TextureGLTest::subImage1DQuery() {
CORRADE_COMPARE(image.size(), 2); CORRADE_COMPARE(image.size(), 2);
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayReference<const UnsignedByte>{Data1D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>{Data1D}, TestSuite::Compare::Container);
} }
void TextureGLTest::subImage1DQueryBuffer() { void TextureGLTest::subImage1DQueryBuffer() {
@ -1024,7 +1024,7 @@ void TextureGLTest::subImage1DQueryBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), 2); CORRADE_COMPARE(image.size(), 2);
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data1D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data1D}, TestSuite::Compare::Container);
} }
#endif #endif
@ -1055,8 +1055,8 @@ void TextureGLTest::subImage2D() {
CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{SubData2DComplete}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{SubData2DComplete}, TestSuite::Compare::Container);
#endif #endif
} }
@ -1078,7 +1078,7 @@ void TextureGLTest::subImage2DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{SubData2DComplete}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{SubData2DComplete}, TestSuite::Compare::Container);
#endif #endif
} }
#endif #endif
@ -1100,7 +1100,7 @@ void TextureGLTest::subImage2DQuery() {
CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.size(), Vector2i{2});
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayReference<const UnsignedByte>{Data2D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>{Data2D}, TestSuite::Compare::Container);
} }
void TextureGLTest::subImage2DQueryBuffer() { void TextureGLTest::subImage2DQueryBuffer() {
@ -1119,7 +1119,7 @@ void TextureGLTest::subImage2DQueryBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE(image.size(), Vector2i{2});
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data2D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data2D}, TestSuite::Compare::Container);
} }
#endif #endif
@ -1170,8 +1170,8 @@ void TextureGLTest::subImage3D() {
CORRADE_COMPARE(image.size(), Vector3i(4)); CORRADE_COMPARE(image.size(), Vector3i(4));
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
Containers::ArrayReference<const UnsignedByte>{SubData3DComplete}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>{SubData3DComplete}, TestSuite::Compare::Container);
#endif #endif
} }
@ -1193,7 +1193,7 @@ void TextureGLTest::subImage3DBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i(4)); CORRADE_COMPARE(image.size(), Vector3i(4));
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{SubData3DComplete}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{SubData3DComplete}, TestSuite::Compare::Container);
#endif #endif
} }
#endif #endif
@ -1215,7 +1215,7 @@ void TextureGLTest::subImage3DQuery() {
CORRADE_COMPARE(image.size(), Vector3i{2}); CORRADE_COMPARE(image.size(), Vector3i{2});
CORRADE_COMPARE_AS( CORRADE_COMPARE_AS(
Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayReference<const UnsignedByte>{Data3D}, TestSuite::Compare::Container); Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()), Containers::ArrayView<const UnsignedByte>{Data3D}, TestSuite::Compare::Container);
} }
void TextureGLTest::subImage3DQueryBuffer() { void TextureGLTest::subImage3DQueryBuffer() {
@ -1234,7 +1234,7 @@ void TextureGLTest::subImage3DQueryBuffer() {
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector3i{2}); CORRADE_COMPARE(image.size(), Vector3i{2});
CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data3D}, TestSuite::Compare::Container); CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{Data3D}, TestSuite::Compare::Container);
} }
void TextureGLTest::generateMipmap1D() { void TextureGLTest::generateMipmap1D() {

8
src/Magnum/Text/AbstractFont.cpp

@ -38,7 +38,7 @@ AbstractFont::AbstractFont(): _size(0.0f) {}
AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)), _size(0.0f), _lineHeight(0.0f) {} AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)), _size(0.0f), _lineHeight(0.0f) {}
bool AbstractFont::openData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data, const Float size) { bool AbstractFont::openData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data, const Float size) {
CORRADE_ASSERT(features() & Feature::OpenData, CORRADE_ASSERT(features() & Feature::OpenData,
"Text::AbstractFont::openData(): feature not supported", false); "Text::AbstractFont::openData(): feature not supported", false);
CORRADE_ASSERT(!data.empty(), CORRADE_ASSERT(!data.empty(),
@ -50,7 +50,7 @@ bool AbstractFont::openData(const std::vector<std::pair<std::string, Containers:
return isOpened(); return isOpened();
} }
std::pair<Float, Float> AbstractFont::doOpenData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data, const Float size) { std::pair<Float, Float> AbstractFont::doOpenData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data, const Float size) {
CORRADE_ASSERT(!(features() & Feature::MultiFile), CORRADE_ASSERT(!(features() & Feature::MultiFile),
"Text::AbstractFont::openData(): feature advertised but not implemented", {}); "Text::AbstractFont::openData(): feature advertised but not implemented", {});
CORRADE_ASSERT(data.size() == 1, CORRADE_ASSERT(data.size() == 1,
@ -60,7 +60,7 @@ std::pair<Float, Float> AbstractFont::doOpenData(const std::vector<std::pair<std
return doOpenSingleData(data[0].second, size); return doOpenSingleData(data[0].second, size);
} }
bool AbstractFont::openSingleData(const Containers::ArrayReference<const char> data, const Float size) { bool AbstractFont::openSingleData(const Containers::ArrayView<const char> data, const Float size) {
CORRADE_ASSERT(features() & Feature::OpenData, CORRADE_ASSERT(features() & Feature::OpenData,
"Text::AbstractFont::openSingleData(): feature not supported", false); "Text::AbstractFont::openSingleData(): feature not supported", false);
CORRADE_ASSERT(!(features() & Feature::MultiFile), CORRADE_ASSERT(!(features() & Feature::MultiFile),
@ -72,7 +72,7 @@ bool AbstractFont::openSingleData(const Containers::ArrayReference<const char> d
return isOpened(); return isOpened();
} }
std::pair<Float, Float> AbstractFont::doOpenSingleData(Containers::ArrayReference<const char>, Float) { std::pair<Float, Float> AbstractFont::doOpenSingleData(Containers::ArrayView<const char>, Float) {
CORRADE_ASSERT(false, "Text::AbstractFont::openSingleData(): feature advertised but not implemented", {}); CORRADE_ASSERT(false, "Text::AbstractFont::openSingleData(): feature advertised but not implemented", {});
return {}; return {};
} }

8
src/Magnum/Text/AbstractFont.h

@ -125,7 +125,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
* file. Available only if @ref Feature::OpenData is supported. Returns * file. Available only if @ref Feature::OpenData is supported. Returns
* `true` on success, `false` otherwise. * `true` on success, `false` otherwise.
*/ */
bool openData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data, Float size); bool openData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data, Float size);
/** /**
* @brief Open font from single data * @brief Open font from single data
@ -137,7 +137,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
* plugin doesn't have @ref Feature::MultiFile. Returns `true` on * plugin doesn't have @ref Feature::MultiFile. Returns `true` on
* success, `false` otherwise. * success, `false` otherwise.
*/ */
bool openSingleData(Containers::ArrayReference<const char> data, Float size); bool openSingleData(Containers::ArrayView<const char> data, Float size);
/** /**
* @brief Open font from file * @brief Open font from file
@ -243,7 +243,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
* zeros otherwise. If the plugin doesn't have @ref Feature::MultiFile, * zeros otherwise. If the plugin doesn't have @ref Feature::MultiFile,
* default implementation calls @ref doOpenSingleData(). * default implementation calls @ref doOpenSingleData().
*/ */
virtual std::pair<Float, Float> doOpenData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data, Float size); virtual std::pair<Float, Float> doOpenData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data, Float size);
/** /**
* @brief Implementation for @ref openSingleData() * @brief Implementation for @ref openSingleData()
@ -251,7 +251,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
* Return size and line height of opened font on successful opening, * Return size and line height of opened font on successful opening,
* zeros otherwise. * zeros otherwise.
*/ */
virtual std::pair<Float, Float> doOpenSingleData(Containers::ArrayReference<const char> data, Float size); virtual std::pair<Float, Float> doOpenSingleData(Containers::ArrayView<const char> data, Float size);
/** /**
* @brief Implementation for @ref openFile() * @brief Implementation for @ref openFile()

8
src/Magnum/Text/AbstractFontConverter.cpp

@ -182,7 +182,7 @@ bool AbstractFontConverter::doExportGlyphCacheToFile(GlyphCache& cache, const st
return true; return true;
} }
std::unique_ptr<GlyphCache> AbstractFontConverter::importGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data) const { std::unique_ptr<GlyphCache> AbstractFontConverter::importGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data) const {
CORRADE_ASSERT(features() >= (Feature::ImportGlyphCache|Feature::ConvertData), CORRADE_ASSERT(features() >= (Feature::ImportGlyphCache|Feature::ConvertData),
"Text::AbstractFontConverter::importGlyphCacheFromData(): feature not supported", nullptr); "Text::AbstractFontConverter::importGlyphCacheFromData(): feature not supported", nullptr);
CORRADE_ASSERT(!data.empty(), CORRADE_ASSERT(!data.empty(),
@ -191,7 +191,7 @@ std::unique_ptr<GlyphCache> AbstractFontConverter::importGlyphCacheFromData(cons
return doImportGlyphCacheFromData(data); return doImportGlyphCacheFromData(data);
} }
std::unique_ptr<GlyphCache> AbstractFontConverter::doImportGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data) const { std::unique_ptr<GlyphCache> AbstractFontConverter::doImportGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data) const {
CORRADE_ASSERT(!(features() & Feature::MultiFile), CORRADE_ASSERT(!(features() & Feature::MultiFile),
"Text::AbstractFontConverter::importGlyphCacheFromData(): feature advertised but not implemented", nullptr); "Text::AbstractFontConverter::importGlyphCacheFromData(): feature advertised but not implemented", nullptr);
CORRADE_ASSERT(data.size() == 1, CORRADE_ASSERT(data.size() == 1,
@ -200,7 +200,7 @@ std::unique_ptr<GlyphCache> AbstractFontConverter::doImportGlyphCacheFromData(co
return doImportGlyphCacheFromSingleData(data[0].second); return doImportGlyphCacheFromSingleData(data[0].second);
} }
std::unique_ptr<GlyphCache> AbstractFontConverter::importGlyphCacheFromSingleData(Containers::ArrayReference<const char> data) const { std::unique_ptr<GlyphCache> AbstractFontConverter::importGlyphCacheFromSingleData(Containers::ArrayView<const char> data) const {
CORRADE_ASSERT(features() >= (Feature::ImportGlyphCache|Feature::ConvertData), CORRADE_ASSERT(features() >= (Feature::ImportGlyphCache|Feature::ConvertData),
"Text::AbstractFontConverter::importGlyphCacheFromSingleData(): feature not supported", nullptr); "Text::AbstractFontConverter::importGlyphCacheFromSingleData(): feature not supported", nullptr);
CORRADE_ASSERT(!(features() & Feature::MultiFile), CORRADE_ASSERT(!(features() & Feature::MultiFile),
@ -209,7 +209,7 @@ std::unique_ptr<GlyphCache> AbstractFontConverter::importGlyphCacheFromSingleDat
return doImportGlyphCacheFromSingleData(data); return doImportGlyphCacheFromSingleData(data);
} }
std::unique_ptr<GlyphCache> AbstractFontConverter::doImportGlyphCacheFromSingleData(Containers::ArrayReference<const char>) const { std::unique_ptr<GlyphCache> AbstractFontConverter::doImportGlyphCacheFromSingleData(Containers::ArrayView<const char>) const {
CORRADE_ASSERT(false, CORRADE_ASSERT(false,
"Text::AbstractFontConverter::importGlyphCacheFromSingleData(): feature advertised but not implemented", nullptr); "Text::AbstractFontConverter::importGlyphCacheFromSingleData(): feature advertised but not implemented", nullptr);
return nullptr; return nullptr;

8
src/Magnum/Text/AbstractFontConverter.h

@ -232,7 +232,7 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
* @see @ref features(), @ref importGlyphCacheFromFile(), * @see @ref features(), @ref importGlyphCacheFromFile(),
* @ref exportGlyphCacheToData() * @ref exportGlyphCacheToData()
*/ */
std::unique_ptr<GlyphCache> importGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data) const; std::unique_ptr<GlyphCache> importGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data) const;
/** /**
* @brief Import glyph cache from single raw data * @brief Import glyph cache from single raw data
@ -244,7 +244,7 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
* @see @ref features(), @ref importGlyphCacheFromFile(), * @see @ref features(), @ref importGlyphCacheFromFile(),
* @ref exportFontToSingleData() * @ref exportFontToSingleData()
*/ */
std::unique_ptr<GlyphCache> importGlyphCacheFromSingleData(Containers::ArrayReference<const char> data) const; std::unique_ptr<GlyphCache> importGlyphCacheFromSingleData(Containers::ArrayView<const char> data) const;
/** /**
* @brief Import glyph cache from file * @brief Import glyph cache from file
@ -337,10 +337,10 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
* If the plugin doesn't have @ref Feature::MultiFile, default * If the plugin doesn't have @ref Feature::MultiFile, default
* implementation calls @ref doImportGlyphCacheFromSingleData(). * implementation calls @ref doImportGlyphCacheFromSingleData().
*/ */
virtual std::unique_ptr<GlyphCache> doImportGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data) const; virtual std::unique_ptr<GlyphCache> doImportGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data) const;
/** @brief Implementation for @ref importGlyphCacheFromSingleData() */ /** @brief Implementation for @ref importGlyphCacheFromSingleData() */
virtual std::unique_ptr<GlyphCache> doImportGlyphCacheFromSingleData(Containers::ArrayReference<const char> data) const; virtual std::unique_ptr<GlyphCache> doImportGlyphCacheFromSingleData(Containers::ArrayView<const char> data) const;
/** /**
* @brief Implementation for @ref importGlyphCacheFromFile() * @brief Implementation for @ref importGlyphCacheFromFile()

2
src/Magnum/Text/Renderer.cpp

@ -387,7 +387,7 @@ void AbstractRenderer::render(const std::string& text) {
"Text::Renderer::render(): capacity" << _capacity << "too small to render" << glyphCount << "glyphs", ); "Text::Renderer::render(): capacity" << _capacity << "too small to render" << glyphCount << "glyphs", );
/* Interleave the data into mapped buffer*/ /* Interleave the data into mapped buffer*/
Containers::ArrayReference<Vertex> vertices(static_cast<Vertex*>(bufferMapImplementation(_vertexBuffer, Containers::ArrayView<Vertex> vertices(static_cast<Vertex*>(bufferMapImplementation(_vertexBuffer,
vertexCount*sizeof(Vertex))), vertexCount); vertexCount*sizeof(Vertex))), vertexCount);
CORRADE_INTERNAL_ASSERT_OUTPUT(vertices); CORRADE_INTERNAL_ASSERT_OUTPUT(vertices);
std::copy(vertexData.begin(), vertexData.end(), vertices.begin()); std::copy(vertexData.begin(), vertexData.end(), vertices.begin());

2
src/Magnum/Text/Test/AbstractFontConverterTest.cpp

@ -228,7 +228,7 @@ class SingleGlyphCacheDataImporter: public Text::AbstractFontConverter {
private: private:
Features doFeatures() const override { return Feature::ConvertData|Feature::ImportGlyphCache; } Features doFeatures() const override { return Feature::ConvertData|Feature::ImportGlyphCache; }
std::unique_ptr<GlyphCache> doImportGlyphCacheFromSingleData(const Containers::ArrayReference<const char> data) const override { std::unique_ptr<GlyphCache> doImportGlyphCacheFromSingleData(const Containers::ArrayView<const char> data) const override {
if(data.size() == 1 && data[0] == '\xa5') if(data.size() == 1 && data[0] == '\xa5')
return std::unique_ptr<GlyphCache>(reinterpret_cast<GlyphCache*>(0xdeadbeef)); return std::unique_ptr<GlyphCache>(reinterpret_cast<GlyphCache*>(0xdeadbeef));
return nullptr; return nullptr;

4
src/Magnum/Text/Test/AbstractFontTest.cpp

@ -23,7 +23,7 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include <Corrade/TestSuite/Tester.h> #include <Corrade/TestSuite/Tester.h>
#include <Corrade/Utility/Directory.h> #include <Corrade/Utility/Directory.h>
@ -56,7 +56,7 @@ class SingleDataFont: public Text::AbstractFont {
bool doIsOpened() const override { return opened; } bool doIsOpened() const override { return opened; }
void doClose() override {} void doClose() override {}
std::pair<Float, Float> doOpenSingleData(const Containers::ArrayReference<const char> data, Float) override { std::pair<Float, Float> doOpenSingleData(const Containers::ArrayView<const char> data, Float) override {
opened = (data.size() == 1 && data[0] == '\xa5'); opened = (data.size() == 1 && data[0] == '\xa5');
return {}; return {};
} }

4
src/Magnum/Trade/AbstractImporter.cpp

@ -49,7 +49,7 @@ AbstractImporter::AbstractImporter(PluginManager::Manager<AbstractImporter>& man
AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin): PluginManager::AbstractManagingPlugin<AbstractImporter>(manager, std::move(plugin)) {} AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin): PluginManager::AbstractManagingPlugin<AbstractImporter>(manager, std::move(plugin)) {}
bool AbstractImporter::openData(Containers::ArrayReference<const char> data) { bool AbstractImporter::openData(Containers::ArrayView<const char> data) {
CORRADE_ASSERT(features() & Feature::OpenData, CORRADE_ASSERT(features() & Feature::OpenData,
"Trade::AbstractImporter::openData(): feature not supported", {}); "Trade::AbstractImporter::openData(): feature not supported", {});
@ -58,7 +58,7 @@ bool AbstractImporter::openData(Containers::ArrayReference<const char> data) {
return isOpened(); return isOpened();
} }
void AbstractImporter::doOpenData(Containers::ArrayReference<const char>) { void AbstractImporter::doOpenData(Containers::ArrayView<const char>) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::openData(): feature advertised but not implemented", ); CORRADE_ASSERT(false, "Trade::AbstractImporter::openData(): feature advertised but not implemented", );
} }

4
src/Magnum/Trade/AbstractImporter.h

@ -116,7 +116,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlug
* `true` on success, `false` otherwise. * `true` on success, `false` otherwise.
* @see @ref features(), @ref openFile() * @see @ref features(), @ref openFile()
*/ */
bool openData(Containers::ArrayReference<const char> data); bool openData(Containers::ArrayView<const char> data);
/** /**
* @brief Open file * @brief Open file
@ -494,7 +494,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlug
virtual bool doIsOpened() const = 0; virtual bool doIsOpened() const = 0;
/** @brief Implementation for @ref openData() */ /** @brief Implementation for @ref openData() */
virtual void doOpenData(Containers::ArrayReference<const char> data); virtual void doOpenData(Containers::ArrayView<const char> data);
/** @brief Implementation for @ref close() */ /** @brief Implementation for @ref close() */
virtual void doClose() = 0; virtual void doClose() = 0;

4
src/Magnum/Trade/Test/AbstractImporterTest.cpp

@ -23,7 +23,7 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include <Corrade/TestSuite/Tester.h> #include <Corrade/TestSuite/Tester.h>
#include <Corrade/Utility/Directory.h> #include <Corrade/Utility/Directory.h>
@ -54,7 +54,7 @@ void AbstractImporterTest::openFile() {
bool doIsOpened() const override { return opened; } bool doIsOpened() const override { return opened; }
void doClose() override {} void doClose() override {}
void doOpenData(Containers::ArrayReference<const char> data) override { void doOpenData(Containers::ArrayView<const char> data) override {
opened = (data.size() == 1 && data[0] == '\xa5'); opened = (data.size() == 1 && data[0] == '\xa5');
} }

8
src/Magnum/TransformFeedback.cpp

@ -152,7 +152,7 @@ std::string TransformFeedback::label() {
return Context::current()->state().debug->getLabelImplementation(GL_TRANSFORM_FEEDBACK, _id); return Context::current()->state().debug->getLabelImplementation(GL_TRANSFORM_FEEDBACK, _id);
} }
TransformFeedback& TransformFeedback::setLabelInternal(const Containers::ArrayReference<const char> label) { TransformFeedback& TransformFeedback::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready(); createIfNotAlready();
Context::current()->state().debug->labelImplementation(GL_TRANSFORM_FEEDBACK, _id, label); Context::current()->state().debug->labelImplementation(GL_TRANSFORM_FEEDBACK, _id, label);
return *this; return *this;
@ -210,7 +210,7 @@ void TransformFeedback::attachImplementationFallback(const GLuint firstIndex, st
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
/** @todoc const Containers::ArrayReference makes Doxygen grumpy */ /** @todoc const Containers::ArrayView makes Doxygen grumpy */
void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, std::initializer_list<std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) { void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, std::initializer_list<std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) {
for(std::size_t i = 0; i != buffers.size(); ++i) { for(std::size_t i = 0; i != buffers.size(); ++i) {
Buffer* buffer; Buffer* buffer;
@ -223,14 +223,14 @@ void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, std::in
} }
#endif #endif
/** @todoc const Containers::ArrayReference makes Doxygen grumpy */ /** @todoc const Containers::ArrayView makes Doxygen grumpy */
void TransformFeedback::attachImplementationFallback(const GLuint firstIndex, std::initializer_list<Buffer*> buffers) { void TransformFeedback::attachImplementationFallback(const GLuint firstIndex, std::initializer_list<Buffer*> buffers) {
bindInternal(); bindInternal();
Buffer::bind(Buffer::Target(GL_TRANSFORM_FEEDBACK_BUFFER), firstIndex, buffers); Buffer::bind(Buffer::Target(GL_TRANSFORM_FEEDBACK_BUFFER), firstIndex, buffers);
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
/** @todoc const Containers::ArrayReference makes Doxygen grumpy */ /** @todoc const Containers::ArrayView makes Doxygen grumpy */
void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, std::initializer_list<Buffer*> buffers) { void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, std::initializer_list<Buffer*> buffers) {
for(std::size_t i = 0; i != buffers.size(); ++i) for(std::size_t i = 0; i != buffers.size(); ++i)
glTransformFeedbackBufferBase(_id, firstIndex + i, *(buffers.begin() + i) ? (*(buffers.begin() + i))->id() : 0); glTransformFeedbackBufferBase(_id, firstIndex + i, *(buffers.begin() + i) ? (*(buffers.begin() + i))->id() : 0);

4
src/Magnum/TransformFeedback.h

@ -25,7 +25,7 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include "Magnum/AbstractObject.h" #include "Magnum/AbstractObject.h"
@ -398,7 +398,7 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
TransformFeedback& setLabelInternal(Containers::ArrayReference<const char> label); TransformFeedback& setLabelInternal(Containers::ArrayView<const char> label);
#endif #endif
GLuint _id; GLuint _id;

4
src/MagnumPlugins/MagnumFont/MagnumFont.cpp

@ -26,7 +26,7 @@
#include "MagnumFont.h" #include "MagnumFont.h"
#include <sstream> #include <sstream>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include <Corrade/Utility/Directory.h> #include <Corrade/Utility/Directory.h>
#include <Corrade/Utility/Unicode.h> #include <Corrade/Utility/Unicode.h>
@ -68,7 +68,7 @@ auto MagnumFont::doFeatures() const -> Features { return Feature::OpenData|Featu
bool MagnumFont::doIsOpened() const { return _opened; } bool MagnumFont::doIsOpened() const { return _opened; }
std::pair<Float, Float> MagnumFont::doOpenData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data, const Float) { std::pair<Float, Float> MagnumFont::doOpenData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data, const Float) {
/* We need just the configuration file and image file */ /* We need just the configuration file and image file */
if(data.size() != 2) { if(data.size() != 2) {
Error() << "Text::MagnumFont::openData(): wanted two files, got" << data.size(); Error() << "Text::MagnumFont::openData(): wanted two files, got" << data.size();

2
src/MagnumPlugins/MagnumFont/MagnumFont.h

@ -120,7 +120,7 @@ class MagnumFont: public AbstractFont {
bool doIsOpened() const override; bool doIsOpened() const override;
std::pair<Float, Float> doOpenData(const std::vector<std::pair<std::string, Containers::ArrayReference<const char>>>& data, Float) override; std::pair<Float, Float> doOpenData(const std::vector<std::pair<std::string, Containers::ArrayView<const char>>>& data, Float) override;
std::pair<Float, Float> doOpenFile(const std::string& filename, Float) override; std::pair<Float, Float> doOpenFile(const std::string& filename, Float) override;

4
src/MagnumPlugins/ObjImporter/ObjImporter.cpp

@ -29,7 +29,7 @@
#include <limits> #include <limits>
#include <sstream> #include <sstream>
#include <unordered_map> #include <unordered_map>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include <Corrade/Utility/String.h> #include <Corrade/Utility/String.h>
#include "Magnum/Mesh.h" #include "Magnum/Mesh.h"
@ -132,7 +132,7 @@ void ObjImporter::doOpenFile(const std::string& filename) {
parseMeshNames(); parseMeshNames();
} }
void ObjImporter::doOpenData(Containers::ArrayReference<const char> data) { void ObjImporter::doOpenData(Containers::ArrayView<const char> data) {
/* Open file in *text* mode (to avoid \r handling) */ /* Open file in *text* mode (to avoid \r handling) */
_file.reset(new File); _file.reset(new File);
_file->in.reset(new std::istringstream{{data.begin(), data.size()}}); _file->in.reset(new std::istringstream{{data.begin(), data.size()}});

2
src/MagnumPlugins/ObjImporter/ObjImporter.h

@ -67,7 +67,7 @@ class ObjImporter: public AbstractImporter {
Features doFeatures() const override; Features doFeatures() const override;
bool doIsOpened() const override; bool doIsOpened() const override;
void doOpenData(Containers::ArrayReference<const char> data) override; void doOpenData(Containers::ArrayView<const char> data) override;
void doOpenFile(const std::string& filename) override; void doOpenFile(const std::string& filename) override;
void doClose() override; void doClose() override;

2
src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp

@ -24,7 +24,7 @@
*/ */
#include <sstream> #include <sstream>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include <Corrade/TestSuite/Tester.h> #include <Corrade/TestSuite/Tester.h>
#include <Corrade/Utility/Directory.h> #include <Corrade/Utility/Directory.h>

4
src/MagnumPlugins/TgaImporter/TgaImporter.cpp

@ -29,7 +29,7 @@
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <Corrade/Utility/Endianness.h> #include <Corrade/Utility/Endianness.h>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include "Magnum/ColorFormat.h" #include "Magnum/ColorFormat.h"
#include "Magnum/Math/Swizzle.h" #include "Magnum/Math/Swizzle.h"
@ -54,7 +54,7 @@ auto TgaImporter::doFeatures() const -> Features { return Feature::OpenData; }
bool TgaImporter::doIsOpened() const { return in; } bool TgaImporter::doIsOpened() const { return in; }
void TgaImporter::doOpenData(const Containers::ArrayReference<const char> data) { void TgaImporter::doOpenData(const Containers::ArrayView<const char> data) {
in = new std::istringstream{{data, data.size()}}; in = new std::istringstream{{data, data.size()}};
} }

2
src/MagnumPlugins/TgaImporter/TgaImporter.h

@ -81,7 +81,7 @@ class MAGNUM_TGAIMPORTER_EXPORT TgaImporter: public AbstractImporter {
private: private:
Features MAGNUM_TGAIMPORTER_LOCAL doFeatures() const override; Features MAGNUM_TGAIMPORTER_LOCAL doFeatures() const override;
bool MAGNUM_TGAIMPORTER_LOCAL doIsOpened() const override; bool MAGNUM_TGAIMPORTER_LOCAL doIsOpened() const override;
void MAGNUM_TGAIMPORTER_LOCAL doOpenData(Containers::ArrayReference<const char> data) override; void MAGNUM_TGAIMPORTER_LOCAL doOpenData(Containers::ArrayView<const char> data) override;
void MAGNUM_TGAIMPORTER_LOCAL doOpenFile(const std::string& filename) override; void MAGNUM_TGAIMPORTER_LOCAL doOpenFile(const std::string& filename) override;
void MAGNUM_TGAIMPORTER_LOCAL doClose() override; void MAGNUM_TGAIMPORTER_LOCAL doClose() override;
UnsignedInt MAGNUM_TGAIMPORTER_LOCAL doImage2DCount() const override; UnsignedInt MAGNUM_TGAIMPORTER_LOCAL doImage2DCount() const override;

2
src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp

@ -24,7 +24,7 @@
*/ */
#include <sstream> #include <sstream>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayView.h>
#include <Corrade/TestSuite/Tester.h> #include <Corrade/TestSuite/Tester.h>
#include <Corrade/Utility/Directory.h> #include <Corrade/Utility/Directory.h>

2
src/MagnumPlugins/WavAudioImporter/WavImporter.cpp

@ -43,7 +43,7 @@ auto WavImporter::doFeatures() const -> Features { return Feature::OpenData; }
bool WavImporter::doIsOpened() const { return _data; } bool WavImporter::doIsOpened() const { return _data; }
void WavImporter::doOpenData(Containers::ArrayReference<const char> data) { void WavImporter::doOpenData(Containers::ArrayView<const char> data) {
/* Check file size */ /* Check file size */
if(data.size() < sizeof(WavHeader)) { if(data.size() < sizeof(WavHeader)) {
Error() << "Audio::WavImporter::openData(): the file is too short:" << data.size() << "bytes"; Error() << "Audio::WavImporter::openData(): the file is too short:" << data.size() << "bytes";

2
src/MagnumPlugins/WavAudioImporter/WavImporter.h

@ -62,7 +62,7 @@ class WavImporter: public AbstractImporter {
private: private:
Features doFeatures() const override; Features doFeatures() const override;
bool doIsOpened() const override; bool doIsOpened() const override;
void doOpenData(Containers::ArrayReference<const char> data) override; void doOpenData(Containers::ArrayView<const char> data) override;
void doClose() override; void doClose() override;
Buffer::Format doFormat() const override; Buffer::Format doFormat() const override;

Loading…
Cancel
Save