[tidy] Check modernize-pass-by-value
Ref: http://clang.llvm.org/extra/clang-tidy/checks/modernize-pass-by-value.html
This commit is contained in:
@@ -27,7 +27,7 @@ class Tileset;
|
||||
*/
|
||||
class OfflineTilePyramidRegionDefinition {
|
||||
public:
|
||||
OfflineTilePyramidRegionDefinition(const std::string&, const LatLngBounds&, double, double, float);
|
||||
OfflineTilePyramidRegionDefinition(std::string, LatLngBounds, double, double, float);
|
||||
|
||||
/* Private */
|
||||
std::vector<CanonicalTileID> tileCover(SourceType, uint16_t tileSize, const Tileset&) const;
|
||||
@@ -200,8 +200,8 @@ private:
|
||||
friend class OfflineDatabase;
|
||||
|
||||
OfflineRegion(int64_t id,
|
||||
const OfflineRegionDefinition&,
|
||||
const OfflineRegionMetadata&);
|
||||
OfflineRegionDefinition,
|
||||
OfflineRegionMetadata);
|
||||
|
||||
const int64_t id;
|
||||
const OfflineRegionDefinition definition;
|
||||
|
||||
@@ -33,10 +33,10 @@ public:
|
||||
Required = true,
|
||||
};
|
||||
|
||||
Resource(Kind kind_, const std::string& url_, optional<TileData> tileData_ = {}, Necessity necessity_ = Required)
|
||||
Resource(Kind kind_, std::string url_, optional<TileData> tileData_ = {}, Necessity necessity_ = Required)
|
||||
: kind(kind_),
|
||||
necessity(necessity_),
|
||||
url(url_),
|
||||
url(std::move(url_)),
|
||||
tileData(std::move(tileData_)) {
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
std::string message;
|
||||
|
||||
public:
|
||||
Error(Reason, const std::string& = "");
|
||||
Error(Reason, std::string = "");
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream&, Response::Error::Reason);
|
||||
|
||||
@@ -12,8 +12,8 @@ public:
|
||||
using Stop = std::pair<float, T>;
|
||||
using Stops = std::vector<Stop>;
|
||||
|
||||
explicit Function(const Stops& stops_, float base_)
|
||||
: base(base_), stops(stops_) {}
|
||||
explicit Function(Stops stops_, float base_)
|
||||
: base(base_), stops(std::move(stops_)) {}
|
||||
|
||||
float getBase() const { return base; }
|
||||
const std::vector<std::pair<float, T>>& getStops() const { return stops; }
|
||||
|
||||
@@ -8,8 +8,8 @@ namespace style {
|
||||
|
||||
class TransitionOptions {
|
||||
public:
|
||||
TransitionOptions(const optional<Duration>& duration_ = {}, const optional<Duration>& delay_ = {})
|
||||
: duration(duration_), delay(delay_) {}
|
||||
TransitionOptions(optional<Duration> duration_ = {}, optional<Duration> delay_ = {})
|
||||
: duration(std::move(duration_)), delay(std::move(delay_)) {}
|
||||
|
||||
optional<Duration> duration;
|
||||
optional<Duration> delay;
|
||||
|
||||
@@ -161,8 +161,8 @@ private:
|
||||
LatLng sw;
|
||||
LatLng ne;
|
||||
|
||||
LatLngBounds(const LatLng& sw_, const LatLng& ne_)
|
||||
: sw(sw_), ne(ne_) {}
|
||||
LatLngBounds(LatLng sw_, LatLng ne_)
|
||||
: sw(std::move(sw_)), ne(std::move(ne_)) {}
|
||||
|
||||
friend bool operator==(const LatLngBounds&, const LatLngBounds&);
|
||||
friend bool operator!=(const LatLngBounds&, const LatLngBounds&);
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace mbgl {
|
||||
|
||||
class AssetFileSource::Impl {
|
||||
public:
|
||||
Impl(const std::string& root_)
|
||||
: root(root_) {
|
||||
Impl(std::string root_)
|
||||
: root(std::move(root_)) {
|
||||
}
|
||||
|
||||
void request(const std::string& url, FileSource::Callback callback) {
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
namespace mbgl {
|
||||
|
||||
OfflineTilePyramidRegionDefinition::OfflineTilePyramidRegionDefinition(
|
||||
const std::string& styleURL_, const LatLngBounds& bounds_, double minZoom_, double maxZoom_, float pixelRatio_)
|
||||
: styleURL(styleURL_),
|
||||
bounds(bounds_),
|
||||
std::string styleURL_, LatLngBounds bounds_, double minZoom_, double maxZoom_, float pixelRatio_)
|
||||
: styleURL(std::move(styleURL_)),
|
||||
bounds(std::move(bounds_)),
|
||||
minZoom(minZoom_),
|
||||
maxZoom(maxZoom_),
|
||||
pixelRatio(pixelRatio_) {
|
||||
@@ -97,11 +97,11 @@ std::string encodeOfflineRegionDefinition(const OfflineRegionDefinition& region)
|
||||
}
|
||||
|
||||
OfflineRegion::OfflineRegion(int64_t id_,
|
||||
const OfflineRegionDefinition& definition_,
|
||||
const OfflineRegionMetadata& metadata_)
|
||||
OfflineRegionDefinition definition_,
|
||||
OfflineRegionMetadata metadata_)
|
||||
: id(id_),
|
||||
definition(definition_),
|
||||
metadata(metadata_) {
|
||||
definition(std::move(definition_)),
|
||||
metadata(std::move(metadata_)) {
|
||||
}
|
||||
|
||||
OfflineRegion::OfflineRegion(OfflineRegion&&) = default;
|
||||
|
||||
@@ -18,8 +18,8 @@ OfflineDatabase::Statement::~Statement() {
|
||||
stmt.clearBindings();
|
||||
}
|
||||
|
||||
OfflineDatabase::OfflineDatabase(const std::string& path_, uint64_t maximumCacheSize_)
|
||||
: path(path_),
|
||||
OfflineDatabase::OfflineDatabase(std::string path_, uint64_t maximumCacheSize_)
|
||||
: path(std::move(path_)),
|
||||
maximumCacheSize(maximumCacheSize_) {
|
||||
ensureSchema();
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ class OfflineDatabase : private util::noncopyable {
|
||||
public:
|
||||
// Limits affect ambient caching (put) only; resources required by offline
|
||||
// regions are exempt.
|
||||
OfflineDatabase(const std::string& path,
|
||||
uint64_t maximumCacheSize = util::DEFAULT_MAX_CACHE_SIZE);
|
||||
OfflineDatabase(std::string path, uint64_t maximumCacheSize = util::DEFAULT_MAX_CACHE_SIZE);
|
||||
~OfflineDatabase();
|
||||
|
||||
optional<Response> get(const Resource&);
|
||||
|
||||
@@ -26,7 +26,7 @@ class OnlineFileRequest : public AsyncRequest {
|
||||
public:
|
||||
using Callback = std::function<void (Response)>;
|
||||
|
||||
OnlineFileRequest(const Resource&, Callback, OnlineFileSource::Impl&);
|
||||
OnlineFileRequest(Resource, Callback, OnlineFileSource::Impl&);
|
||||
~OnlineFileRequest();
|
||||
|
||||
void networkIsReachableAgain();
|
||||
@@ -182,9 +182,9 @@ std::unique_ptr<AsyncRequest> OnlineFileSource::request(const Resource& resource
|
||||
return std::make_unique<OnlineFileRequest>(res, callback, *impl);
|
||||
}
|
||||
|
||||
OnlineFileRequest::OnlineFileRequest(const Resource& resource_, Callback callback_, OnlineFileSource::Impl& impl_)
|
||||
OnlineFileRequest::OnlineFileRequest(Resource resource_, Callback callback_, OnlineFileSource::Impl& impl_)
|
||||
: impl(impl_),
|
||||
resource(resource_),
|
||||
resource(std::move(resource_)),
|
||||
callback(std::move(callback_)) {
|
||||
impl.add(this);
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ optional<Value> AnnotationTileFeature::getValue(const std::string& key) const {
|
||||
return optional<Value>();
|
||||
}
|
||||
|
||||
AnnotationTileLayer::AnnotationTileLayer(const std::string &name_)
|
||||
: name(name_) {}
|
||||
AnnotationTileLayer::AnnotationTileLayer(std::string name_)
|
||||
: name(std::move(name_)) {}
|
||||
|
||||
util::ptr<GeometryTileLayer> AnnotationTileData::getLayer(const std::string& name) const {
|
||||
auto it = layers.find(name);
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
class AnnotationTileLayer : public GeometryTileLayer {
|
||||
public:
|
||||
AnnotationTileLayer(const std::string&);
|
||||
AnnotationTileLayer(std::string);
|
||||
|
||||
std::size_t featureCount() const override { return features.size(); }
|
||||
util::ptr<const GeometryTileFeature> getFeature(std::size_t i) const override { return features[i]; }
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace mbgl {
|
||||
|
||||
using namespace style;
|
||||
|
||||
FillAnnotationImpl::FillAnnotationImpl(const AnnotationID id_, const FillAnnotation& annotation_, const uint8_t maxZoom_)
|
||||
FillAnnotationImpl::FillAnnotationImpl(AnnotationID id_, FillAnnotation annotation_, uint8_t maxZoom_)
|
||||
: ShapeAnnotationImpl(id_, maxZoom_),
|
||||
annotation(annotation_) {
|
||||
annotation(std::move(annotation_)) {
|
||||
}
|
||||
|
||||
void FillAnnotationImpl::updateStyle(Style& style) const {
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace mbgl {
|
||||
|
||||
class FillAnnotationImpl : public ShapeAnnotationImpl {
|
||||
public:
|
||||
FillAnnotationImpl(const AnnotationID, const FillAnnotation&, const uint8_t maxZoom);
|
||||
FillAnnotationImpl(AnnotationID, FillAnnotation, uint8_t maxZoom);
|
||||
|
||||
void updateStyle(style::Style&) const final;
|
||||
const ShapeAnnotationGeometry& geometry() const final;
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace mbgl {
|
||||
|
||||
using namespace style;
|
||||
|
||||
LineAnnotationImpl::LineAnnotationImpl(const AnnotationID id_, const LineAnnotation& annotation_, const uint8_t maxZoom_)
|
||||
LineAnnotationImpl::LineAnnotationImpl(AnnotationID id_, LineAnnotation annotation_, uint8_t maxZoom_)
|
||||
: ShapeAnnotationImpl(id_, maxZoom_),
|
||||
annotation(annotation_) {
|
||||
annotation(std::move(annotation_)) {
|
||||
}
|
||||
|
||||
void LineAnnotationImpl::updateStyle(Style& style) const {
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace mbgl {
|
||||
|
||||
class LineAnnotationImpl : public ShapeAnnotationImpl {
|
||||
public:
|
||||
LineAnnotationImpl(const AnnotationID, const LineAnnotation&, const uint8_t maxZoom);
|
||||
LineAnnotationImpl(AnnotationID, LineAnnotation, uint8_t maxZoom);
|
||||
|
||||
void updateStyle(style::Style&) const final;
|
||||
const ShapeAnnotationGeometry& geometry() const final;
|
||||
|
||||
@@ -9,9 +9,9 @@ namespace mbgl {
|
||||
|
||||
using namespace style;
|
||||
|
||||
StyleSourcedAnnotationImpl::StyleSourcedAnnotationImpl(const AnnotationID id_, const StyleSourcedAnnotation& annotation_, const uint8_t maxZoom_)
|
||||
StyleSourcedAnnotationImpl::StyleSourcedAnnotationImpl(AnnotationID id_, StyleSourcedAnnotation annotation_, uint8_t maxZoom_)
|
||||
: ShapeAnnotationImpl(id_, maxZoom_),
|
||||
annotation(annotation_) {
|
||||
annotation(std::move(annotation_)) {
|
||||
}
|
||||
|
||||
void StyleSourcedAnnotationImpl::updateStyle(Style& style) const {
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace mbgl {
|
||||
|
||||
class StyleSourcedAnnotationImpl : public ShapeAnnotationImpl {
|
||||
public:
|
||||
StyleSourcedAnnotationImpl(const AnnotationID, const StyleSourcedAnnotation&, const uint8_t maxZoom);
|
||||
StyleSourcedAnnotationImpl(AnnotationID, StyleSourcedAnnotation, uint8_t maxZoom);
|
||||
|
||||
void updateStyle(style::Style&) const final;
|
||||
const ShapeAnnotationGeometry& geometry() const final;
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
SymbolAnnotationImpl::SymbolAnnotationImpl(const AnnotationID id_, const SymbolAnnotation& annotation_)
|
||||
SymbolAnnotationImpl::SymbolAnnotationImpl(AnnotationID id_, SymbolAnnotation annotation_)
|
||||
: id(id_),
|
||||
annotation(annotation_) {
|
||||
annotation(std::move(annotation_)) {
|
||||
}
|
||||
|
||||
void SymbolAnnotationImpl::updateLayer(const CanonicalTileID& tileID, AnnotationTileLayer& layer) const {
|
||||
|
||||
@@ -37,7 +37,7 @@ class CanonicalTileID;
|
||||
|
||||
class SymbolAnnotationImpl {
|
||||
public:
|
||||
SymbolAnnotationImpl(const AnnotationID, const SymbolAnnotation&);
|
||||
SymbolAnnotationImpl(AnnotationID, SymbolAnnotation);
|
||||
|
||||
void updateLayer(const CanonicalTileID&, AnnotationTileLayer&) const;
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ public:
|
||||
|
||||
private:
|
||||
struct GlyphValue {
|
||||
GlyphValue(const Rect<uint16_t>& rect_, uintptr_t id)
|
||||
: rect(rect_), ids({ id }) {}
|
||||
GlyphValue(Rect<uint16_t> rect_, uintptr_t id)
|
||||
: rect(std::move(rect_)), ids({ id }) {}
|
||||
Rect<uint16_t> rect;
|
||||
std::set<uintptr_t> ids;
|
||||
};
|
||||
|
||||
@@ -11,9 +11,7 @@ class Tile;
|
||||
|
||||
class RenderTile {
|
||||
public:
|
||||
RenderTile(const UnwrappedTileID& id_, Tile& tile_) : id(id_), tile(tile_) {
|
||||
}
|
||||
|
||||
RenderTile(UnwrappedTileID id_, Tile& tile_) : id(std::move(id_)), tile(tile_) {}
|
||||
RenderTile(const RenderTile&) = delete;
|
||||
RenderTile(RenderTile&&) = default;
|
||||
RenderTile& operator=(const RenderTile&) = delete;
|
||||
|
||||
@@ -60,14 +60,14 @@ SymbolInstance::SymbolInstance(Anchor& anchor, const GeometryCoordinates& line,
|
||||
{}
|
||||
|
||||
|
||||
SymbolBucket::SymbolBucket(uint32_t overscaling_, float zoom_, const MapMode mode_, const std::string& bucketName_, const std::string& sourceLayerName_)
|
||||
SymbolBucket::SymbolBucket(uint32_t overscaling_, float zoom_, const MapMode mode_, std::string bucketName_, std::string sourceLayerName_)
|
||||
: overscaling(overscaling_),
|
||||
zoom(zoom_),
|
||||
tileSize(util::tileSize * overscaling_),
|
||||
tilePixelRatio(float(util::EXTENT) / tileSize),
|
||||
mode(mode_),
|
||||
bucketName(bucketName_),
|
||||
sourceLayerName(sourceLayerName_) {}
|
||||
bucketName(std::move(bucketName_)),
|
||||
sourceLayerName(std::move(sourceLayerName_)) {}
|
||||
|
||||
SymbolBucket::~SymbolBucket() {
|
||||
// Do not remove. header file only contains forward definitions to unique pointers.
|
||||
|
||||
@@ -66,7 +66,7 @@ class SymbolBucket : public Bucket {
|
||||
typedef ElementGroup<1> CollisionBoxElementGroup;
|
||||
|
||||
public:
|
||||
SymbolBucket(uint32_t overscaling, float zoom, const MapMode, const std::string& bucketName_, const std::string& sourceLayerName_);
|
||||
SymbolBucket(uint32_t overscaling, float zoom, const MapMode, std::string bucketName_, std::string sourceLayerName_);
|
||||
~SymbolBucket() override;
|
||||
|
||||
void upload(gl::ObjectStore&) override;
|
||||
|
||||
@@ -247,9 +247,8 @@ void SpriteAtlas::bind(bool linear, gl::ObjectStore& objectStore) {
|
||||
|
||||
SpriteAtlas::~SpriteAtlas() = default;
|
||||
|
||||
SpriteAtlas::Holder::Holder(const std::shared_ptr<const SpriteImage>& spriteImage_,
|
||||
const Rect<dimension>& pos_)
|
||||
: spriteImage(spriteImage_), pos(pos_) {
|
||||
SpriteAtlas::Holder::Holder(std::shared_ptr<const SpriteImage> spriteImage_, Rect<dimension> pos_)
|
||||
: spriteImage(std::move(spriteImage_)), pos(std::move(pos_)) {
|
||||
}
|
||||
|
||||
SpriteAtlas::Holder::Holder(Holder&& h) : spriteImage(std::move(h.spriteImage)), pos(h.pos) {
|
||||
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
const float pixelRatio;
|
||||
|
||||
struct Holder : private util::noncopyable {
|
||||
inline Holder(const std::shared_ptr<const SpriteImage>&, const Rect<dimension>&);
|
||||
inline Holder(std::shared_ptr<const SpriteImage>, Rect<dimension>);
|
||||
inline Holder(Holder&&);
|
||||
std::shared_ptr<const SpriteImage> spriteImage;
|
||||
const Rect<dimension> pos;
|
||||
|
||||
@@ -21,8 +21,8 @@ Response& Response::operator=(const Response& res) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
Response::Error::Error(Reason reason_, const std::string& message_)
|
||||
: reason(reason_), message(message_) {
|
||||
Response::Error::Error(Reason reason_, std::string message_)
|
||||
: reason(reason_), message(std::move(message_)) {
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, Response::Error::Reason r) {
|
||||
|
||||
@@ -12,13 +12,13 @@ public:
|
||||
: z(z_) {}
|
||||
|
||||
CalculationParameters(float z_,
|
||||
const TimePoint& now_,
|
||||
const ZoomHistory& zoomHistory_,
|
||||
const Duration& defaultFadeDuration_)
|
||||
TimePoint now_,
|
||||
ZoomHistory zoomHistory_,
|
||||
Duration defaultFadeDuration_)
|
||||
: z(z_),
|
||||
now(now_),
|
||||
zoomHistory(zoomHistory_),
|
||||
defaultFadeDuration(defaultFadeDuration_) {}
|
||||
now(std::move(now_)),
|
||||
zoomHistory(std::move(zoomHistory_)),
|
||||
defaultFadeDuration(std::move(defaultFadeDuration_)) {}
|
||||
|
||||
float z;
|
||||
TimePoint now;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include <mbgl/style/layers/background_layer_properties.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace mbgl {
|
||||
namespace style {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include <mbgl/style/layers/circle_layer_properties.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace mbgl {
|
||||
namespace style {
|
||||
|
||||
@@ -118,8 +118,8 @@ private:
|
||||
TimePoint end_,
|
||||
PropertyValue<T> value_)
|
||||
: prior(std::move(prior_)),
|
||||
begin(begin_),
|
||||
end(end_),
|
||||
begin(std::move(begin_)),
|
||||
end(std::move(end_)),
|
||||
value(std::move(value_)) {
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ class PropertyEvaluator {
|
||||
public:
|
||||
using ResultType = T;
|
||||
|
||||
PropertyEvaluator(const CalculationParameters& parameters_, const T& defaultValue_)
|
||||
PropertyEvaluator(const CalculationParameters& parameters_, T defaultValue_)
|
||||
: parameters(parameters_),
|
||||
defaultValue(defaultValue_) {}
|
||||
defaultValue(std::move(defaultValue_)) {}
|
||||
|
||||
T operator()(const Undefined&) const { return defaultValue; }
|
||||
T operator()(const T& constant) const { return constant; }
|
||||
@@ -40,9 +40,9 @@ class CrossFadedPropertyEvaluator {
|
||||
public:
|
||||
using ResultType = Faded<T>;
|
||||
|
||||
CrossFadedPropertyEvaluator(const CalculationParameters& parameters_, const T& defaultValue_)
|
||||
CrossFadedPropertyEvaluator(const CalculationParameters& parameters_, T defaultValue_)
|
||||
: parameters(parameters_),
|
||||
defaultValue(defaultValue_) {}
|
||||
defaultValue(std::move(defaultValue_)) {}
|
||||
|
||||
Faded<T> operator()(const Undefined&) const;
|
||||
Faded<T> operator()(const T& constant) const;
|
||||
|
||||
@@ -43,14 +43,14 @@ namespace style {
|
||||
static SourceObserver nullObserver;
|
||||
|
||||
Source::Source(SourceType type_,
|
||||
const std::string& id_,
|
||||
const std::string& url_,
|
||||
std::string id_,
|
||||
std::string url_,
|
||||
uint16_t tileSize_,
|
||||
std::unique_ptr<Tileset>&& tileset_,
|
||||
std::unique_ptr<mapbox::geojsonvt::GeoJSONVT>&& geojsonvt_)
|
||||
: type(type_),
|
||||
id(id_),
|
||||
url(url_),
|
||||
id(std::move(id_)),
|
||||
url(std::move(url_)),
|
||||
tileSize(tileSize_),
|
||||
tileset(std::move(tileset_)),
|
||||
geojsonvt(std::move(geojsonvt_)),
|
||||
|
||||
@@ -41,8 +41,8 @@ class SourceObserver;
|
||||
class Source : public TileObserver, private util::noncopyable {
|
||||
public:
|
||||
Source(SourceType,
|
||||
const std::string& id,
|
||||
const std::string& url,
|
||||
std::string id,
|
||||
std::string url,
|
||||
uint16_t tileSize,
|
||||
std::unique_ptr<Tileset>&&,
|
||||
std::unique_ptr<mapbox::geojsonvt::GeoJSONVT>&&);
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
Style& style_)
|
||||
: pixelRatio(pixelRatio_),
|
||||
debugOptions(debugOptions_),
|
||||
animationTime(animationTime_),
|
||||
animationTime(std::move(animationTime_)),
|
||||
transformState(transformState_),
|
||||
worker(worker_),
|
||||
fileSource(fileSource_),
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace mbgl {
|
||||
|
||||
CollisionFeature::CollisionFeature(const GeometryCoordinates &line, const Anchor &anchor,
|
||||
const float top, const float bottom, const float left, const float right,
|
||||
const float boxScale, const float padding, const bool alongLine, const IndexedSubfeature& indexedFeature_,
|
||||
const float boxScale, const float padding, const bool alongLine, IndexedSubfeature indexedFeature_,
|
||||
const bool straight)
|
||||
: indexedFeature(indexedFeature_) {
|
||||
: indexedFeature(std::move(indexedFeature_)) {
|
||||
|
||||
if (top == 0 && bottom == 0 && left == 0 && right == 0) return;
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
namespace mbgl {
|
||||
class CollisionBox {
|
||||
public:
|
||||
explicit CollisionBox(const Point<float> &_anchor, float _x1, float _y1, float _x2, float _y2, float _maxScale) :
|
||||
anchor(_anchor), x1(_x1), y1(_y1), x2(_x2), y2(_y2), maxScale(_maxScale) {}
|
||||
explicit CollisionBox(Point<float> _anchor, float _x1, float _y1, float _x2, float _y2, float _maxScale) :
|
||||
anchor(std::move(_anchor)), x1(_x1), y1(_y1), x2(_x2), y2(_y2), maxScale(_maxScale) {}
|
||||
|
||||
// the box is centered around the anchor point
|
||||
Point<float> anchor;
|
||||
@@ -51,7 +51,7 @@ namespace mbgl {
|
||||
explicit CollisionFeature(const GeometryCoordinates &line, const Anchor &anchor,
|
||||
const float top, const float bottom, const float left, const float right,
|
||||
const float boxScale, const float padding, const bool alongLine,
|
||||
const IndexedSubfeature&, const bool straight);
|
||||
IndexedSubfeature, const bool straight);
|
||||
|
||||
|
||||
std::vector<CollisionBox> boxes;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace mbgl {
|
||||
|
||||
auto infinity = std::numeric_limits<float>::infinity();
|
||||
|
||||
CollisionTile::CollisionTile(PlacementConfig config_) : config(config_),
|
||||
CollisionTile::CollisionTile(PlacementConfig config_) : config(std::move(config_)),
|
||||
edges({{
|
||||
// left
|
||||
CollisionBox(Point<float>(0, 0), 0, -infinity, 0, infinity, infinity),
|
||||
|
||||
@@ -29,9 +29,8 @@ struct GlyphMetrics {
|
||||
|
||||
struct Glyph {
|
||||
inline explicit Glyph() : rect(0, 0, 0, 0), metrics() {}
|
||||
inline explicit Glyph(const Rect<uint16_t> &rect_,
|
||||
const GlyphMetrics &metrics_)
|
||||
: rect(rect_), metrics(metrics_) {}
|
||||
inline explicit Glyph(Rect<uint16_t> rect_, GlyphMetrics metrics_)
|
||||
: rect(std::move(rect_)), metrics(std::move(metrics_)) {}
|
||||
|
||||
operator bool() const {
|
||||
return metrics || rect.hasArea();
|
||||
|
||||
@@ -62,10 +62,10 @@ SymbolQuads getIconQuads(Anchor& anchor, const PositionedIcon& shapedIcon,
|
||||
}
|
||||
|
||||
struct GlyphInstance {
|
||||
explicit GlyphInstance(const Point<float> &anchorPoint_) : anchorPoint(anchorPoint_) {}
|
||||
explicit GlyphInstance(const Point<float> &anchorPoint_, float offset_, float minScale_, float maxScale_,
|
||||
explicit GlyphInstance(Point<float> anchorPoint_) : anchorPoint(std::move(anchorPoint_)) {}
|
||||
explicit GlyphInstance(Point<float> anchorPoint_, float offset_, float minScale_, float maxScale_,
|
||||
float angle_)
|
||||
: anchorPoint(anchorPoint_), offset(offset_), minScale(minScale_), maxScale(maxScale_), angle(angle_) {}
|
||||
: anchorPoint(std::move(anchorPoint_)), offset(offset_), minScale(minScale_), maxScale(maxScale_), angle(angle_) {}
|
||||
|
||||
const Point<float> anchorPoint;
|
||||
const float offset = 0.0f;
|
||||
|
||||
@@ -15,18 +15,17 @@ class SymbolLayoutProperties;
|
||||
} // namespace style
|
||||
|
||||
struct SymbolQuad {
|
||||
explicit SymbolQuad(const Point<float> &tl_, const Point<float> &tr_,
|
||||
const Point<float> &bl_, const Point<float> &br_,
|
||||
const Rect<uint16_t> &tex_, float anchorAngle_, float glyphAngle_, const Point<float> &anchorPoint_,
|
||||
explicit SymbolQuad(Point<float> tl_, Point<float> tr_, Point<float> bl_, Point<float> br_,
|
||||
Rect<uint16_t> tex_, float anchorAngle_, float glyphAngle_, Point<float> anchorPoint_,
|
||||
float minScale_, float maxScale_)
|
||||
: tl(tl_),
|
||||
tr(tr_),
|
||||
bl(bl_),
|
||||
br(br_),
|
||||
tex(tex_),
|
||||
: tl(std::move(tl_)),
|
||||
tr(std::move(tr_)),
|
||||
bl(std::move(bl_)),
|
||||
br(std::move(br_)),
|
||||
tex(std::move(tex_)),
|
||||
anchorAngle(anchorAngle_),
|
||||
glyphAngle(glyphAngle_),
|
||||
anchorPoint(anchorPoint_),
|
||||
anchorPoint(std::move(anchorPoint_)),
|
||||
minScale(minScale_),
|
||||
maxScale(maxScale_) {}
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@ namespace mbgl {
|
||||
|
||||
static TileObserver nullObserver;
|
||||
|
||||
Tile::Tile(const OverscaledTileID& id_)
|
||||
: id(id_), observer(&nullObserver) {
|
||||
Tile::Tile(OverscaledTileID id_) : id(std::move(id_)), observer(&nullObserver) {
|
||||
}
|
||||
|
||||
Tile::~Tile() = default;
|
||||
|
||||
@@ -27,7 +27,7 @@ class Layer;
|
||||
|
||||
class Tile : private util::noncopyable {
|
||||
public:
|
||||
Tile(const OverscaledTileID&);
|
||||
Tile(OverscaledTileID);
|
||||
virtual ~Tile();
|
||||
|
||||
void setObserver(TileObserver* observer);
|
||||
|
||||
@@ -45,8 +45,7 @@ std::string toString(const CanonicalTileID&);
|
||||
// z/x/y describe the
|
||||
class OverscaledTileID {
|
||||
public:
|
||||
OverscaledTileID(uint8_t overscaledZ, const CanonicalTileID&);
|
||||
OverscaledTileID(uint8_t overscaledZ, CanonicalTileID&&);
|
||||
OverscaledTileID(uint8_t overscaledZ, CanonicalTileID);
|
||||
OverscaledTileID(uint8_t overscaledZ, uint8_t z, uint32_t x, uint32_t y);
|
||||
OverscaledTileID(uint8_t z, uint32_t x, uint32_t y);
|
||||
explicit OverscaledTileID(const CanonicalTileID&);
|
||||
@@ -75,8 +74,7 @@ std::string toString(const OverscaledTileID&);
|
||||
class UnwrappedTileID {
|
||||
public:
|
||||
UnwrappedTileID(uint8_t z, int64_t x, int64_t y);
|
||||
UnwrappedTileID(int16_t wrap, const CanonicalTileID&);
|
||||
UnwrappedTileID(int16_t wrap, CanonicalTileID&&);
|
||||
UnwrappedTileID(int16_t wrap, CanonicalTileID);
|
||||
bool operator==(const UnwrappedTileID&) const;
|
||||
bool operator!=(const UnwrappedTileID&) const;
|
||||
bool operator<(const UnwrappedTileID&) const;
|
||||
@@ -143,13 +141,8 @@ inline std::array<CanonicalTileID, 4> CanonicalTileID::children() const {
|
||||
} };
|
||||
}
|
||||
|
||||
inline OverscaledTileID::OverscaledTileID(uint8_t overscaledZ_, const CanonicalTileID& canonical_)
|
||||
: overscaledZ(overscaledZ_), canonical(canonical_) {
|
||||
assert(overscaledZ >= canonical.z);
|
||||
}
|
||||
|
||||
inline OverscaledTileID::OverscaledTileID(uint8_t overscaledZ_, CanonicalTileID&& canonical_)
|
||||
: overscaledZ(overscaledZ_), canonical(std::forward<CanonicalTileID>(canonical_)) {
|
||||
inline OverscaledTileID::OverscaledTileID(uint8_t overscaledZ_, CanonicalTileID canonical_)
|
||||
: overscaledZ(overscaledZ_), canonical(std::move(canonical_)) {
|
||||
assert(overscaledZ >= canonical.z);
|
||||
}
|
||||
|
||||
@@ -216,12 +209,8 @@ inline UnwrappedTileID::UnwrappedTileID(uint8_t z_, int64_t x_, int64_t y_)
|
||||
y_ < 0 ? 0 : std::min(static_cast<uint32_t>(y_), static_cast<uint32_t>(1ull << z_) - 1)) {
|
||||
}
|
||||
|
||||
inline UnwrappedTileID::UnwrappedTileID(int16_t wrap_, const CanonicalTileID& canonical_)
|
||||
: wrap(wrap_), canonical(canonical_) {
|
||||
}
|
||||
|
||||
inline UnwrappedTileID::UnwrappedTileID(int16_t wrap_, CanonicalTileID&& canonical_)
|
||||
: wrap(wrap_), canonical(std::forward<CanonicalTileID>(canonical_)) {
|
||||
inline UnwrappedTileID::UnwrappedTileID(int16_t wrap_, CanonicalTileID canonical_)
|
||||
: wrap(wrap_), canonical(std::move(canonical_)) {
|
||||
}
|
||||
|
||||
inline bool UnwrappedTileID::operator==(const UnwrappedTileID& rhs) const {
|
||||
|
||||
@@ -19,14 +19,14 @@ namespace mbgl {
|
||||
|
||||
using namespace mbgl::style;
|
||||
|
||||
TileWorker::TileWorker(const OverscaledTileID& id_,
|
||||
TileWorker::TileWorker(OverscaledTileID id_,
|
||||
std::string sourceID_,
|
||||
SpriteStore& spriteStore_,
|
||||
GlyphAtlas& glyphAtlas_,
|
||||
GlyphStore& glyphStore_,
|
||||
const util::Atomic<bool>& obsolete_,
|
||||
const MapMode mode_)
|
||||
: id(id_),
|
||||
: id(std::move(id_)),
|
||||
sourceID(std::move(sourceID_)),
|
||||
spriteStore(spriteStore_),
|
||||
glyphAtlas(glyphAtlas_),
|
||||
|
||||
@@ -45,7 +45,7 @@ using TileParseResult = variant<
|
||||
|
||||
class TileWorker : public util::noncopyable {
|
||||
public:
|
||||
TileWorker(const OverscaledTileID&,
|
||||
TileWorker(OverscaledTileID,
|
||||
std::string sourceID,
|
||||
SpriteStore&,
|
||||
GlyphAtlas&,
|
||||
|
||||
@@ -15,11 +15,11 @@ stopwatch::stopwatch(Event event_)
|
||||
stopwatch::stopwatch(EventSeverity severity_, Event event_)
|
||||
: severity(severity_), event(event_), start(Clock::now()) {}
|
||||
|
||||
stopwatch::stopwatch(const std::string &name_, Event event_)
|
||||
: name(name_), event(event_), start(Clock::now()) {}
|
||||
stopwatch::stopwatch(std::string name_, Event event_)
|
||||
: name(std::move(name_)), event(event_), start(Clock::now()) {}
|
||||
|
||||
stopwatch::stopwatch(const std::string &name_, EventSeverity severity_, Event event_)
|
||||
: name(name_), severity(severity_), event(event_), start(Clock::now()) {}
|
||||
stopwatch::stopwatch(std::string name_, EventSeverity severity_, Event event_)
|
||||
: name(std::move(name_)), severity(severity_), event(event_), start(Clock::now()) {}
|
||||
|
||||
void stopwatch::report(const std::string &name_) {
|
||||
Duration duration = Clock::now() - start;
|
||||
|
||||
@@ -13,8 +13,8 @@ class stopwatch {
|
||||
public:
|
||||
stopwatch(Event event = Event::General);
|
||||
stopwatch(EventSeverity severity, Event event = Event::General);
|
||||
stopwatch(const std::string &name, Event event = Event::General);
|
||||
stopwatch(const std::string &name, EventSeverity severity, Event event = Event::General);
|
||||
stopwatch(std::string name, Event event = Event::General);
|
||||
stopwatch(std::string name, EventSeverity severity, Event event = Event::General);
|
||||
void report(const std::string &name);
|
||||
~stopwatch();
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include <mbgl/util/thread_context.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
ThreadContext::ThreadContext(const std::string& name_, ThreadPriority priority_)
|
||||
: name(name_),
|
||||
ThreadContext::ThreadContext(std::string name_, ThreadPriority priority_)
|
||||
: name(std::move(name_)),
|
||||
priority(priority_) {
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ enum class ThreadPriority : bool {
|
||||
|
||||
struct ThreadContext {
|
||||
public:
|
||||
ThreadContext(const std::string& name, ThreadPriority priority = ThreadPriority::Regular);
|
||||
ThreadContext(std::string name, ThreadPriority priority = ThreadPriority::Regular);
|
||||
|
||||
std::string name;
|
||||
ThreadPriority priority;
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace mbgl {
|
||||
FixtureLog::Message::Message(EventSeverity severity_,
|
||||
Event event_,
|
||||
int64_t code_,
|
||||
const std::string& msg_)
|
||||
: severity(severity_), event(event_), code(code_), msg(msg_) {
|
||||
std::string msg_)
|
||||
: severity(severity_), event(event_), code(code_), msg(std::move(msg_)) {
|
||||
}
|
||||
|
||||
bool FixtureLog::Message::operator==(const Message& rhs) const {
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace mbgl {
|
||||
class FixtureLog {
|
||||
public:
|
||||
struct Message {
|
||||
Message(EventSeverity severity_, Event event_, int64_t code_, const std::string &msg_);
|
||||
Message(EventSeverity severity_, Event event_, int64_t code_, std::string msg_);
|
||||
Message();
|
||||
|
||||
bool operator==(const Message& rhs) const;
|
||||
|
||||
@@ -16,8 +16,8 @@ typedef std::multimap<std::string, mbgl::Value> Properties;
|
||||
|
||||
class StubFeature : public GeometryTileFeature {
|
||||
public:
|
||||
inline StubFeature(const Properties& properties_, FeatureType type_)
|
||||
: properties(properties_)
|
||||
inline StubFeature(Properties properties_, FeatureType type_)
|
||||
: properties(std::move(properties_))
|
||||
, type(type_)
|
||||
{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user