summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry/line_atlas.cpp
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2015-01-16 14:39:47 -0500
committerAnsis Brammanis <brammanis@gmail.com>2015-01-16 14:39:47 -0500
commitbf4e9d086293d6a398955af7453101a0abdf8ba4 (patch)
treebb34b35e0c3d5c3056d5c45b6ab62ae6066e60fe /src/mbgl/geometry/line_atlas.cpp
parent1ce0ca0b7a38218e53601b0b1e9d72a3ff55e52e (diff)
downloadqtlocation-mapboxgl-bf4e9d086293d6a398955af7453101a0abdf8ba4.tar.gz
remove duplicate lineatlas texture update
Diffstat (limited to 'src/mbgl/geometry/line_atlas.cpp')
-rw-r--r--src/mbgl/geometry/line_atlas.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp
index 5cfb67021f..fa5535a8cd 100644
--- a/src/mbgl/geometry/line_atlas.cpp
+++ b/src/mbgl/geometry/line_atlas.cpp
@@ -111,6 +111,8 @@ LinePatternPos LineAtlas::addDash(const std::vector<float> &dasharray, bool roun
};
void LineAtlas::bind() {
+ std::lock_guard<std::recursive_mutex> lock(mtx);
+
bool first = false;
if (!texture) {
MBGL_CHECK_ERROR(glGenTextures(1, &texture));
@@ -119,13 +121,12 @@ void LineAtlas::bind() {
MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT));
MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
- dirty = true;
+ first = true;
} else {
MBGL_CHECK_ERROR(glBindTexture(GL_TEXTURE_2D, texture));
}
if (dirty) {
- std::lock_guard<std::recursive_mutex> lock(mtx);
if (first) {
glTexImage2D(
GL_TEXTURE_2D, // GLenum target
@@ -153,9 +154,6 @@ void LineAtlas::bind() {
}
- // TODO use texsubimage for updates
- // TODO lock?
- glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, data);
dirty = false;
}
};