diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-09-27 13:00:27 +0200 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-09-27 11:03:29 -0700 |
commit | ce42d22984d19fa020e6fba77e2585c0fd9dacf4 (patch) | |
tree | 76e1a33a58bfb023987de1cc7aca59e649624db3 /src/mbgl/sprite | |
parent | 21386b31465302d63cae5d93680442555c8560f1 (diff) | |
download | qtlocation-mapboxgl-ce42d22984d19fa020e6fba77e2585c0fd9dacf4.tar.gz |
[core] rename gl::Config to gl::Context
Diffstat (limited to 'src/mbgl/sprite')
-rw-r--r-- | src/mbgl/sprite/sprite_atlas.cpp | 22 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite_atlas.hpp | 6 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/mbgl/sprite/sprite_atlas.cpp b/src/mbgl/sprite/sprite_atlas.cpp index 78d5fe638a..f94943be1a 100644 --- a/src/mbgl/sprite/sprite_atlas.cpp +++ b/src/mbgl/sprite/sprite_atlas.cpp @@ -2,7 +2,7 @@ #include <mbgl/sprite/sprite_atlas_observer.hpp> #include <mbgl/sprite/sprite_parser.hpp> #include <mbgl/gl/gl.hpp> -#include <mbgl/gl/gl_config.hpp> +#include <mbgl/gl/context.hpp> #include <mbgl/platform/log.hpp> #include <mbgl/platform/platform.hpp> #include <mbgl/util/math.hpp> @@ -282,9 +282,9 @@ void SpriteAtlas::copy(const Holder& holder, const SpritePatternMode mode) { dirtyFlag = true; } -void SpriteAtlas::upload(gl::ObjectStore& objectStore, gl::Config& config, uint32_t unit) { +void SpriteAtlas::upload(gl::ObjectStore& objectStore, gl::Context& context, uint32_t unit) { if (dirtyFlag) { - bind(false, objectStore, config, unit); + bind(false, objectStore, context, unit); } } @@ -316,15 +316,15 @@ void SpriteAtlas::updateDirty() { dirtySprites.clear(); } -void SpriteAtlas::bind(bool linear, gl::ObjectStore& objectStore, gl::Config& config, uint32_t unit) { +void SpriteAtlas::bind(bool linear, gl::ObjectStore& objectStore, gl::Context& context, uint32_t unit) { if (!data) { return; // Empty atlas } if (!texture) { texture = objectStore.createTexture(); - config.activeTexture = unit; - config.texture[unit] = *texture; + context.activeTexture = unit; + context.texture[unit] = *texture; #ifndef GL_ES_VERSION_2_0 MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0)); #endif @@ -333,14 +333,14 @@ void SpriteAtlas::bind(bool linear, gl::ObjectStore& objectStore, gl::Config& co MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); fullUploadRequired = true; - } else if (config.texture[unit] != *texture) { - config.activeTexture = unit; - config.texture[unit] = *texture; + } else if (context.texture[unit] != *texture) { + context.activeTexture = unit; + context.texture[unit] = *texture; } GLuint filter_val = linear ? GL_LINEAR : GL_NEAREST; if (filter_val != filter) { - config.activeTexture = unit; + context.activeTexture = unit; MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter_val)); MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter_val)); filter = filter_val; @@ -349,7 +349,7 @@ void SpriteAtlas::bind(bool linear, gl::ObjectStore& objectStore, gl::Config& co if (dirtyFlag) { std::lock_guard<std::recursive_mutex> lock(mtx); - config.activeTexture = unit; + context.activeTexture = unit; if (fullUploadRequired) { MBGL_CHECK_ERROR(glTexImage2D( GL_TEXTURE_2D, // GLenum target diff --git a/src/mbgl/sprite/sprite_atlas.hpp b/src/mbgl/sprite/sprite_atlas.hpp index 7a3c2c8b45..89ae148c30 100644 --- a/src/mbgl/sprite/sprite_atlas.hpp +++ b/src/mbgl/sprite/sprite_atlas.hpp @@ -21,7 +21,7 @@ class FileSource; class SpriteAtlasObserver; namespace gl { -class Config; +class Context; } // namespace gl class SpriteImage; @@ -83,14 +83,14 @@ public: SpritePatternMode mode = SpritePatternMode::Single); // Binds the atlas texture to the GPU, and uploads data if it is out of date. - void bind(bool linear, gl::ObjectStore&, gl::Config&, uint32_t unit); + void bind(bool linear, gl::ObjectStore&, gl::Context&, uint32_t unit); // Updates sprites in the atlas texture that may have changed. void updateDirty(); // Uploads the texture to the GPU to be available when we need it. This is a lazy operation; // the texture is only bound when the data is out of date (=dirty). - void upload(gl::ObjectStore&, gl::Config&, uint32_t unit); + void upload(gl::ObjectStore&, gl::Context&, uint32_t unit); dimension getWidth() const { return width; } dimension getHeight() const { return height; } |