[gl] Moved GLObjectStore to gl namespace
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <mbgl/gl/gl.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/util/gl_object_store.hpp>
|
||||
#include <mbgl/gl/gl_object_store.hpp>
|
||||
#include <mbgl/util/noncopyable.hpp>
|
||||
#include <mbgl/util/thread_context.hpp>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <mbgl/gl/gl.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/platform/platform.hpp>
|
||||
#include <mbgl/util/gl_object_store.hpp>
|
||||
#include <mbgl/gl/gl_object_store.hpp>
|
||||
#include <mbgl/util/thread_context.hpp>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <mbgl/gl/gl.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/platform/platform.hpp>
|
||||
#include <mbgl/util/gl_object_store.hpp>
|
||||
#include <mbgl/gl/gl_object_store.hpp>
|
||||
#include <mbgl/util/thread_context.hpp>
|
||||
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <mbgl/geometry/vao.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/util/gl_object_store.hpp>
|
||||
#include <mbgl/gl/gl_object_store.hpp>
|
||||
#include <mbgl/util/string.hpp>
|
||||
#include <mbgl/util/thread_context.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <mbgl/util/gl_object_store.hpp>
|
||||
#include <mbgl/gl/gl_object_store.hpp>
|
||||
|
||||
#include <mbgl/util/thread.hpp>
|
||||
#include <mbgl/geometry/vao.hpp>
|
||||
@@ -7,25 +7,25 @@
|
||||
#include <cassert>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
namespace gl {
|
||||
|
||||
void GLObjectStore::abandonVAO(GLuint vao) {
|
||||
assert(ThreadContext::currentlyOn(ThreadType::Map));
|
||||
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
|
||||
abandonedVAOs.emplace_back(vao);
|
||||
}
|
||||
|
||||
void GLObjectStore::abandonBuffer(GLuint buffer) {
|
||||
assert(ThreadContext::currentlyOn(ThreadType::Map));
|
||||
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
|
||||
abandonedBuffers.emplace_back(buffer);
|
||||
}
|
||||
|
||||
void GLObjectStore::abandonTexture(GLuint texture) {
|
||||
assert(ThreadContext::currentlyOn(ThreadType::Map));
|
||||
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
|
||||
abandonedTextures.emplace_back(texture);
|
||||
}
|
||||
|
||||
void GLObjectStore::performCleanup() {
|
||||
assert(ThreadContext::currentlyOn(ThreadType::Map));
|
||||
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
|
||||
|
||||
if (!abandonedVAOs.empty()) {
|
||||
MBGL_CHECK_ERROR(VertexArrayObject::Delete(static_cast<GLsizei>(abandonedVAOs.size()),
|
||||
@@ -46,5 +46,5 @@ void GLObjectStore::performCleanup() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace gl
|
||||
} // namespace mbgl
|
||||
@@ -4,11 +4,10 @@
|
||||
#include <mbgl/gl/gl.hpp>
|
||||
#include <mbgl/util/noncopyable.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
namespace gl {
|
||||
|
||||
class GLObjectStore : private util::noncopyable {
|
||||
public:
|
||||
@@ -29,7 +28,7 @@ private:
|
||||
std::vector<GLuint> abandonedTextures;
|
||||
};
|
||||
|
||||
} // namespace util
|
||||
} // namespace gl
|
||||
} // namespace mbgl
|
||||
|
||||
#endif
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <mbgl/sprite/sprite_atlas.hpp>
|
||||
#include <mbgl/sprite/sprite_store.hpp>
|
||||
|
||||
#include <mbgl/util/gl_object_store.hpp>
|
||||
#include <mbgl/gl/gl_object_store.hpp>
|
||||
#include <mbgl/util/worker.hpp>
|
||||
#include <mbgl/util/texture_pool.hpp>
|
||||
#include <mbgl/util/exception.hpp>
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#include <mbgl/map/map_data.hpp>
|
||||
#include <mbgl/style/style.hpp>
|
||||
#include <mbgl/util/async_task.hpp>
|
||||
#include <mbgl/util/gl_object_store.hpp>
|
||||
#include <mbgl/util/ptr.hpp>
|
||||
#include <mbgl/util/optional.hpp>
|
||||
#include <mbgl/gl/gl_object_store.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
std::unique_ptr<MapData> dataPtr;
|
||||
MapData& data;
|
||||
|
||||
util::GLObjectStore glObjectStore;
|
||||
gl::GLObjectStore glObjectStore;
|
||||
|
||||
Update updateFlags = Update::Nothing;
|
||||
util::AsyncTask asyncUpdate;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <mbgl/gl/gl.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/platform/platform.hpp>
|
||||
#include <mbgl/util/gl_object_store.hpp>
|
||||
#include <mbgl/gl/gl_object_store.hpp>
|
||||
#include <mbgl/util/math.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
#include <mbgl/util/constants.hpp>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <mbgl/util/texture_pool.hpp>
|
||||
|
||||
#include <mbgl/util/gl_object_store.hpp>
|
||||
#include <mbgl/gl/gl_object_store.hpp>
|
||||
#include <mbgl/util/thread_context.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -60,7 +60,7 @@ void ThreadContext::setFileSource(FileSource* fileSource) {
|
||||
}
|
||||
}
|
||||
|
||||
GLObjectStore* ThreadContext::getGLObjectStore() {
|
||||
gl::GLObjectStore* ThreadContext::getGLObjectStore() {
|
||||
if (current.get() != nullptr) {
|
||||
return current.get()->glObjectStore;
|
||||
} else {
|
||||
@@ -68,7 +68,7 @@ GLObjectStore* ThreadContext::getGLObjectStore() {
|
||||
}
|
||||
}
|
||||
|
||||
void ThreadContext::setGLObjectStore(GLObjectStore* glObjectStore) {
|
||||
void ThreadContext::setGLObjectStore(gl::GLObjectStore* glObjectStore) {
|
||||
if (current.get() != nullptr) {
|
||||
current.get()->glObjectStore = glObjectStore;
|
||||
} else {
|
||||
|
||||
@@ -8,11 +8,10 @@
|
||||
namespace mbgl {
|
||||
|
||||
class FileSource;
|
||||
namespace gl { class GLObjectStore; }
|
||||
|
||||
namespace util {
|
||||
|
||||
class GLObjectStore;
|
||||
|
||||
enum class ThreadPriority : bool {
|
||||
Regular,
|
||||
Low,
|
||||
@@ -37,15 +36,15 @@ public:
|
||||
|
||||
static FileSource* getFileSource();
|
||||
static void setFileSource(FileSource* fileSource);
|
||||
static GLObjectStore* getGLObjectStore();
|
||||
static void setGLObjectStore(GLObjectStore* glObjectStore);
|
||||
static gl::GLObjectStore* getGLObjectStore();
|
||||
static void setGLObjectStore(gl::GLObjectStore* glObjectStore);
|
||||
|
||||
std::string name;
|
||||
ThreadType type;
|
||||
ThreadPriority priority;
|
||||
|
||||
FileSource* fileSource = nullptr;
|
||||
GLObjectStore* glObjectStore = nullptr;
|
||||
gl::GLObjectStore* glObjectStore = nullptr;
|
||||
};
|
||||
|
||||
} // namespace util
|
||||
|
||||
Reference in New Issue
Block a user