diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-09-29 15:32:48 +0200 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-09-29 10:17:47 -0700 |
commit | cc78b74098e02311cc646fe5b82c13641ff705fa (patch) | |
tree | af0219d5611f0984bf3b244a336fbc6074a44cb4 /src/mbgl/text | |
parent | 15aece8a30dcc1f1f97e28180edda46d05641a2d (diff) | |
download | qtlocation-mapboxgl-cc78b74098e02311cc646fe5b82c13641ff705fa.tar.gz |
[core] remove dependence on gl.h types
Diffstat (limited to 'src/mbgl/text')
-rw-r--r-- | src/mbgl/text/glyph_atlas.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/text/glyph_atlas.hpp | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/mbgl/text/glyph_atlas.cpp b/src/mbgl/text/glyph_atlas.cpp index b5b62062f3..2f8c44db59 100644 --- a/src/mbgl/text/glyph_atlas.cpp +++ b/src/mbgl/text/glyph_atlas.cpp @@ -203,7 +203,7 @@ void GlyphAtlas::removeGlyphs(uintptr_t tileUID) { } } -void GlyphAtlas::upload(gl::Context& context, uint32_t unit) { +void GlyphAtlas::upload(gl::Context& context, gl::TextureUnit unit) { if (dirty) { const bool first = !texture; bind(context, unit); @@ -241,12 +241,12 @@ void GlyphAtlas::upload(gl::Context& context, uint32_t unit) { } } -void GlyphAtlas::bind(gl::Context& context, uint32_t unit) { +void GlyphAtlas::bind(gl::Context& context, gl::TextureUnit unit) { if (!texture) { texture = context.createTexture(); context.activeTexture = unit; context.texture[unit] = *texture; -#ifndef GL_ES_VERSION_2_0 +#if not MBGL_USE_GLES2 MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0)); #endif MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); diff --git a/src/mbgl/text/glyph_atlas.hpp b/src/mbgl/text/glyph_atlas.hpp index 966ac76f91..84875bdd78 100644 --- a/src/mbgl/text/glyph_atlas.hpp +++ b/src/mbgl/text/glyph_atlas.hpp @@ -8,7 +8,6 @@ #include <mbgl/util/font_stack.hpp> #include <mbgl/util/exclusive.hpp> #include <mbgl/util/work_queue.hpp> -#include <mbgl/gl/gl.hpp> #include <mbgl/gl/object.hpp> #include <atomic> @@ -61,14 +60,14 @@ public: void removeGlyphs(uintptr_t tileUID); // Binds the atlas texture to the GPU, and uploads data if it is out of date. - void bind(gl::Context&, uint32_t unit); + void bind(gl::Context&, gl::TextureUnit unit); // 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::Context&, uint32_t unit); + void upload(gl::Context&, gl::TextureUnit unit); - const GLsizei width; - const GLsizei height; + const uint16_t width; + const uint16_t height; private: void requestGlyphRange(const FontStack&, const GlyphRange&); |