diff options
-rw-r--r-- | src/mbgl/gl/texture_pool.cpp (renamed from src/mbgl/util/texture_pool.cpp) | 8 | ||||
-rw-r--r-- | src/mbgl/gl/texture_pool.hpp (renamed from src/mbgl/util/texture_pool.hpp) | 3 | ||||
-rw-r--r-- | src/mbgl/map/map_context.cpp | 5 | ||||
-rw-r--r-- | src/mbgl/map/map_context.hpp | 5 | ||||
-rw-r--r-- | src/mbgl/renderer/raster_bucket.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/raster_bucket.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/style.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/style.hpp | 6 | ||||
-rw-r--r-- | src/mbgl/style/style_update_parameters.hpp | 6 | ||||
-rw-r--r-- | src/mbgl/tile/raster_tile_data.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/tile/raster_tile_data.hpp | 6 | ||||
-rw-r--r-- | src/mbgl/util/raster.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/util/raster.hpp | 6 | ||||
-rw-r--r-- | test/style/source.cpp | 4 |
14 files changed, 33 insertions, 26 deletions
diff --git a/src/mbgl/util/texture_pool.cpp b/src/mbgl/gl/texture_pool.cpp index ec175c924a..9d0ff79b11 100644 --- a/src/mbgl/util/texture_pool.cpp +++ b/src/mbgl/gl/texture_pool.cpp @@ -1,4 +1,4 @@ -#include <mbgl/util/texture_pool.hpp> +#include <mbgl/gl/texture_pool.hpp> #include <mbgl/gl/gl_object_store.hpp> #include <mbgl/util/thread_context.hpp> @@ -7,7 +7,8 @@ const GLsizei TextureMax = 64; -using namespace mbgl; +namespace mbgl { +namespace gl { GLuint TexturePool::getTextureID() { if (texture_ids.empty()) { @@ -51,3 +52,6 @@ void TexturePool::clearTextureIDs() { } texture_ids.clear(); } + +} // namespace gl +} // namespace mbgl diff --git a/src/mbgl/util/texture_pool.hpp b/src/mbgl/gl/texture_pool.hpp index db462ab3e3..3981d98f08 100644 --- a/src/mbgl/util/texture_pool.hpp +++ b/src/mbgl/gl/texture_pool.hpp @@ -5,9 +5,9 @@ #include <mbgl/gl/gl.hpp> #include <set> -#include <mutex> namespace mbgl { +namespace gl { class TexturePool : private util::noncopyable { @@ -20,6 +20,7 @@ private: std::set<GLuint> texture_ids; }; +} // namespace gl } // namespace mbgl #endif diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 46d979a473..d9a7f47125 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -17,8 +17,9 @@ #include <mbgl/sprite/sprite_store.hpp> #include <mbgl/gl/gl_object_store.hpp> +#include <mbgl/gl/texture_pool.hpp> + #include <mbgl/util/worker.hpp> -#include <mbgl/util/texture_pool.hpp> #include <mbgl/util/exception.hpp> #include <mbgl/util/string.hpp> #include <mbgl/util/mapbox.hpp> @@ -33,7 +34,7 @@ MapContext::MapContext(View& view_, FileSource& fileSource, MapMode mode_, GLCon data(*dataPtr), asyncUpdate([this] { update(); }), asyncInvalidate([&view_] { view_.invalidate(); }), - texturePool(std::make_unique<TexturePool>()) { + texturePool(std::make_unique<gl::TexturePool>()) { assert(util::ThreadContext::currentlyOn(util::ThreadType::Map)); util::ThreadContext::setFileSource(&fileSource); diff --git a/src/mbgl/map/map_context.hpp b/src/mbgl/map/map_context.hpp index 617e178159..128d94dc3c 100644 --- a/src/mbgl/map/map_context.hpp +++ b/src/mbgl/map/map_context.hpp @@ -18,11 +18,12 @@ namespace mbgl { class View; class MapData; -class TexturePool; class Painter; class SpriteImage; class FileRequest; +namespace gl { class TexturePool; } + struct FrameData { std::array<uint16_t, 2> framebufferSize; }; @@ -86,7 +87,7 @@ private: util::AsyncTask asyncUpdate; util::AsyncTask asyncInvalidate; - std::unique_ptr<TexturePool> texturePool; + std::unique_ptr<gl::TexturePool> texturePool; std::unique_ptr<Painter> painter; std::unique_ptr<Style> style; diff --git a/src/mbgl/renderer/raster_bucket.cpp b/src/mbgl/renderer/raster_bucket.cpp index 4dbbf18697..0b19fa0c1e 100644 --- a/src/mbgl/renderer/raster_bucket.cpp +++ b/src/mbgl/renderer/raster_bucket.cpp @@ -5,7 +5,7 @@ using namespace mbgl; -RasterBucket::RasterBucket(TexturePool& texturePool) +RasterBucket::RasterBucket(gl::TexturePool& texturePool) : raster(texturePool) { } diff --git a/src/mbgl/renderer/raster_bucket.hpp b/src/mbgl/renderer/raster_bucket.hpp index 0f6237969a..92c6a8ea02 100644 --- a/src/mbgl/renderer/raster_bucket.hpp +++ b/src/mbgl/renderer/raster_bucket.hpp @@ -12,7 +12,7 @@ class VertexArrayObject; class RasterBucket : public Bucket { public: - RasterBucket(TexturePool&); + RasterBucket(gl::TexturePool&); void upload() override; void render(Painter&, const StyleLayer&, const TileID&, const mat4&) override; diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index b66575c36c..bf35d17c97 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -116,7 +116,7 @@ void Style::removeLayer(const std::string& id) { } void Style::update(const TransformState& transform, - TexturePool& texturePool) { + gl::TexturePool& texturePool) { bool allTilesUpdated = true; StyleUpdateParameters parameters(data.pixelRatio, data.getDebug(), diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp index c74181ed00..f42578f923 100644 --- a/src/mbgl/style/style.hpp +++ b/src/mbgl/style/style.hpp @@ -26,11 +26,11 @@ class SpriteAtlas; class LineAtlas; class StyleLayer; class TransformState; -class TexturePool; - class Tile; class Bucket; +namespace gl { class TexturePool; } + struct RenderItem { inline RenderItem(const StyleLayer& layer_, const Tile* tile_ = nullptr, @@ -79,7 +79,7 @@ public: // Fetch the tiles needed by the current viewport and emit a signal when // a tile is ready so observers can render the tile. - void update(const TransformState&, TexturePool&); + void update(const TransformState&, gl::TexturePool&); void cascade(); void recalculate(float z); diff --git a/src/mbgl/style/style_update_parameters.hpp b/src/mbgl/style/style_update_parameters.hpp index 0a646219f0..f9557fdf1b 100644 --- a/src/mbgl/style/style_update_parameters.hpp +++ b/src/mbgl/style/style_update_parameters.hpp @@ -7,9 +7,9 @@ namespace mbgl { class TransformState; class Worker; -class TexturePool; class MapData; class Style; +namespace gl { class TexturePool; } class StyleUpdateParameters { public: @@ -18,7 +18,7 @@ public: TimePoint animationTime_, const TransformState& transformState_, Worker& worker_, - TexturePool& texturePool_, + gl::TexturePool& texturePool_, bool shouldReparsePartialTiles_, const MapMode mode_, MapData& data_, @@ -39,7 +39,7 @@ public: TimePoint animationTime; const TransformState& transformState; Worker& worker; - TexturePool& texturePool; + gl::TexturePool& texturePool; bool shouldReparsePartialTiles; const MapMode mode; diff --git a/src/mbgl/tile/raster_tile_data.cpp b/src/mbgl/tile/raster_tile_data.cpp index 797ee2a2b8..25b20e42c2 100644 --- a/src/mbgl/tile/raster_tile_data.cpp +++ b/src/mbgl/tile/raster_tile_data.cpp @@ -11,7 +11,7 @@ using namespace mbgl; RasterTileData::RasterTileData(const TileID& id_, float pixelRatio, const std::string& urlTemplate, - TexturePool &texturePool_, + gl::TexturePool &texturePool_, Worker& worker_, const std::function<void(std::exception_ptr)>& callback) : TileData(id_), diff --git a/src/mbgl/tile/raster_tile_data.hpp b/src/mbgl/tile/raster_tile_data.hpp index 466d5fbf5e..8d5e901d99 100644 --- a/src/mbgl/tile/raster_tile_data.hpp +++ b/src/mbgl/tile/raster_tile_data.hpp @@ -8,15 +8,15 @@ namespace mbgl { class FileRequest; class StyleLayer; -class TexturePool; class WorkRequest; +namespace gl { class TexturePool; } class RasterTileData : public TileData { public: RasterTileData(const TileID&, float pixelRatio, const std::string& urlTemplate, - TexturePool&, + gl::TexturePool&, Worker&, const std::function<void(std::exception_ptr)>& callback); ~RasterTileData(); @@ -25,7 +25,7 @@ public: Bucket* getBucket(StyleLayer const &layer_desc) override; private: - TexturePool& texturePool; + gl::TexturePool& texturePool; Worker& worker; std::unique_ptr<FileRequest> req; std::unique_ptr<Bucket> bucket; diff --git a/src/mbgl/util/raster.cpp b/src/mbgl/util/raster.cpp index fea48060a9..bf0de1330d 100644 --- a/src/mbgl/util/raster.cpp +++ b/src/mbgl/util/raster.cpp @@ -9,7 +9,7 @@ using namespace mbgl; -Raster::Raster(TexturePool& texturePool_) +Raster::Raster(gl::TexturePool& texturePool_) : texturePool(texturePool_) {} diff --git a/src/mbgl/util/raster.hpp b/src/mbgl/util/raster.hpp index 807ac11c03..f19f679bd5 100644 --- a/src/mbgl/util/raster.hpp +++ b/src/mbgl/util/raster.hpp @@ -2,7 +2,7 @@ #define MBGL_UTIL_RASTER #include <mbgl/gl/gl.hpp> -#include <mbgl/util/texture_pool.hpp> +#include <mbgl/gl/texture_pool.hpp> #include <mbgl/util/image.hpp> #include <mbgl/util/ptr.hpp> #include <mbgl/util/chrono.hpp> @@ -14,7 +14,7 @@ namespace mbgl { class Raster : public std::enable_shared_from_this<Raster> { public: - Raster(TexturePool&); + Raster(gl::TexturePool&); ~Raster(); // load image data @@ -50,7 +50,7 @@ private: bool loaded = false; // shared texture pool - TexturePool& texturePool; + gl::TexturePool& texturePool; // min/mag filter GLint filter = 0; diff --git a/test/style/source.cpp b/test/style/source.cpp index 9b3857fc07..993d827ce1 100644 --- a/test/style/source.cpp +++ b/test/style/source.cpp @@ -12,7 +12,7 @@ #include <mbgl/map/transform.hpp> #include <mbgl/map/map_data.hpp> #include <mbgl/util/worker.hpp> -#include <mbgl/util/texture_pool.hpp> +#include <mbgl/gl/texture_pool.hpp> #include <mbgl/style/style.hpp> #include <mbgl/style/style_update_parameters.hpp> #include <mbgl/layer/line_layer.hpp> @@ -29,7 +29,7 @@ public: Transform transform { view, ConstrainMode::HeightOnly }; TransformState transformState; Worker worker { 1 }; - TexturePool texturePool; + gl::TexturePool texturePool; MapData mapData { MapMode::Still, GLContextMode::Unique, 1.0 }; Style style { mapData }; |