summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2014-12-02 02:29:07 +1100
committerLeith Bade <leith@mapbox.com>2014-12-02 02:29:07 +1100
commit204700ff7e2e45ecc4ce50582988c014626b0dfe (patch)
treebb8becc9d6d52fba14fb654d3e6db72f26887a3e /src
parent763e636fd758410b56353bfe2b8a7ab6052c2430 (diff)
downloadqtlocation-mapboxgl-204700ff7e2e45ecc4ce50582988c014626b0dfe.tar.gz
Stop mipmap allocation for textures
Diffstat (limited to 'src')
-rw-r--r--src/geometry/glyph_atlas.cpp1
-rw-r--r--src/geometry/sprite_atlas.cpp1
-rw-r--r--src/renderer/prerendered_texture.cpp1
-rw-r--r--src/util/raster.cpp2
4 files changed, 4 insertions, 1 deletions
diff --git a/src/geometry/glyph_atlas.cpp b/src/geometry/glyph_atlas.cpp
index 50bda5dc4e..abfde0a556 100644
--- a/src/geometry/glyph_atlas.cpp
+++ b/src/geometry/glyph_atlas.cpp
@@ -143,6 +143,7 @@ void GlyphAtlas::bind() {
if (!texture) {
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
diff --git a/src/geometry/sprite_atlas.cpp b/src/geometry/sprite_atlas.cpp
index d7ef1e789b..cc832b2421 100644
--- a/src/geometry/sprite_atlas.cpp
+++ b/src/geometry/sprite_atlas.cpp
@@ -201,6 +201,7 @@ void SpriteAtlas::bind(bool linear) {
if (!texture) {
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
first = true;
diff --git a/src/renderer/prerendered_texture.cpp b/src/renderer/prerendered_texture.cpp
index c9507d6026..8d727d3511 100644
--- a/src/renderer/prerendered_texture.cpp
+++ b/src/renderer/prerendered_texture.cpp
@@ -37,6 +37,7 @@ void PrerenderedTexture::bindFramebuffer() {
if (texture == 0) {
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
diff --git a/src/util/raster.cpp b/src/util/raster.cpp
index 4f6acc36cf..40fb440fb2 100644
--- a/src/util/raster.cpp
+++ b/src/util/raster.cpp
@@ -48,6 +48,7 @@ void Raster::bind(bool linear) {
if (img && !textured) {
texture = texturepool.getTextureID();
glBindTexture(GL_TEXTURE_2D, texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, img->getData());
@@ -101,4 +102,3 @@ void Raster::updateTransitions(timestamp now) {
fade_transition = nullptr;
}
}
-