summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-07-11 19:15:10 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-07-12 20:42:29 +0300
commit2fae373fc9da1a5ed61b5114d8c982073734826d (patch)
tree105ce580cc7df0cf9cf0a9997c4702bc76b3faeb
parent21031b624ffabf92bf284c830b3d13a3ae045460 (diff)
downloadqtlocation-mapboxgl-2fae373fc9da1a5ed61b5114d8c982073734826d.tar.gz
[core] GCC 4.9 is unable to deduce ctors when using bracket init
-rw-r--r--include/mbgl/annotation/annotation.hpp34
-rw-r--r--include/mbgl/map/query.hpp10
-rw-r--r--include/mbgl/style/transition_options.hpp5
-rw-r--r--include/mbgl/util/tileset.hpp13
-rw-r--r--platform/darwin/src/MGLMultiPoint.mm2
-rw-r--r--src/mbgl/gl/texture.hpp20
-rw-r--r--src/mbgl/renderer/tile_parameters.hpp27
-rw-r--r--src/mbgl/renderer/update_parameters.hpp35
-rw-r--r--src/mbgl/tile/geometry_tile.hpp24
-rw-r--r--test/algorithm/generate_clip_ids.test.cpp9
-rw-r--r--test/style/source.test.cpp3
-rw-r--r--test/tile/annotation_tile.test.cpp3
-rw-r--r--test/tile/geojson_tile.test.cpp3
-rw-r--r--test/tile/raster_tile.test.cpp3
-rw-r--r--test/tile/vector_tile.test.cpp3
15 files changed, 169 insertions, 25 deletions
diff --git a/include/mbgl/annotation/annotation.hpp b/include/mbgl/annotation/annotation.hpp
index 96e06ca222..bbe479b5ba 100644
--- a/include/mbgl/annotation/annotation.hpp
+++ b/include/mbgl/annotation/annotation.hpp
@@ -17,6 +17,10 @@ using AnnotationIDs = std::vector<AnnotationID>;
class SymbolAnnotation {
public:
+ SymbolAnnotation(Point<double> geometry_, std::string icon_ = {})
+ : geometry(std::move(geometry_)),
+ icon(std::move(icon_)) {}
+
Point<double> geometry;
std::string icon;
};
@@ -29,18 +33,36 @@ using ShapeAnnotationGeometry = variant<
class LineAnnotation {
public:
+ LineAnnotation(ShapeAnnotationGeometry geometry_,
+ style::DataDrivenPropertyValue<float> opacity_ = 1.0f,
+ style::DataDrivenPropertyValue<float> width_ = 1.0f,
+ style::DataDrivenPropertyValue<Color> color_ = Color::black())
+ : geometry(std::move(geometry_)),
+ opacity(std::move(opacity_)),
+ width(std::move(width_)),
+ color(std::move(color_)) {}
+
ShapeAnnotationGeometry geometry;
- style::DataDrivenPropertyValue<float> opacity { 1.0f };
- style::DataDrivenPropertyValue<float> width { 1.0f };
- style::DataDrivenPropertyValue<Color> color { Color::black() };
+ style::DataDrivenPropertyValue<float> opacity;
+ style::DataDrivenPropertyValue<float> width;
+ style::DataDrivenPropertyValue<Color> color;
};
class FillAnnotation {
public:
+ FillAnnotation(ShapeAnnotationGeometry geometry_,
+ style::DataDrivenPropertyValue<float> opacity_ = 1.0f,
+ style::DataDrivenPropertyValue<Color> color_ = Color::black(),
+ style::DataDrivenPropertyValue<Color> outlineColor_ = {})
+ : geometry(std::move(geometry_)),
+ opacity(std::move(opacity_)),
+ color(std::move(color_)),
+ outlineColor(std::move(outlineColor_)) {}
+
ShapeAnnotationGeometry geometry;
- style::DataDrivenPropertyValue<float> opacity { 1.0f };
- style::DataDrivenPropertyValue<Color> color { Color::black() };
- style::DataDrivenPropertyValue<Color> outlineColor {};
+ style::DataDrivenPropertyValue<float> opacity;
+ style::DataDrivenPropertyValue<Color> color;
+ style::DataDrivenPropertyValue<Color> outlineColor;
};
using Annotation = variant<
diff --git a/include/mbgl/map/query.hpp b/include/mbgl/map/query.hpp
index e114fa2ebd..b9d5f21a44 100644
--- a/include/mbgl/map/query.hpp
+++ b/include/mbgl/map/query.hpp
@@ -13,6 +13,11 @@ namespace mbgl {
*/
class RenderedQueryOptions {
public:
+ RenderedQueryOptions(optional<std::vector<std::string>> layerIDs_ = optional<std::vector<std::string>>(),
+ optional<style::Filter> filter_ = optional<style::Filter>())
+ : layerIDs(std::move(layerIDs_)),
+ filter(std::move(filter_)) {}
+
/** layerIDs to include in the query */
optional<std::vector<std::string>> layerIDs;
@@ -24,6 +29,11 @@ public:
*/
class SourceQueryOptions {
public:
+ SourceQueryOptions(optional<std::vector<std::string>> sourceLayers_ = optional<std::vector<std::string>> (),
+ optional<style::Filter> filter_ = optional<style::Filter>())
+ : sourceLayers(std::move(sourceLayers_)),
+ filter(std::move(filter_)) {}
+
// Required for VectorSource, ignored for GeoJSONSource
optional<std::vector<std::string>> sourceLayers;
diff --git a/include/mbgl/style/transition_options.hpp b/include/mbgl/style/transition_options.hpp
index 1583667025..6dad17aeb4 100644
--- a/include/mbgl/style/transition_options.hpp
+++ b/include/mbgl/style/transition_options.hpp
@@ -11,6 +11,11 @@ public:
optional<Duration> duration = {};
optional<Duration> delay = {};
+ TransitionOptions(optional<Duration> duration_ = optional<Duration>(),
+ optional<Duration> delay_ = optional<Duration>())
+ : duration(std::move(duration_)),
+ delay(std::move(delay_)) {}
+
TransitionOptions reverseMerge(const TransitionOptions& defaults) const {
return {
duration ? duration : defaults.duration,
diff --git a/include/mbgl/util/tileset.hpp b/include/mbgl/util/tileset.hpp
index 1256e9fe96..2fa19d3f53 100644
--- a/include/mbgl/util/tileset.hpp
+++ b/include/mbgl/util/tileset.hpp
@@ -13,9 +13,18 @@ public:
enum class Scheme : bool { XYZ, TMS };
std::vector<std::string> tiles;
- Range<uint8_t> zoomRange { 0, 22 };
+ Range<uint8_t> zoomRange;
std::string attribution;
- Scheme scheme = Scheme::XYZ;
+ Scheme scheme;
+
+ Tileset(std::vector<std::string> tiles_ = std::vector<std::string>(),
+ Range<uint8_t> zoomRange_ = { 0, 22 },
+ std::string attribution_ = {},
+ Scheme scheme_ = Scheme::XYZ)
+ : tiles(std::move(tiles_)),
+ zoomRange(std::move(zoomRange_)),
+ attribution(std::move(attribution_)),
+ scheme(scheme_) {}
// TileJSON also includes center, zoom, and bounds, but they are not used by mbgl.
diff --git a/platform/darwin/src/MGLMultiPoint.mm b/platform/darwin/src/MGLMultiPoint.mm
index ef46bbb0fe..240dad9614 100644
--- a/platform/darwin/src/MGLMultiPoint.mm
+++ b/platform/darwin/src/MGLMultiPoint.mm
@@ -182,7 +182,7 @@
- (mbgl::Annotation)annotationObjectWithDelegate:(__unused id <MGLMultiPointDelegate>)delegate
{
NSAssert(NO, @"Cannot add an annotation from an instance of %@", NSStringFromClass([self class]));
- return mbgl::SymbolAnnotation({mbgl::Point<double>()});
+ return mbgl::SymbolAnnotation(mbgl::Point<double>());
}
- (NSString *)description
diff --git a/src/mbgl/gl/texture.hpp b/src/mbgl/gl/texture.hpp
index 5330689ac2..625e69233a 100644
--- a/src/mbgl/gl/texture.hpp
+++ b/src/mbgl/gl/texture.hpp
@@ -8,12 +8,24 @@ namespace gl {
class Texture {
public:
+ Texture(Size size_, UniqueTexture texture_,
+ TextureFilter filter_ = TextureFilter::Nearest,
+ TextureMipMap mipmap_ = TextureMipMap::No,
+ TextureWrap wrapX_ = TextureWrap::Clamp,
+ TextureWrap wrapY_ = TextureWrap::Clamp)
+ : size(std::move(size_)),
+ texture(std::move(texture_)),
+ filter(filter_),
+ mipmap(mipmap_),
+ wrapX(wrapX_),
+ wrapY(wrapY_) {}
+
Size size;
UniqueTexture texture;
- TextureFilter filter = TextureFilter::Nearest;
- TextureMipMap mipmap = TextureMipMap::No;
- TextureWrap wrapX = TextureWrap::Clamp;
- TextureWrap wrapY = TextureWrap::Clamp;
+ TextureFilter filter;
+ TextureMipMap mipmap;
+ TextureWrap wrapX;
+ TextureWrap wrapY;
};
} // namespace gl
diff --git a/src/mbgl/renderer/tile_parameters.hpp b/src/mbgl/renderer/tile_parameters.hpp
index 9769ae6897..333f796331 100644
--- a/src/mbgl/renderer/tile_parameters.hpp
+++ b/src/mbgl/renderer/tile_parameters.hpp
@@ -13,8 +13,29 @@ class GlyphManager;
class TileParameters {
public:
- float pixelRatio;
- MapDebugOptions debugOptions;
+ TileParameters(const float pixelRatio_,
+ const MapDebugOptions debugOptions_,
+ const TransformState& transformState_,
+ Scheduler& workerScheduler_,
+ FileSource& fileSource_,
+ const MapMode mode_,
+ AnnotationManager& annotationManager_,
+ ImageManager& imageManager_,
+ GlyphManager& glyphManager_,
+ const uint8_t prefetchZoomDelta_)
+ : pixelRatio(pixelRatio_),
+ debugOptions(debugOptions_),
+ transformState(std::move(transformState_)),
+ workerScheduler(workerScheduler_),
+ fileSource(fileSource_),
+ mode(mode_),
+ annotationManager(annotationManager_),
+ imageManager(imageManager_),
+ glyphManager(glyphManager_),
+ prefetchZoomDelta(prefetchZoomDelta_) {}
+
+ const float pixelRatio;
+ const MapDebugOptions debugOptions;
const TransformState& transformState;
Scheduler& workerScheduler;
FileSource& fileSource;
@@ -22,7 +43,7 @@ public:
AnnotationManager& annotationManager;
ImageManager& imageManager;
GlyphManager& glyphManager;
- const uint8_t prefetchZoomDelta = 0;
+ const uint8_t prefetchZoomDelta;
};
} // namespace mbgl
diff --git a/src/mbgl/renderer/update_parameters.hpp b/src/mbgl/renderer/update_parameters.hpp
index 8ebcd11e21..04b59699b3 100644
--- a/src/mbgl/renderer/update_parameters.hpp
+++ b/src/mbgl/renderer/update_parameters.hpp
@@ -16,6 +16,39 @@ class AnnotationManager;
class UpdateParameters {
public:
+ UpdateParameters(const MapMode mode_,
+ const float pixelRatio_,
+ const MapDebugOptions debugOptions_,
+ const TimePoint timePoint_,
+ const TransformState TransformState_,
+ const std::string glyphURL_,
+ const bool spriteLoaded_,
+ const style::TransitionOptions transitionOptions_,
+ const Immutable<style::Light::Impl> light_,
+ const Immutable<std::vector<Immutable<style::Image::Impl>>> images_,
+ const Immutable<std::vector<Immutable<style::Source::Impl>>> sources_,
+ const Immutable<std::vector<Immutable<style::Layer::Impl>>> layers_,
+ Scheduler& scheduler_,
+ FileSource& fileSource_,
+ AnnotationManager& annotationManager_,
+ const uint8_t prefetchZoomDelta_)
+ : mode(mode_),
+ pixelRatio(pixelRatio_),
+ debugOptions(debugOptions_),
+ timePoint(std::move(timePoint_)),
+ transformState(std::move(TransformState_)),
+ glyphURL(std::move(glyphURL_)),
+ spriteLoaded(spriteLoaded_),
+ transitionOptions(std::move(transitionOptions_)),
+ light(std::move(light_)),
+ images(std::move(images_)),
+ sources(std::move(sources_)),
+ layers(std::move(layers_)),
+ scheduler(scheduler_),
+ fileSource(fileSource_),
+ annotationManager(annotationManager_),
+ prefetchZoomDelta(prefetchZoomDelta_) {}
+
const MapMode mode;
const float pixelRatio;
const MapDebugOptions debugOptions;
@@ -34,7 +67,7 @@ public:
FileSource& fileSource;
AnnotationManager& annotationManager;
- const uint8_t prefetchZoomDelta = 0;
+ const uint8_t prefetchZoomDelta;
};
} // namespace mbgl
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index 943296e01b..c45762742b 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -5,9 +5,11 @@
#include <mbgl/renderer/image_manager.hpp>
#include <mbgl/text/glyph_manager.hpp>
#include <mbgl/text/placement_config.hpp>
+#include <mbgl/text/collision_tile.hpp>
#include <mbgl/util/feature.hpp>
#include <mbgl/util/throttler.hpp>
#include <mbgl/actor/actor.hpp>
+#include <mbgl/geometry/feature_index.hpp>
#include <atomic>
#include <memory>
@@ -17,8 +19,6 @@
namespace mbgl {
class GeometryTileData;
-class FeatureIndex;
-class CollisionTile;
class RenderStyle;
class RenderLayer;
class SourceQueryOptions;
@@ -71,6 +71,15 @@ public:
std::unique_ptr<FeatureIndex> featureIndex;
std::unique_ptr<GeometryTileData> tileData;
uint64_t correlationID;
+
+ LayoutResult(std::unordered_map<std::string, std::shared_ptr<Bucket>> nonSymbolBuckets_,
+ std::unique_ptr<FeatureIndex> featureIndex_,
+ std::unique_ptr<GeometryTileData> tileData_,
+ uint64_t correlationID_)
+ : nonSymbolBuckets(std::move(nonSymbolBuckets_)),
+ featureIndex(std::move(featureIndex_)),
+ tileData(std::move(tileData_)),
+ correlationID(correlationID_) {}
};
void onLayout(LayoutResult);
@@ -81,6 +90,17 @@ public:
optional<AlphaImage> glyphAtlasImage;
optional<PremultipliedImage> iconAtlasImage;
uint64_t correlationID;
+
+ PlacementResult(std::unordered_map<std::string, std::shared_ptr<Bucket>> symbolBuckets_,
+ std::unique_ptr<CollisionTile> collisionTile_,
+ optional<AlphaImage> glyphAtlasImage_,
+ optional<PremultipliedImage> iconAtlasImage_,
+ uint64_t correlationID_)
+ : symbolBuckets(std::move(symbolBuckets_)),
+ collisionTile(std::move(collisionTile_)),
+ glyphAtlasImage(std::move(glyphAtlasImage_)),
+ iconAtlasImage(std::move(iconAtlasImage_)),
+ correlationID(correlationID_) {}
};
void onPlacement(PlacementResult);
diff --git a/test/algorithm/generate_clip_ids.test.cpp b/test/algorithm/generate_clip_ids.test.cpp
index 46a577b994..1ebdccb99e 100644
--- a/test/algorithm/generate_clip_ids.test.cpp
+++ b/test/algorithm/generate_clip_ids.test.cpp
@@ -7,7 +7,14 @@ using namespace mbgl;
struct Renderable {
UnwrappedTileID id;
ClipID clip;
- bool used = true;
+ bool used;
+
+ Renderable(UnwrappedTileID id_,
+ ClipID clip_,
+ bool used_ = true)
+ : id(std::move(id_)),
+ clip(std::move(clip_)),
+ used(used_) {}
bool operator==(const Renderable& rhs) const {
return id == rhs.id && clip == rhs.clip;
diff --git a/test/style/source.test.cpp b/test/style/source.test.cpp
index eaa3c72877..004ba18c5b 100644
--- a/test/style/source.test.cpp
+++ b/test/style/source.test.cpp
@@ -60,7 +60,8 @@ public:
MapMode::Continuous,
annotationManager,
imageManager,
- glyphManager
+ glyphManager,
+ 0
};
SourceTest() {
diff --git a/test/tile/annotation_tile.test.cpp b/test/tile/annotation_tile.test.cpp
index 6d00a3236a..a1bfc23492 100644
--- a/test/tile/annotation_tile.test.cpp
+++ b/test/tile/annotation_tile.test.cpp
@@ -43,7 +43,8 @@ public:
MapMode::Continuous,
annotationManager,
imageManager,
- glyphManager
+ glyphManager,
+ 0
};
};
diff --git a/test/tile/geojson_tile.test.cpp b/test/tile/geojson_tile.test.cpp
index 2aa85c3860..52f7a20f00 100644
--- a/test/tile/geojson_tile.test.cpp
+++ b/test/tile/geojson_tile.test.cpp
@@ -38,7 +38,8 @@ public:
MapMode::Continuous,
annotationManager,
imageManager,
- glyphManager
+ glyphManager,
+ 0
};
};
diff --git a/test/tile/raster_tile.test.cpp b/test/tile/raster_tile.test.cpp
index a0666c2146..025208c331 100644
--- a/test/tile/raster_tile.test.cpp
+++ b/test/tile/raster_tile.test.cpp
@@ -34,7 +34,8 @@ public:
MapMode::Continuous,
annotationManager,
imageManager,
- glyphManager
+ glyphManager,
+ 0
};
};
diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp
index f24733dc9b..18152cd2c1 100644
--- a/test/tile/vector_tile.test.cpp
+++ b/test/tile/vector_tile.test.cpp
@@ -40,7 +40,8 @@ public:
MapMode::Continuous,
annotationManager,
imageManager,
- glyphManager
+ glyphManager,
+ 0
};
};