summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry/glyph_atlas.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-18 11:19:24 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-18 15:15:24 -0800
commit9c26f063187b129218910dbb86eb21215a2cdf40 (patch)
tree189f84f90cef341a0a084fefde40f4f07da117cb /src/mbgl/geometry/glyph_atlas.cpp
parent7b39ce95210ceb6640b3a3399dacd1d0e826ac1f (diff)
downloadqtlocation-mapboxgl-9c26f063187b129218910dbb86eb21215a2cdf40.tar.gz
[core] Thread GLObjectStore through to Holder objects
This eliminates the reliance on ThreadContext to provide GLObjectStore, and statically enforces that GL cleanup functions happen only when GLObjectStore::performCleanup is called. With the elimination of the Map thread, this becomes important because there may be multiple GLObjectStore's per-thread, and Map will need to ensure that the correct context is active when calling GLObjectStore::performCleanup.
Diffstat (limited to 'src/mbgl/geometry/glyph_atlas.cpp')
-rw-r--r--src/mbgl/geometry/glyph_atlas.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/geometry/glyph_atlas.cpp b/src/mbgl/geometry/glyph_atlas.cpp
index a5e07f2523..24c1b8c8db 100644
--- a/src/mbgl/geometry/glyph_atlas.cpp
+++ b/src/mbgl/geometry/glyph_atlas.cpp
@@ -146,10 +146,10 @@ void GlyphAtlas::removeGlyphs(uintptr_t tileUID) {
}
}
-void GlyphAtlas::upload() {
+void GlyphAtlas::upload(gl::GLObjectStore& glObjectStore) {
if (dirty) {
const bool first = !texture;
- bind();
+ bind(glObjectStore);
std::lock_guard<std::mutex> lock(mtx);
@@ -187,9 +187,9 @@ void GlyphAtlas::upload() {
}
}
-void GlyphAtlas::bind() {
+void GlyphAtlas::bind(gl::GLObjectStore& glObjectStore) {
if (!texture) {
- texture.create();
+ texture.create(glObjectStore);
MBGL_CHECK_ERROR(glBindTexture(GL_TEXTURE_2D, texture.getID()));
#ifndef GL_ES_VERSION_2_0
MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0));