diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-05-31 02:35:10 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-06-01 13:53:39 +0300 |
commit | 2038a21cb5d67890acafbd34bc55e365ed0043fe (patch) | |
tree | 78551ce4bd635966c1d1e22ad360731ec9da352f /src/mbgl/gl | |
parent | a3e0c60a7c322c9040cfcf880cc7ca4956cf9e12 (diff) | |
download | qtlocation-mapboxgl-2038a21cb5d67890acafbd34bc55e365ed0043fe.tar.gz |
[core] s/GLObjectStore/ObjectStore/
Diffstat (limited to 'src/mbgl/gl')
-rw-r--r-- | src/mbgl/gl/object_store.cpp (renamed from src/mbgl/gl/gl_object_store.cpp) | 18 | ||||
-rw-r--r-- | src/mbgl/gl/object_store.hpp (renamed from src/mbgl/gl/gl_object_store.hpp) | 20 | ||||
-rw-r--r-- | src/mbgl/gl/texture_pool.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/gl/texture_pool.hpp | 8 |
4 files changed, 26 insertions, 26 deletions
diff --git a/src/mbgl/gl/gl_object_store.cpp b/src/mbgl/gl/object_store.cpp index 040109d011..f52cc26f85 100644 --- a/src/mbgl/gl/gl_object_store.cpp +++ b/src/mbgl/gl/object_store.cpp @@ -1,11 +1,11 @@ -#include <mbgl/gl/gl_object_store.hpp> +#include <mbgl/gl/object_store.hpp> #include <cassert> namespace mbgl { namespace gl { -void ProgramHolder::create(GLObjectStore& objectStore_) { +void ProgramHolder::create(ObjectStore& objectStore_) { if (created()) return; objectStore = &objectStore_; id = MBGL_CHECK_ERROR(glCreateProgram()); @@ -17,7 +17,7 @@ void ProgramHolder::reset() { id = 0; } -void ShaderHolder::create(GLObjectStore& objectStore_) { +void ShaderHolder::create(ObjectStore& objectStore_) { if (created()) return; objectStore = &objectStore_; id = MBGL_CHECK_ERROR(glCreateShader(type)); @@ -29,7 +29,7 @@ void ShaderHolder::reset() { id = 0; } -void BufferHolder::create(GLObjectStore& objectStore_) { +void BufferHolder::create(ObjectStore& objectStore_) { if (created()) return; objectStore = &objectStore_; MBGL_CHECK_ERROR(glGenBuffers(1, &id)); @@ -41,7 +41,7 @@ void BufferHolder::reset() { id = 0; } -void TextureHolder::create(GLObjectStore& objectStore_) { +void TextureHolder::create(ObjectStore& objectStore_) { if (created()) return; objectStore = &objectStore_; MBGL_CHECK_ERROR(glGenTextures(1, &id)); @@ -53,7 +53,7 @@ void TextureHolder::reset() { id = 0; } -void TexturePoolHolder::create(GLObjectStore& objectStore_) { +void TexturePoolHolder::create(ObjectStore& objectStore_) { if (created()) return; objectStore = &objectStore_; MBGL_CHECK_ERROR(glGenTextures(TextureMax, ids.data())); @@ -68,7 +68,7 @@ void TexturePoolHolder::reset() { }; } -void VAOHolder::create(GLObjectStore& objectStore_) { +void VAOHolder::create(ObjectStore& objectStore_) { if (created()) return; objectStore = &objectStore_; MBGL_CHECK_ERROR(gl::GenVertexArrays(1, &id)); @@ -80,7 +80,7 @@ void VAOHolder::reset() { id = 0; } -GLObjectStore::~GLObjectStore() { +ObjectStore::~ObjectStore() { assert(abandonedPrograms.empty()); assert(abandonedShaders.empty()); assert(abandonedBuffers.empty()); @@ -88,7 +88,7 @@ GLObjectStore::~GLObjectStore() { assert(abandonedVAOs.empty()); } -void GLObjectStore::performCleanup() { +void ObjectStore::performCleanup() { for (GLuint id : abandonedPrograms) { MBGL_CHECK_ERROR(glDeleteProgram(id)); } diff --git a/src/mbgl/gl/gl_object_store.hpp b/src/mbgl/gl/object_store.hpp index 2527bbf332..a92f082b76 100644 --- a/src/mbgl/gl/gl_object_store.hpp +++ b/src/mbgl/gl/object_store.hpp @@ -11,9 +11,9 @@ namespace mbgl { namespace gl { -class GLObjectStore : private util::noncopyable { +class ObjectStore : private util::noncopyable { public: - ~GLObjectStore(); + ~ObjectStore(); // Actually remove the objects we marked as abandoned with the above methods. // Only call this while the OpenGL context is exclusive to this thread. @@ -46,7 +46,7 @@ public: protected: GLuint id = 0; - GLObjectStore* objectStore = nullptr; + ObjectStore* objectStore = nullptr; }; class ProgramHolder : public GLHolder { @@ -57,7 +57,7 @@ public: ProgramHolder(ProgramHolder&& o) noexcept : GLHolder(std::move(o)) {} ProgramHolder& operator=(ProgramHolder&& o) noexcept { GLHolder::operator=(std::move(o)); return *this; } - void create(GLObjectStore&); + void create(ObjectStore&); void reset(); }; @@ -69,7 +69,7 @@ public: ShaderHolder(ShaderHolder&& o) noexcept : GLHolder(std::move(o)), type(o.type) {} ShaderHolder& operator=(ShaderHolder&& o) noexcept { GLHolder::operator=(std::move(o)); type = o.type; return *this; } - void create(GLObjectStore&); + void create(ObjectStore&); void reset(); private: @@ -84,7 +84,7 @@ public: BufferHolder(BufferHolder&& o) noexcept : GLHolder(std::move(o)) {} BufferHolder& operator=(BufferHolder&& o) noexcept { GLHolder::operator=(std::move(o)); return *this; } - void create(GLObjectStore&); + void create(ObjectStore&); void reset(); }; @@ -96,7 +96,7 @@ public: TextureHolder(TextureHolder&& o) noexcept : GLHolder(std::move(o)) {} TextureHolder& operator=(TextureHolder&& o) noexcept { GLHolder::operator=(std::move(o)); return *this; } - void create(GLObjectStore&); + void create(ObjectStore&); void reset(); }; @@ -114,12 +114,12 @@ public: const std::array<GLuint, TextureMax>& getIDs() const { return ids; } const GLuint& operator[](size_t pos) { return ids[pos]; } - void create(GLObjectStore&); + void create(ObjectStore&); void reset(); private: std::array<GLuint, TextureMax> ids; - GLObjectStore* objectStore = nullptr; + ObjectStore* objectStore = nullptr; }; class VAOHolder : public GLHolder { @@ -130,7 +130,7 @@ public: VAOHolder(VAOHolder&& o) noexcept : GLHolder(std::move(o)) {} VAOHolder& operator=(VAOHolder&& o) noexcept { GLHolder::operator=(std::move(o)); return *this; } - void create(GLObjectStore&); + void create(ObjectStore&); void reset(); }; diff --git a/src/mbgl/gl/texture_pool.cpp b/src/mbgl/gl/texture_pool.cpp index a875f4d579..c04f781daa 100644 --- a/src/mbgl/gl/texture_pool.cpp +++ b/src/mbgl/gl/texture_pool.cpp @@ -1,12 +1,12 @@ #include <mbgl/gl/texture_pool.hpp> -#include <mbgl/gl/gl_object_store.hpp> +#include <mbgl/gl/object_store.hpp> #include <vector> namespace mbgl { namespace gl { -GLuint TexturePool::getTextureID(gl::GLObjectStore& glObjectStore) { +GLuint TexturePool::getTextureID(gl::ObjectStore& store) { for (auto& impl : pools) { if (impl.ids.empty()) continue; auto it = impl.ids.begin(); @@ -16,7 +16,7 @@ GLuint TexturePool::getTextureID(gl::GLObjectStore& glObjectStore) { } // All texture IDs are in use. - pools.emplace_back(Impl(glObjectStore)); + pools.emplace_back(Impl(store)); auto it = pools.back().ids.begin(); GLuint id = *it; pools.back().ids.erase(it); diff --git a/src/mbgl/gl/texture_pool.hpp b/src/mbgl/gl/texture_pool.hpp index 10894f146e..2c5610cf4a 100644 --- a/src/mbgl/gl/texture_pool.hpp +++ b/src/mbgl/gl/texture_pool.hpp @@ -2,7 +2,7 @@ #include <mbgl/util/noncopyable.hpp> #include <mbgl/gl/gl.hpp> -#include <mbgl/gl/gl_object_store.hpp> +#include <mbgl/gl/object_store.hpp> #include <algorithm> #include <memory> @@ -13,14 +13,14 @@ namespace gl { class TexturePool : private util::noncopyable { public: - GLuint getTextureID(gl::GLObjectStore&); + GLuint getTextureID(gl::ObjectStore&); void releaseTextureID(GLuint); private: class Impl : private util::noncopyable { public: - Impl(gl::GLObjectStore& glObjectStore) : ids(gl::TexturePoolHolder::TextureMax) { - pool.create(glObjectStore); + Impl(gl::ObjectStore& store) : ids(gl::TexturePoolHolder::TextureMax) { + pool.create(store); std::copy(pool.getIDs().begin(), pool.getIDs().end(), ids.begin()); } |