summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-09-27 13:00:27 +0200
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-09-27 11:03:29 -0700
commitce42d22984d19fa020e6fba77e2585c0fd9dacf4 (patch)
tree76e1a33a58bfb023987de1cc7aca59e649624db3 /src/mbgl/geometry
parent21386b31465302d63cae5d93680442555c8560f1 (diff)
downloadqtlocation-mapboxgl-ce42d22984d19fa020e6fba77e2585c0fd9dacf4.tar.gz
[core] rename gl::Config to gl::Context
Diffstat (limited to 'src/mbgl/geometry')
-rw-r--r--src/mbgl/geometry/buffer.hpp12
-rw-r--r--src/mbgl/geometry/line_atlas.cpp20
-rw-r--r--src/mbgl/geometry/line_atlas.hpp6
-rw-r--r--src/mbgl/geometry/vao.cpp8
-rw-r--r--src/mbgl/geometry/vao.hpp18
5 files changed, 32 insertions, 32 deletions
diff --git a/src/mbgl/geometry/buffer.hpp b/src/mbgl/geometry/buffer.hpp
index f1b493eb41..cfa96b8fed 100644
--- a/src/mbgl/geometry/buffer.hpp
+++ b/src/mbgl/geometry/buffer.hpp
@@ -2,7 +2,7 @@
#include <mbgl/gl/gl.hpp>
#include <mbgl/gl/object_store.hpp>
-#include <mbgl/gl/gl_config.hpp>
+#include <mbgl/gl/context.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/optional.hpp>
@@ -40,16 +40,16 @@ public:
}
// Transfers this buffer to the GPU and binds the buffer to the GL context.
- void bind(gl::ObjectStore& store, gl::Config& config) {
+ void bind(gl::ObjectStore& store, gl::Context& context) {
const bool initialized { buffer };
if (!initialized) {
buffer = store.createBuffer();
}
if (target == GL_ARRAY_BUFFER) {
- config.vertexBuffer = *buffer;
+ context.vertexBuffer = *buffer;
} else {
- config.elementBuffer = *buffer;
+ context.elementBuffer = *buffer;
}
if (!initialized) {
@@ -76,9 +76,9 @@ public:
}
// Uploads the buffer to the GPU to be available when we need it.
- void upload(gl::ObjectStore& store, gl::Config& config) {
+ void upload(gl::ObjectStore& store, gl::Context& context) {
if (!buffer) {
- bind(store, config);
+ bind(store, context);
}
}
diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp
index bc81c38f53..2f4616f6e6 100644
--- a/src/mbgl/geometry/line_atlas.cpp
+++ b/src/mbgl/geometry/line_atlas.cpp
@@ -1,7 +1,7 @@
#include <mbgl/geometry/line_atlas.hpp>
#include <mbgl/gl/gl.hpp>
#include <mbgl/gl/object_store.hpp>
-#include <mbgl/gl/gl_config.hpp>
+#include <mbgl/gl/context.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
@@ -121,30 +121,30 @@ LinePatternPos LineAtlas::addDash(const std::vector<float>& dasharray, LinePatte
return position;
}
-void LineAtlas::upload(gl::ObjectStore& store, gl::Config& config, uint32_t unit) {
+void LineAtlas::upload(gl::ObjectStore& store, gl::Context& context, uint32_t unit) {
if (dirty) {
- bind(store, config, unit);
+ bind(store, context, unit);
}
}
-void LineAtlas::bind(gl::ObjectStore& store, gl::Config& config, uint32_t unit) {
+void LineAtlas::bind(gl::ObjectStore& store, gl::Context& context, uint32_t unit) {
bool first = false;
if (!texture) {
texture = store.createTexture();
- config.activeTexture = unit;
- config.texture[unit] = *texture;
+ context.activeTexture = unit;
+ context.texture[unit] = *texture;
MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
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));
first = 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;
}
if (dirty) {
- config.activeTexture = unit;
+ context.activeTexture = unit;
if (first) {
MBGL_CHECK_ERROR(glTexImage2D(
GL_TEXTURE_2D, // GLenum target
diff --git a/src/mbgl/geometry/line_atlas.hpp b/src/mbgl/geometry/line_atlas.hpp
index 7658ed33c1..701c12c1ce 100644
--- a/src/mbgl/geometry/line_atlas.hpp
+++ b/src/mbgl/geometry/line_atlas.hpp
@@ -10,7 +10,7 @@
namespace mbgl {
namespace gl {
-class Config;
+class Context;
} // namespace gl
typedef struct {
@@ -30,11 +30,11 @@ public:
~LineAtlas();
// Binds the atlas texture to the GPU, and uploads data if it is out of date.
- void bind(gl::ObjectStore&, gl::Config&, uint32_t unit);
+ void bind(gl::ObjectStore&, gl::Context&, uint32_t 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::ObjectStore&, gl::Config&, uint32_t unit);
+ void upload(gl::ObjectStore&, gl::Context&, uint32_t unit);
LinePatternPos getDashPosition(const std::vector<float>&, LinePatternCap);
LinePatternPos addDash(const std::vector<float>& dasharray, LinePatternCap);
diff --git a/src/mbgl/geometry/vao.cpp b/src/mbgl/geometry/vao.cpp
index e475f43273..283c45289e 100644
--- a/src/mbgl/geometry/vao.cpp
+++ b/src/mbgl/geometry/vao.cpp
@@ -10,7 +10,7 @@ VertexArrayObject::VertexArrayObject() {
VertexArrayObject::~VertexArrayObject() = default;
-void VertexArrayObject::bindVertexArrayObject(gl::ObjectStore& store, gl::Config& config) {
+void VertexArrayObject::bindVertexArrayObject(gl::ObjectStore& store, gl::Context& context) {
if (!gl::GenVertexArrays || !gl::BindVertexArray) {
static bool reported = false;
if (!reported) {
@@ -22,11 +22,11 @@ void VertexArrayObject::bindVertexArrayObject(gl::ObjectStore& store, gl::Config
if (!vao) {
vao = store.createVAO();
- config.vertexBuffer.setDirty();
- config.elementBuffer.setDirty();
+ context.vertexBuffer.setDirty();
+ context.elementBuffer.setDirty();
}
- config.vertexArrayObject = *vao;
+ context.vertexArrayObject = *vao;
}
void VertexArrayObject::verifyBinding(Shader& shader, GLuint vertexBuffer, GLuint elementsBuffer,
diff --git a/src/mbgl/geometry/vao.hpp b/src/mbgl/geometry/vao.hpp
index 5a2486fae1..98ce3527cc 100644
--- a/src/mbgl/geometry/vao.hpp
+++ b/src/mbgl/geometry/vao.hpp
@@ -3,7 +3,7 @@
#include <mbgl/shader/shader.hpp>
#include <mbgl/gl/gl.hpp>
#include <mbgl/gl/object_store.hpp>
-#include <mbgl/gl/gl_config.hpp>
+#include <mbgl/gl/context.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/optional.hpp>
@@ -21,10 +21,10 @@ public:
VertexBuffer& vertexBuffer,
GLbyte* offset,
gl::ObjectStore& store,
- gl::Config& config) {
- bindVertexArrayObject(store, config);
+ gl::Context& context) {
+ bindVertexArrayObject(store, context);
if (bound_shader == 0) {
- vertexBuffer.bind(store, config);
+ vertexBuffer.bind(store, context);
shader.bind(offset);
if (vao) {
storeBinding(shader, vertexBuffer.getID(), 0, offset);
@@ -40,11 +40,11 @@ public:
ElementsBuffer& elementsBuffer,
GLbyte* offset,
gl::ObjectStore& store,
- gl::Config& config) {
- bindVertexArrayObject(store, config);
+ gl::Context& context) {
+ bindVertexArrayObject(store, context);
if (bound_shader == 0) {
- vertexBuffer.bind(store, config);
- elementsBuffer.bind(store, config);
+ vertexBuffer.bind(store, context);
+ elementsBuffer.bind(store, context);
shader.bind(offset);
if (vao) {
storeBinding(shader, vertexBuffer.getID(), elementsBuffer.getID(), offset);
@@ -59,7 +59,7 @@ public:
}
private:
- void bindVertexArrayObject(gl::ObjectStore&, gl::Config&);
+ void bindVertexArrayObject(gl::ObjectStore&, gl::Context&);
void storeBinding(Shader &shader, GLuint vertexBuffer, GLuint elementsBuffer, GLbyte *offset);
void verifyBinding(Shader &shader, GLuint vertexBuffer, GLuint elementsBuffer, GLbyte *offset);