diff options
Diffstat (limited to 'src/mbgl')
31 files changed, 43 insertions, 48 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; }; diff --git a/src/mbgl/programs/segment.hpp b/src/mbgl/programs/segment.hpp index 1fb25982a5..5158ce7dbf 100644 --- a/src/mbgl/programs/segment.hpp +++ b/src/mbgl/programs/segment.hpp @@ -1,6 +1,5 @@ #pragma once -#include <mbgl/gl/context.hpp> #include <mbgl/gl/vertex_array.hpp> #include <cstddef> diff --git a/src/mbgl/renderer/bucket.hpp b/src/mbgl/renderer/bucket.hpp index c7570fcd02..1d775ede04 100644 --- a/src/mbgl/renderer/bucket.hpp +++ b/src/mbgl/renderer/bucket.hpp @@ -8,9 +8,9 @@ namespace mbgl { -namespace gl { +namespace gfx { class Context; -} // namespace gl +} // namespace gfx class RenderLayer; class PatternDependency; @@ -36,7 +36,7 @@ public: // As long as this bucket has a Prepare render pass, this function is getting called. Typically, // this only happens once when the bucket is being rendered for the first time. - virtual void upload(gl::Context&) = 0; + virtual void upload(gfx::Context&) = 0; virtual bool hasData() const = 0; diff --git a/src/mbgl/renderer/buckets/circle_bucket.cpp b/src/mbgl/renderer/buckets/circle_bucket.cpp index 8ebc685df3..54ed374069 100644 --- a/src/mbgl/renderer/buckets/circle_bucket.cpp +++ b/src/mbgl/renderer/buckets/circle_bucket.cpp @@ -24,7 +24,7 @@ CircleBucket::CircleBucket(const BucketParameters& parameters, const std::vector CircleBucket::~CircleBucket() = default; -void CircleBucket::upload(gl::Context& context) { +void CircleBucket::upload(gfx::Context& context) { vertexBuffer = context.createVertexBuffer(std::move(vertices)); indexBuffer = context.createIndexBuffer(std::move(triangles)); diff --git a/src/mbgl/renderer/buckets/circle_bucket.hpp b/src/mbgl/renderer/buckets/circle_bucket.hpp index 27fdd5339c..e9aceed2b1 100644 --- a/src/mbgl/renderer/buckets/circle_bucket.hpp +++ b/src/mbgl/renderer/buckets/circle_bucket.hpp @@ -25,7 +25,7 @@ public: bool hasData() const override; - void upload(gl::Context&) override; + void upload(gfx::Context&) override; float getQueryRadius(const RenderLayer&) const override; bool supportsLayer(const style::Layer::Impl&) const override; diff --git a/src/mbgl/renderer/buckets/debug_bucket.cpp b/src/mbgl/renderer/buckets/debug_bucket.cpp index 0de6cccdb2..32a6e37aea 100644 --- a/src/mbgl/renderer/buckets/debug_bucket.cpp +++ b/src/mbgl/renderer/buckets/debug_bucket.cpp @@ -16,7 +16,7 @@ DebugBucket::DebugBucket(const OverscaledTileID& id, optional<Timestamp> modified_, optional<Timestamp> expires_, MapDebugOptions debugMode_, - gl::Context& context) + gfx::Context& context) : renderable(renderable_), complete(complete_), modified(std::move(modified_)), diff --git a/src/mbgl/renderer/buckets/debug_bucket.hpp b/src/mbgl/renderer/buckets/debug_bucket.hpp index 5623e9697d..0335c096bd 100644 --- a/src/mbgl/renderer/buckets/debug_bucket.hpp +++ b/src/mbgl/renderer/buckets/debug_bucket.hpp @@ -25,7 +25,7 @@ public: optional<Timestamp> modified, optional<Timestamp> expires, MapDebugOptions, - gl::Context&); + gfx::Context&); const bool renderable; const bool complete; diff --git a/src/mbgl/renderer/buckets/fill_bucket.cpp b/src/mbgl/renderer/buckets/fill_bucket.cpp index 302b708713..927cb4a307 100644 --- a/src/mbgl/renderer/buckets/fill_bucket.cpp +++ b/src/mbgl/renderer/buckets/fill_bucket.cpp @@ -121,7 +121,7 @@ void FillBucket::addFeature(const GeometryTileFeature& feature, } } -void FillBucket::upload(gl::Context& context) { +void FillBucket::upload(gfx::Context& context) { vertexBuffer = context.createVertexBuffer(std::move(vertices)); lineIndexBuffer = context.createIndexBuffer(std::move(lines)); triangleIndexBuffer = context.createIndexBuffer(std::move(triangles)); diff --git a/src/mbgl/renderer/buckets/fill_bucket.hpp b/src/mbgl/renderer/buckets/fill_bucket.hpp index 3ff3ecc1aa..e1869e08d2 100644 --- a/src/mbgl/renderer/buckets/fill_bucket.hpp +++ b/src/mbgl/renderer/buckets/fill_bucket.hpp @@ -35,7 +35,7 @@ public: bool hasData() const override; - void upload(gl::Context&) override; + void upload(gfx::Context&) override; float getQueryRadius(const RenderLayer&) const override; bool supportsLayer(const style::Layer::Impl&) const override; diff --git a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp index 77d9bfd907..e640cf504d 100644 --- a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp +++ b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp @@ -165,7 +165,7 @@ void FillExtrusionBucket::addFeature(const GeometryTileFeature& feature, } } -void FillExtrusionBucket::upload(gl::Context& context) { +void FillExtrusionBucket::upload(gfx::Context& context) { vertexBuffer = context.createVertexBuffer(std::move(vertices)); indexBuffer = context.createIndexBuffer(std::move(triangles)); diff --git a/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp b/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp index 0065231b9e..81685e2c42 100644 --- a/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp +++ b/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp @@ -35,7 +35,7 @@ public: bool supportsLayer(const style::Layer::Impl&) const override; - void upload(gl::Context&) override; + void upload(gfx::Context&) override; float getQueryRadius(const RenderLayer&) const override; diff --git a/src/mbgl/renderer/buckets/heatmap_bucket.cpp b/src/mbgl/renderer/buckets/heatmap_bucket.cpp index ca1264305f..04fd58ec55 100644 --- a/src/mbgl/renderer/buckets/heatmap_bucket.cpp +++ b/src/mbgl/renderer/buckets/heatmap_bucket.cpp @@ -24,7 +24,7 @@ HeatmapBucket::HeatmapBucket(const BucketParameters& parameters, const std::vect HeatmapBucket::~HeatmapBucket() = default; -void HeatmapBucket::upload(gl::Context& context) { +void HeatmapBucket::upload(gfx::Context& context) { vertexBuffer = context.createVertexBuffer(std::move(vertices)); indexBuffer = context.createIndexBuffer(std::move(triangles)); diff --git a/src/mbgl/renderer/buckets/heatmap_bucket.hpp b/src/mbgl/renderer/buckets/heatmap_bucket.hpp index 7b3fdacd77..62cb460e27 100644 --- a/src/mbgl/renderer/buckets/heatmap_bucket.hpp +++ b/src/mbgl/renderer/buckets/heatmap_bucket.hpp @@ -24,7 +24,7 @@ public: const PatternLayerMap&) override; bool hasData() const override; - void upload(gl::Context&) override; + void upload(gfx::Context&) override; float getQueryRadius(const RenderLayer&) const override; bool supportsLayer(const style::Layer::Impl&) const override; diff --git a/src/mbgl/renderer/buckets/hillshade_bucket.cpp b/src/mbgl/renderer/buckets/hillshade_bucket.cpp index 6affd53196..588e4e50b1 100644 --- a/src/mbgl/renderer/buckets/hillshade_bucket.cpp +++ b/src/mbgl/renderer/buckets/hillshade_bucket.cpp @@ -26,7 +26,7 @@ DEMData& HillshadeBucket::getDEMData() { return demdata; } -void HillshadeBucket::upload(gl::Context& context) { +void HillshadeBucket::upload(gfx::Context& context) { if (!hasData()) { return; } diff --git a/src/mbgl/renderer/buckets/hillshade_bucket.hpp b/src/mbgl/renderer/buckets/hillshade_bucket.hpp index 906eac7e58..f3e89642cc 100644 --- a/src/mbgl/renderer/buckets/hillshade_bucket.hpp +++ b/src/mbgl/renderer/buckets/hillshade_bucket.hpp @@ -22,7 +22,7 @@ public: HillshadeBucket(DEMData&&); ~HillshadeBucket() override; - void upload(gl::Context&) override; + void upload(gfx::Context&) override; bool hasData() const override; bool supportsLayer(const style::Layer::Impl&) const override; diff --git a/src/mbgl/renderer/buckets/line_bucket.cpp b/src/mbgl/renderer/buckets/line_bucket.cpp index 8d13bf0793..398a0b4c0f 100644 --- a/src/mbgl/renderer/buckets/line_bucket.cpp +++ b/src/mbgl/renderer/buckets/line_bucket.cpp @@ -508,7 +508,7 @@ void LineBucket::addPieSliceVertex(const GeometryCoordinate& currentVertex, } } -void LineBucket::upload(gl::Context& context) { +void LineBucket::upload(gfx::Context& context) { vertexBuffer = context.createVertexBuffer(std::move(vertices)); indexBuffer = context.createIndexBuffer(std::move(triangles)); diff --git a/src/mbgl/renderer/buckets/line_bucket.hpp b/src/mbgl/renderer/buckets/line_bucket.hpp index 069e27bfd9..6b8d7e786c 100644 --- a/src/mbgl/renderer/buckets/line_bucket.hpp +++ b/src/mbgl/renderer/buckets/line_bucket.hpp @@ -36,7 +36,7 @@ public: bool hasData() const override; - void upload(gl::Context&) override; + void upload(gfx::Context&) override; float getQueryRadius(const RenderLayer&) const override; bool supportsLayer(const style::Layer::Impl&) const override; diff --git a/src/mbgl/renderer/buckets/raster_bucket.cpp b/src/mbgl/renderer/buckets/raster_bucket.cpp index a1884b8f7a..bf6dffbf17 100644 --- a/src/mbgl/renderer/buckets/raster_bucket.cpp +++ b/src/mbgl/renderer/buckets/raster_bucket.cpp @@ -17,7 +17,7 @@ RasterBucket::RasterBucket(std::shared_ptr<PremultipliedImage> image_) RasterBucket::~RasterBucket() = default; -void RasterBucket::upload(gl::Context& context) { +void RasterBucket::upload(gfx::Context& context) { if (!hasData()) { return; } diff --git a/src/mbgl/renderer/buckets/raster_bucket.hpp b/src/mbgl/renderer/buckets/raster_bucket.hpp index 4c4ca50320..143daf3348 100644 --- a/src/mbgl/renderer/buckets/raster_bucket.hpp +++ b/src/mbgl/renderer/buckets/raster_bucket.hpp @@ -18,7 +18,7 @@ public: RasterBucket(std::shared_ptr<PremultipliedImage>); ~RasterBucket() override; - void upload(gl::Context&) override; + void upload(gfx::Context&) override; bool hasData() const override; bool supportsLayer(const style::Layer::Impl&) const override; diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp index fafc9816fa..3a3688a60b 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.cpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp @@ -41,7 +41,7 @@ SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layo SymbolBucket::~SymbolBucket() = default; -void SymbolBucket::upload(gl::Context& context) { +void SymbolBucket::upload(gfx::Context& context) { if (hasTextData()) { if (!staticUploaded) { text.indexBuffer = context.createIndexBuffer(std::move(text.triangles), sortFeaturesByY ? gfx::BufferUsageType::StreamDraw : gfx::BufferUsageType::StaticDraw); diff --git a/src/mbgl/renderer/buckets/symbol_bucket.hpp b/src/mbgl/renderer/buckets/symbol_bucket.hpp index 67662927ba..709e48dd2e 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.hpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.hpp @@ -51,7 +51,7 @@ public: const std::vector<SymbolInstance>&&); ~SymbolBucket() override; - void upload(gl::Context&) override; + void upload(gfx::Context&) override; bool hasData() const override; bool supportsLayer(const style::Layer::Impl&) const override; bool hasTextData() const; diff --git a/src/mbgl/renderer/image_manager.cpp b/src/mbgl/renderer/image_manager.cpp index 4d0f010e49..d8f8cf615d 100644 --- a/src/mbgl/renderer/image_manager.cpp +++ b/src/mbgl/renderer/image_manager.cpp @@ -1,6 +1,6 @@ #include <mbgl/renderer/image_manager.hpp> #include <mbgl/util/logging.hpp> -#include <mbgl/gl/context.hpp> +#include <mbgl/gfx/context.hpp> namespace mbgl { @@ -167,7 +167,7 @@ Size ImageManager::getPixelSize() const { }; } -void ImageManager::upload(gl::Context& context, uint8_t unit) { +void ImageManager::upload(gfx::Context& context, uint8_t unit) { if (!atlasTexture) { atlasTexture = context.createTexture(atlasImage, unit); } else if (dirty) { @@ -177,7 +177,7 @@ void ImageManager::upload(gl::Context& context, uint8_t unit) { dirty = false; } -void ImageManager::bind(gl::Context& context, uint8_t unit) { +void ImageManager::bind(gfx::Context& context, uint8_t unit) { upload(context, unit); context.bindTexture(*atlasTexture, unit, gfx::TextureFilterType::Linear); } diff --git a/src/mbgl/renderer/image_manager.hpp b/src/mbgl/renderer/image_manager.hpp index e4b251e92b..acc076965e 100644 --- a/src/mbgl/renderer/image_manager.hpp +++ b/src/mbgl/renderer/image_manager.hpp @@ -14,9 +14,9 @@ namespace mbgl { -namespace gl { +namespace gfx { class Context; -} // namespace gl +} // namespace gfx class ImageRequestor { public: @@ -65,8 +65,8 @@ private: public: optional<ImagePosition> getPattern(const std::string& name); - void bind(gl::Context&, uint8_t unit); - void upload(gl::Context&, uint8_t unit); + void bind(gfx::Context&, uint8_t unit); + void upload(gfx::Context&, uint8_t unit); Size getPixelSize() const; diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp index 977744248d..a538e6e97c 100644 --- a/src/mbgl/tile/geometry_tile.cpp +++ b/src/mbgl/tile/geometry_tile.cpp @@ -173,7 +173,7 @@ const optional<ImagePosition> GeometryTile::getPattern(const std::string& patter return {}; } -void GeometryTile::upload(gl::Context& context) { +void GeometryTile::upload(gfx::Context& context) { auto uploadFn = [&] (Bucket& bucket) { if (bucket.needsUpload()) { bucket.upload(context); diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp index 3f6f07e26e..b652e7ba5d 100644 --- a/src/mbgl/tile/geometry_tile.hpp +++ b/src/mbgl/tile/geometry_tile.hpp @@ -42,12 +42,9 @@ public: void getGlyphs(GlyphDependencies); void getImages(ImageRequestPair); - void upload(gl::Context&) override; + void upload(gfx::Context&) override; Bucket* getBucket(const style::Layer::Impl&) const override; - Size bindGlyphAtlas(gl::Context&); - Size bindIconAtlas(gl::Context&); - void queryRenderedFeatures( std::unordered_map<std::string, std::vector<Feature>>& result, const GeometryCoordinates& queryGeometry, diff --git a/src/mbgl/tile/raster_dem_tile.cpp b/src/mbgl/tile/raster_dem_tile.cpp index 751f69bad9..ba961853d0 100644 --- a/src/mbgl/tile/raster_dem_tile.cpp +++ b/src/mbgl/tile/raster_dem_tile.cpp @@ -69,7 +69,7 @@ void RasterDEMTile::onError(std::exception_ptr err, const uint64_t resultCorrela observer->onTileError(*this, err); } -void RasterDEMTile::upload(gl::Context& context) { +void RasterDEMTile::upload(gfx::Context& context) { if (bucket) { bucket->upload(context); } diff --git a/src/mbgl/tile/raster_dem_tile.hpp b/src/mbgl/tile/raster_dem_tile.hpp index 0c8dd75961..ed25218e10 100644 --- a/src/mbgl/tile/raster_dem_tile.hpp +++ b/src/mbgl/tile/raster_dem_tile.hpp @@ -72,7 +72,7 @@ public: void setMetadata(optional<Timestamp> modified, optional<Timestamp> expires); void setData(std::shared_ptr<const std::string> data); - void upload(gl::Context&) override; + void upload(gfx::Context&) override; Bucket* getBucket(const style::Layer::Impl&) const override; HillshadeBucket* getBucket() const; diff --git a/src/mbgl/tile/raster_tile.cpp b/src/mbgl/tile/raster_tile.cpp index 1346f87ae5..22561ec11d 100644 --- a/src/mbgl/tile/raster_tile.cpp +++ b/src/mbgl/tile/raster_tile.cpp @@ -58,7 +58,7 @@ void RasterTile::onError(std::exception_ptr err, const uint64_t resultCorrelatio observer->onTileError(*this, err); } -void RasterTile::upload(gl::Context& context) { +void RasterTile::upload(gfx::Context& context) { if (bucket) { bucket->upload(context); } diff --git a/src/mbgl/tile/raster_tile.hpp b/src/mbgl/tile/raster_tile.hpp index e25329119a..40f1e66bbc 100644 --- a/src/mbgl/tile/raster_tile.hpp +++ b/src/mbgl/tile/raster_tile.hpp @@ -28,7 +28,7 @@ public: void setMetadata(optional<Timestamp> modified, optional<Timestamp> expires); void setData(std::shared_ptr<const std::string> data); - void upload(gl::Context&) override; + void upload(gfx::Context&) override; Bucket* getBucket(const style::Layer::Impl&) const override; void setMask(TileMask&&) override; diff --git a/src/mbgl/tile/tile.hpp b/src/mbgl/tile/tile.hpp index 3bd655a6c8..7708aecf17 100644 --- a/src/mbgl/tile/tile.hpp +++ b/src/mbgl/tile/tile.hpp @@ -51,7 +51,7 @@ public: // Mark this tile as no longer needed and cancel any pending work. virtual void cancel(); - virtual void upload(gl::Context&) = 0; + virtual void upload(gfx::Context&) = 0; virtual Bucket* getBucket(const style::Layer::Impl&) const = 0; template <class T> |