summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-03-06 18:40:07 +0100
committerKonstantin Käfer <mail@kkaefer.com>2019-03-12 11:03:54 +0100
commit9b5bbfcbdde1e32fb7c8f152c1a8fb449363e0a9 (patch)
tree1af663376168a70f12201a4bca8060f9490dd895 /src/mbgl/geometry
parenta7f151ab487d656340d4ace415abacf9e8cecbf9 (diff)
downloadqtlocation-mapboxgl-9b5bbfcbdde1e32fb7c8f152c1a8fb449363e0a9.tar.gz
[core] use abstract Context interface where possible
Diffstat (limited to 'src/mbgl/geometry')
-rw-r--r--src/mbgl/geometry/line_atlas.cpp6
-rw-r--r--src/mbgl/geometry/line_atlas.hpp11
2 files changed, 8 insertions, 9 deletions
diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp
index 0e82b4ffc7..e1443dc3ab 100644
--- a/src/mbgl/geometry/line_atlas.cpp
+++ b/src/mbgl/geometry/line_atlas.cpp
@@ -1,5 +1,5 @@
#include <mbgl/geometry/line_atlas.hpp>
-#include <mbgl/gl/context.hpp>
+#include <mbgl/gfx/context.hpp>
#include <mbgl/util/logging.hpp>
#include <mbgl/util/platform.hpp>
#include <mbgl/util/hash.hpp>
@@ -126,7 +126,7 @@ Size LineAtlas::getSize() const {
return image.size;
}
-void LineAtlas::upload(gl::Context& context, uint8_t unit) {
+void LineAtlas::upload(gfx::Context& context, uint8_t unit) {
if (!texture) {
texture = context.createTexture(image, unit);
} else if (dirty) {
@@ -136,7 +136,7 @@ void LineAtlas::upload(gl::Context& context, uint8_t unit) {
dirty = false;
}
-void LineAtlas::bind(gl::Context& context, uint8_t unit) {
+void LineAtlas::bind(gfx::Context& context, uint8_t unit) {
upload(context, unit);
context.bindTexture(*texture, unit, gfx::TextureFilterType::Linear, gfx::TextureMipMapType::No,
gfx::TextureWrapType::Repeat, gfx::TextureWrapType::Clamp);
diff --git a/src/mbgl/geometry/line_atlas.hpp b/src/mbgl/geometry/line_atlas.hpp
index f262232872..96072c700c 100644
--- a/src/mbgl/geometry/line_atlas.hpp
+++ b/src/mbgl/geometry/line_atlas.hpp
@@ -1,7 +1,6 @@
#pragma once
#include <mbgl/gfx/texture.hpp>
-#include <mbgl/gl/object.hpp>
#include <mbgl/util/image.hpp>
#include <mbgl/util/optional.hpp>
@@ -11,9 +10,9 @@
namespace mbgl {
-namespace gl {
+namespace gfx {
class Context;
-} // namespace gl
+} // namespace gfx
class LinePatternPos {
public:
@@ -33,11 +32,11 @@ public:
~LineAtlas();
// Binds the atlas texture to the GPU, and uploads data if it is out of date.
- void bind(gl::Context&, uint8_t unit);
+ void bind(gfx::Context&, uint8_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::Context&, uint8_t unit);
+ void upload(gfx::Context&, uint8_t unit);
LinePatternPos getDashPosition(const std::vector<float>&, LinePatternCap);
LinePatternPos addDash(const std::vector<float>& dasharray, LinePatternCap);
@@ -47,7 +46,7 @@ public:
private:
const AlphaImage image;
bool dirty;
- mbgl::optional<gfx::Texture> texture;
+ optional<gfx::Texture> texture;
uint32_t nextRow = 0;
std::unordered_map<size_t, LinePatternPos> positions;
};