summaryrefslogtreecommitdiff
path: root/include/mbgl/geometry
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/geometry')
-rw-r--r--include/mbgl/geometry/anchor.hpp25
-rw-r--r--include/mbgl/geometry/binpack.hpp100
-rw-r--r--include/mbgl/geometry/buffer.hpp118
-rw-r--r--include/mbgl/geometry/debug_font_buffer.hpp17
-rw-r--r--include/mbgl/geometry/elements_buffer.hpp63
-rw-r--r--include/mbgl/geometry/fill_buffer.hpp21
-rw-r--r--include/mbgl/geometry/geometry.hpp77
-rw-r--r--include/mbgl/geometry/glyph_atlas.hpp54
-rw-r--r--include/mbgl/geometry/icon_buffer.hpp22
-rw-r--r--include/mbgl/geometry/line_buffer.hpp39
-rw-r--r--include/mbgl/geometry/resample.hpp13
-rw-r--r--include/mbgl/geometry/sprite_atlas.hpp81
-rw-r--r--include/mbgl/geometry/static_vertex_buffer.hpp26
-rw-r--r--include/mbgl/geometry/text_buffer.hpp25
-rw-r--r--include/mbgl/geometry/vao.hpp73
15 files changed, 0 insertions, 754 deletions
diff --git a/include/mbgl/geometry/anchor.hpp b/include/mbgl/geometry/anchor.hpp
deleted file mode 100644
index d30394f0b9..0000000000
--- a/include/mbgl/geometry/anchor.hpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef MBGL_GEOMETRY_ANCHOR
-#define MBGL_GEOMETRY_ANCHOR
-
-#include <vector>
-
-namespace mbgl {
-
-struct Anchor {
- float x = 0.0f;
- float y = 0.0f;
- float angle = 0.0f;
- float scale = 0.0f;
- int segment = -1;
-
- explicit Anchor(float x_, float y_, float angle_, float scale_)
- : x(x_), y(y_), angle(angle_), scale(scale_) {}
- explicit Anchor(float x_, float y_, float angle_, float scale_, int segment_)
- : x(x_), y(y_), angle(angle_), scale(scale_), segment(segment_) {}
-};
-
-typedef std::vector<Anchor> Anchors;
-
-}
-
-#endif \ No newline at end of file
diff --git a/include/mbgl/geometry/binpack.hpp b/include/mbgl/geometry/binpack.hpp
deleted file mode 100644
index 9aadaa202c..0000000000
--- a/include/mbgl/geometry/binpack.hpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef MBGL_GEOMETRY_BINPACK
-#define MBGL_GEOMETRY_BINPACK
-
-#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/rect.hpp>
-#include <cstdint>
-#include <list>
-
-namespace mbgl {
-
-template <typename T>
-class BinPack : private util::noncopyable {
-public:
- BinPack(T width, T height)
- : free(1, Rect<uint16_t>{ 0, 0, width, height }) {}
-public:
- Rect<T> allocate(T width, T height) {
- // Find the smallest free rect angle
- auto smallest = free.end();
- for (auto it = free.begin(); it != free.end(); ++it) {
- const Rect<T>& ref = *it;
- const Rect<T>& rect = *smallest;
- if (width <= ref.w && height <= ref.h) {
- if (smallest == free.end() || (ref.y <= rect.y && ref.x <= rect.x)) {
- smallest = it;
- }
- }
- }
-
- if (smallest == free.end()) {
- // There's no space left for this char.
- return Rect<uint16_t>{ 0, 0, 0, 0 };
- } else {
- Rect<T> rect = *smallest;
- free.erase(smallest);
-
- // Shorter/Longer Axis Split Rule (SAS)
- // http://clb.demon.fi/files/RectangleBinPack.pdf p. 15
- // Ignore the dimension of R and just split long the shorter dimension
- // See Also: http://www.cs.princeton.edu/~chazelle/pubs/blbinpacking.pdf
- if (rect.w < rect.h) {
- // split horizontally
- // +--+---+
- // |__|___| <-- b1
- // +------+ <-- b2
- if (rect.w > width) free.emplace_back(rect.x + width, rect.y, rect.w - width, height);
- if (rect.h > height) free.emplace_back(rect.x, rect.y + height, rect.w, rect.h - height);
- } else {
- // split vertically
- // +--+---+
- // |__| | <-- b1
- // +--|---+ <-- b2
- if (rect.w > width) free.emplace_back(rect.x + width, rect.y, rect.w - width, rect.h);
- if (rect.h > height) free.emplace_back(rect.x, rect.y + height, width, rect.h - height);
- }
-
- return Rect<uint16_t>{ rect.x, rect.y, width, height };
- }
- }
-
-
- void release(Rect<T> rect) {
- // Simple algorithm to recursively merge the newly released cell with its
- // neighbor. This doesn't merge more than two cells at a time, and fails
- // for complicated merges.
- for (auto it = free.begin(); it != free.end(); ++it) {
- Rect<T> ref = *it;
- if (ref.y == rect.y && ref.h == rect.h && ref.x + ref.w == rect.x) {
- ref.w += rect.w;
- }
- else if (ref.x == rect.x && ref.w == rect.w && ref.y + ref.h == rect.y) {
- ref.h += rect.h;
- }
- else if (rect.y == ref.y && rect.h == ref.h && rect.x + rect.w == ref.x) {
- ref.x = rect.x;
- ref.w += rect.w;
- }
- else if (rect.x == ref.x && rect.w == ref.w && rect.y + rect.h == ref.y) {
- ref.y = rect.y;
- ref.h += rect.h;
- } else {
- continue;
- }
-
- free.erase(it);
- release(ref);
- return;
-
- }
-
- free.emplace_back(rect);
- };
-
-private:
- std::list<Rect<T>> free;
-};
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/buffer.hpp b/include/mbgl/geometry/buffer.hpp
deleted file mode 100644
index 80cc6b9d1a..0000000000
--- a/include/mbgl/geometry/buffer.hpp
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef MBGL_GEOMETRY_BUFFER
-#define MBGL_GEOMETRY_BUFFER
-
-#include <mbgl/platform/gl.hpp>
-#include <mbgl/util/noncopyable.hpp>
-
-#include <cstdlib>
-#include <cassert>
-#include <stdexcept>
-
-namespace mbgl {
-
-template <
- size_t item_size,
- int bufferType = GL_ARRAY_BUFFER,
- size_t defaultLength = 8192,
- bool retainAfterUpload = false
->
-class Buffer : private util::noncopyable {
-public:
- ~Buffer() {
- cleanup();
- if (buffer != 0) {
- glDeleteBuffers(1, &buffer);
- buffer = 0;
- }
- }
-
- // Returns the number of elements in this buffer. This is not the number of
- // bytes, but rather the number of coordinates with associated information.
- inline size_t index() const {
- return pos / itemSize;
- }
-
- inline bool empty() const {
- return pos == 0;
- }
-
- // Transfers this buffer to the GPU and binds the buffer to the GL context.
- void bind(bool force = false) {
- if (buffer == 0) {
- glGenBuffers(1, &buffer);
- force = true;
- }
- glBindBuffer(bufferType, buffer);
- if (force) {
- if (array == nullptr) {
- throw std::runtime_error("Buffer was already deleted or doesn't contain elements");
- }
-
- glBufferData(bufferType, pos, array, GL_STATIC_DRAW);
- if (!retainAfterUpload) {
- cleanup();
- }
- }
- }
-
- void cleanup() {
- if (array) {
- free(array);
- array = nullptr;
- }
- }
-
- inline GLuint getID() const {
- return buffer;
- }
-
-protected:
- // increase the buffer size by at least /required/ bytes.
- inline void *addElement() {
- if (buffer != 0) {
- throw std::runtime_error("Can't add elements after buffer was bound to GPU");
- }
- if (length < pos + itemSize) {
- while (length < pos + itemSize) length += defaultLength;
- array = realloc(array, length);
- if (array == nullptr) {
- throw std::runtime_error("Buffer reallocation failed");
- }
- }
- pos += itemSize;
- return static_cast<char *>(array) + (pos - itemSize);
- }
-
- // Get a pointer to the item at a given index.
- inline void *getElement(size_t i) {
- if (array == nullptr) {
- throw std::runtime_error("Buffer was already deleted or doesn't contain elements");
- }
-
- if (i * itemSize >= pos) {
- throw new std::runtime_error("Can't get element after array bounds");
- } else {
- return static_cast<char *>(array) + (i * itemSize);
- }
- }
-
-public:
- static const size_t itemSize = item_size;
-
-private:
- // CPU buffer
- void *array = nullptr;
-
- // Byte position where we are writing.
- size_t pos = 0;
-
- // Number of bytes that are valid in this buffer.
- size_t length = 0;
-
- // GL buffer ID
- GLuint buffer = 0;
-};
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/debug_font_buffer.hpp b/include/mbgl/geometry/debug_font_buffer.hpp
deleted file mode 100644
index 7cceb0f576..0000000000
--- a/include/mbgl/geometry/debug_font_buffer.hpp
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef MBGL_GEOMETRY_DEBUG_FONT_BUFFER
-#define MBGL_GEOMETRY_DEBUG_FONT_BUFFER
-
-#include "buffer.hpp"
-
-namespace mbgl {
-
-class DebugFontBuffer : public Buffer<
- 4 // 2 bytes per coordinate, 2 coordinates
-> {
-public:
- void addText(const char *text, double left, double baseline, double scale = 1);
-};
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/elements_buffer.hpp b/include/mbgl/geometry/elements_buffer.hpp
deleted file mode 100644
index 045560f9aa..0000000000
--- a/include/mbgl/geometry/elements_buffer.hpp
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef MBGL_GEOMETRY_TRIANGLE_ELEMENTS_BUFFER
-#define MBGL_GEOMETRY_TRIANGLE_ELEMENTS_BUFFER
-
-#include <mbgl/geometry/buffer.hpp>
-#include <mbgl/geometry/vao.hpp>
-#include <mbgl/util/noncopyable.hpp>
-
-#include <array>
-
-namespace mbgl {
-
-template <int count>
-struct ElementGroup : public util::noncopyable {
- std::array<VertexArrayObject, count> array;
- uint32_t vertex_length;
- uint32_t elements_length;
-
- ElementGroup() : vertex_length(0), elements_length(0) {}
- ElementGroup(uint32_t vertex_length_, uint32_t elements_length_)
- : vertex_length(vertex_length_),
- elements_length(elements_length_) {
- }
-
- ElementGroup(ElementGroup &&rhs) noexcept
- : array(std::move(rhs.array)),
- vertex_length(rhs.vertex_length),
- elements_length(rhs.elements_length) {};
-};
-
-class TriangleElementsBuffer : public Buffer<
- 6, // bytes per triangle (3 * unsigned short == 6 bytes)
- GL_ELEMENT_ARRAY_BUFFER
-> {
-public:
- typedef uint16_t element_type;
-
- void add(element_type a, element_type b, element_type c);
-};
-
-
-class LineElementsBuffer : public Buffer<
- 4, // bytes per triangle (2 * unsigned short == 6 bytes)
- GL_ELEMENT_ARRAY_BUFFER
-> {
-public:
- typedef uint16_t element_type;
-
- void add(element_type a, element_type b);
-};
-
-class PointElementsBuffer : public Buffer<
- 2, // bytes per point (1 unsigned short)
- GL_ELEMENT_ARRAY_BUFFER
-> {
-public:
- typedef uint16_t element_type;
-
- void add(element_type a);
-};
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/fill_buffer.hpp b/include/mbgl/geometry/fill_buffer.hpp
deleted file mode 100644
index 4a3d5a5b38..0000000000
--- a/include/mbgl/geometry/fill_buffer.hpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef MBGL_GEOMETRY_FILL_BUFFER
-#define MBGL_GEOMETRY_FILL_BUFFER
-
-#include "buffer.hpp"
-#include <vector>
-#include <cstdint>
-
-namespace mbgl {
-
-class FillVertexBuffer : public Buffer<
- 4 // bytes per coordinates (2 * unsigned short == 4 bytes)
-> {
-public:
- typedef int16_t vertex_type;
-
- void add(vertex_type x, vertex_type y);
-};
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/geometry.hpp b/include/mbgl/geometry/geometry.hpp
deleted file mode 100644
index 484d17b36d..0000000000
--- a/include/mbgl/geometry/geometry.hpp
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef MBGL_GEOMETRY_GEOMETRY
-#define MBGL_GEOMETRY_GEOMETRY
-
-#include <mbgl/util/pbf.hpp>
-#include <mbgl/util/noncopyable.hpp>
-
-#include <cstdlib>
-
-namespace mbgl {
-
-class Geometry : private util::noncopyable {
-
-public:
- inline explicit Geometry(pbf& data);
-
- enum command : uint8_t {
- end = 0,
- move_to = 1,
- line_to = 2,
- close = 7
- };
-
- inline command next(int32_t &rx, int32_t &ry);
-
-private:
- pbf& data;
- uint8_t cmd;
- uint32_t length;
- int32_t x, y;
- int32_t ox, oy;
-};
-
-Geometry::Geometry(pbf& data_)
- : data(data_),
- cmd(1),
- length(0),
- x(0), y(0),
- ox(0), oy(0) {}
-
-Geometry::command Geometry::next(int32_t &rx, int32_t &ry) {
- if (data.data < data.end) {
- if (length == 0) {
- uint32_t cmd_length = static_cast<uint32_t>(data.varint());
- cmd = cmd_length & 0x7;
- length = cmd_length >> 3;
- }
-
- --length;
-
- if (cmd == move_to || cmd == line_to) {
- rx = (x += data.svarint());
- ry = (y += data.svarint());
-
- if (cmd == move_to) {
- ox = x;
- oy = y;
- return move_to;
- } else {
- return line_to;
- }
- } else if (cmd == close) {
- rx = ox;
- ry = oy;
- return close;
- } else {
- fprintf(stderr, "unknown command: %d\n", cmd);
- // TODO: gracefully handle geometry parse failures
- return end;
- }
- } else {
- return end;
- }
-}
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/glyph_atlas.hpp b/include/mbgl/geometry/glyph_atlas.hpp
deleted file mode 100644
index 7b3c223fe5..0000000000
--- a/include/mbgl/geometry/glyph_atlas.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef MBGL_GEOMETRY_GLYPH_ATLAS
-#define MBGL_GEOMETRY_GLYPH_ATLAS
-
-#include <mbgl/geometry/binpack.hpp>
-#include <mbgl/text/glyph_store.hpp>
-#include <mbgl/util/noncopyable.hpp>
-
-#include <string>
-#include <set>
-#include <map>
-#include <mutex>
-#include <atomic>
-
-namespace mbgl {
-
-class GlyphAtlas : public util::noncopyable {
-public:
-
-private:
- struct GlyphValue {
- GlyphValue(const Rect<uint16_t>& rect_, uint64_t id)
- : rect(rect_), ids({ id }) {}
- Rect<uint16_t> rect;
- std::set<uint64_t> ids;
- };
-
- Rect<uint16_t> addGlyph_impl(uint64_t tile_id, const std::string& face_name,
- const SDFGlyph& glyph);
-public:
- GlyphAtlas(uint16_t width, uint16_t height);
-
- Rect<uint16_t> addGlyph(uint64_t tile_id, const std::string& face_name,
- const SDFGlyph& glyph);
- void addGlyphs(uint64_t tileid, std::u32string const& text, std::string const& stackname,
- FontStack const& fontStack, GlyphPositions & face);
- void removeGlyphs(uint64_t tile_id);
- void bind();
-
-public:
- const uint16_t width = 0;
- const uint16_t height = 0;
-
-private:
- std::mutex mtx;
- BinPack<uint16_t> bin;
- std::map<std::string, std::map<uint32_t, GlyphValue>> index;
- std::unique_ptr<char[]> data;
- std::atomic<bool> dirty;
- uint32_t texture = 0;
-};
-
-};
-
-#endif
diff --git a/include/mbgl/geometry/icon_buffer.hpp b/include/mbgl/geometry/icon_buffer.hpp
deleted file mode 100644
index e7e5f40355..0000000000
--- a/include/mbgl/geometry/icon_buffer.hpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef MBGL_GEOMETRY_ICON_BUFFER
-#define MBGL_GEOMETRY_ICON_BUFFER
-
-#include "buffer.hpp"
-
-#include <array>
-
-namespace mbgl {
-
- class IconVertexBuffer : public Buffer<
- 20
- > {
- public:
- static const double angleFactor;
-
- size_t add(int16_t x, int16_t y, float ox, float oy, int16_t tx, int16_t ty, float angle, float minzoom, std::array<float, 2> range, float maxzoom, float labelminzoom);
-
- };
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/line_buffer.hpp b/include/mbgl/geometry/line_buffer.hpp
deleted file mode 100644
index 5012bb12ac..0000000000
--- a/include/mbgl/geometry/line_buffer.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef MBGL_GEOMETRY_LINE_BUFFER
-#define MBGL_GEOMETRY_LINE_BUFFER
-
-#include "buffer.hpp"
-
-namespace mbgl {
-
-class LineVertexBuffer : public Buffer<
- 8 // 2 coordinates per vertex + 1 linesofar + 1 extrude coord pair == 4 (== 8 bytes)
-> {
-public:
- typedef int16_t vertex_type;
-
- /*
- * Scale the extrusion vector so that the normal length is this value.
- * Contains the "texture" normals (-1..1). This is distinct from the extrude
- * normals for line joins, because the x-value remains 0 for the texture
- * normal array, while the extrude normal actually moves the vertex to create
- * the acute/bevelled line join.
- */
- static const int8_t extrudeScale = 63;
-
- /*
- * Add a vertex to this buffer
- *
- * @param {number} x vertex position
- * @param {number} y vertex position
- * @param {number} ex extrude normal
- * @param {number} ey extrude normal
- * @param {number} tx texture normal
- * @param {number} ty texture normal
- */
- size_t add(vertex_type x, vertex_type y, float ex, float ey, int8_t tx, int8_t ty, int32_t linesofar = 0);
-};
-
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/resample.hpp b/include/mbgl/geometry/resample.hpp
deleted file mode 100644
index bcfe4ca53d..0000000000
--- a/include/mbgl/geometry/resample.hpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef MBGL_GEOMETRY_INTERPOLATE
-#define MBGL_GEOMETRY_INTERPOLATE
-
-#include <mbgl/geometry/anchor.hpp>
-#include <mbgl/util/math.hpp>
-
-namespace mbgl {
-
-Anchors resample(const std::vector<Coordinate> &vertices, float spacing,
- float minScale, float maxScale, float tilePixelRatio, int start = 0);
-}
-
-#endif
diff --git a/include/mbgl/geometry/sprite_atlas.hpp b/include/mbgl/geometry/sprite_atlas.hpp
deleted file mode 100644
index 9fb42a30b5..0000000000
--- a/include/mbgl/geometry/sprite_atlas.hpp
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef MBGL_GEOMETRY_SPRITE_ATLAS
-#define MBGL_GEOMETRY_SPRITE_ATLAS
-
-#include <mbgl/geometry/binpack.hpp>
-#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/ptr.hpp>
-
-#include <string>
-#include <map>
-#include <mutex>
-#include <atomic>
-#include <set>
-#include <array>
-
-namespace mbgl {
-
-class Sprite;
-class SpritePosition;
-
-struct SpriteAtlasPosition {
- std::array<float, 2> size;
- std::array<float, 2> tl;
- std::array<float, 2> br;
-};
-
-class SpriteAtlas : public util::noncopyable {
-public:
- typedef uint16_t dimension;
-
- // Add way to construct this from another SpriteAtlas (e.g. with another pixelRatio)
- SpriteAtlas(dimension width, dimension height);
- ~SpriteAtlas();
-
- // Changes the pixel ratio.
- bool resize(float newRatio);
-
- // Changes the source sprite.
- void setSprite(util::ptr<Sprite> sprite);
-
- // Returns the coordinates of an image that is sourced from the sprite image.
- // This getter attempts to read the image from the sprite if it is already loaded.
- // In that case, it copies it into the sprite atlas and returns the dimensions.
- // Otherwise, it returns a 0/0/0/0 rect.
- Rect<dimension> getImage(const std::string& name);
-
- SpriteAtlasPosition getPosition(const std::string& name, bool repeating = false);
-
- // Binds the image buffer of this sprite atlas to the GPU, and uploads data if it is out
- // of date.
- void bind(bool linear = false);
-
- inline float getWidth() const { return width; }
- inline float getHeight() const { return height; }
- inline float getTextureWidth() const { return width * pixelRatio; }
- inline float getTextureHeight() const { return height * pixelRatio; }
- inline float getPixelRatio() const { return pixelRatio; }
-
- const dimension width = 0;
- const dimension height = 0;
-
-private:
- void allocate();
- Rect<SpriteAtlas::dimension> allocateImage(size_t width, size_t height);
- void copy(const Rect<dimension>& dst, const SpritePosition& src);
-
- std::recursive_mutex mtx;
- float pixelRatio = 1.0f;
- BinPack<dimension> bin;
- util::ptr<Sprite> sprite;
- std::map<std::string, Rect<dimension>> images;
- std::set<std::string> uninitialized;
- uint32_t *data = nullptr;
- std::atomic<bool> dirty;
- uint32_t texture = 0;
- uint32_t filter = 0;
- static const int buffer = 1;
-};
-
-};
-
-#endif
diff --git a/include/mbgl/geometry/static_vertex_buffer.hpp b/include/mbgl/geometry/static_vertex_buffer.hpp
deleted file mode 100644
index ce932269f0..0000000000
--- a/include/mbgl/geometry/static_vertex_buffer.hpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef MBGL_GEOMETRY_STATIC_VERTEX_BUFFER
-#define MBGL_GEOMETRY_STATIC_VERTEX_BUFFER
-
-#include <mbgl/geometry/buffer.hpp>
-
-#include <vector>
-#include <cstddef>
-#include <cstdint>
-#include <cmath>
-
-namespace mbgl {
-
-class StaticVertexBuffer : public Buffer<
- 4, // bytes per vertex (2 * signed short == 4 bytes)
- GL_ARRAY_BUFFER,
- 32 // default length
-> {
-public:
- typedef int16_t vertex_type;
-
- StaticVertexBuffer(std::initializer_list<std::pair<int16_t, int16_t>> init);
-};
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/text_buffer.hpp b/include/mbgl/geometry/text_buffer.hpp
deleted file mode 100644
index 159f3207a8..0000000000
--- a/include/mbgl/geometry/text_buffer.hpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef MBGL_GEOMETRY_TEXT_BUFFER
-#define MBGL_GEOMETRY_TEXT_BUFFER
-
-#include "buffer.hpp"
-#include <array>
-
-namespace mbgl {
-
-class TextVertexBuffer : public Buffer <
- 16,
- GL_ARRAY_BUFFER,
- 32768
-> {
-public:
- typedef int16_t vertex_type;
-
- static const double angleFactor;
-
- size_t add(int16_t x, int16_t y, float ox, float oy, uint16_t tx, uint16_t ty, float angle, float minzoom, std::array<float, 2> range, float maxzoom, float labelminzoom);
-};
-
-
-}
-
-#endif
diff --git a/include/mbgl/geometry/vao.hpp b/include/mbgl/geometry/vao.hpp
deleted file mode 100644
index 2ecba731f7..0000000000
--- a/include/mbgl/geometry/vao.hpp
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef MBGL_GEOMETRY_VAO
-#define MBGL_GEOMETRY_VAO
-
-#include <mbgl/shader/shader.hpp>
-#include <mbgl/platform/gl.hpp>
-#include <mbgl/util/noncopyable.hpp>
-
-#include <stdexcept>
-
-namespace mbgl {
-
-class VertexArrayObject : public util::noncopyable {
-public:
- inline VertexArrayObject() {};
-
- inline VertexArrayObject(VertexArrayObject &&rhs) noexcept
- : vao(rhs.vao),
- bound_shader(rhs.bound_shader),
- bound_shader_name(rhs.bound_shader_name),
- bound_vertex_buffer(rhs.bound_vertex_buffer),
- bound_elements_buffer(rhs.bound_elements_buffer),
- bound_offset(rhs.bound_offset) {};
-
- template <typename Shader, typename VertexBuffer>
- inline void bind(Shader& shader, VertexBuffer &vertexBuffer, char *offset) {
- bindVertexArrayObject();
- if (bound_shader == 0) {
- vertexBuffer.bind();
- shader.bind(offset);
- if (vao) {
- storeBinding(shader, vertexBuffer.getID(), 0, offset);
- }
- } else {
- verifyBinding(shader, vertexBuffer.getID(), 0, offset);
- }
- }
-
- template <typename Shader, typename VertexBuffer, typename ElementsBuffer>
- inline void bind(Shader& shader, VertexBuffer &vertexBuffer, ElementsBuffer &elementsBuffer, char *offset) {
- bindVertexArrayObject();
- if (bound_shader == 0) {
- vertexBuffer.bind();
- elementsBuffer.bind();
- shader.bind(offset);
- if (vao) {
- storeBinding(shader, vertexBuffer.getID(), elementsBuffer.getID(), offset);
- }
- } else {
- verifyBinding(shader, vertexBuffer.getID(), elementsBuffer.getID(), offset);
- }
- }
-
- ~VertexArrayObject();
-
-private:
- void bindVertexArrayObject();
- void storeBinding(Shader &shader, GLuint vertexBuffer, GLuint elementsBuffer, char *offset);
- void verifyBinding(Shader &shader, GLuint vertexBuffer, GLuint elementsBuffer, char *offset);
-
- GLuint vao = 0;
-
- // For debug reasons, we're storing the bind information so that we can
- // detect errors and report
- GLuint bound_shader = 0;
- const char *bound_shader_name = "";
- GLuint bound_vertex_buffer = 0;
- GLuint bound_elements_buffer = 0;
- char *bound_offset = 0;
-};
-
-}
-
-#endif