summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-01-26 18:52:44 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-01-27 11:44:16 +0100
commit62ea1f21858c69f6921c775ba7a3de201f0514d8 (patch)
tree7a4da88706e8a5513e1e13e993b2acc212cae3b1 /src
parenta662508ddde4043ece36d8ea9b424368891d892c (diff)
downloadqtlocation-mapboxgl-62ea1f21858c69f6921c775ba7a3de201f0514d8.tar.gz
[core] remove trailing whitespace, add trailing newlines, add space after //
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/annotation/annotation_manager.cpp2
-rw-r--r--src/mbgl/gl/debugging.cpp2
-rw-r--r--src/mbgl/gl/vertex_array.hpp2
-rw-r--r--src/mbgl/layout/symbol_layout.hpp2
-rw-r--r--src/mbgl/programs/program.hpp2
-rw-r--r--src/mbgl/renderer/circle_bucket.cpp2
-rw-r--r--src/mbgl/renderer/painter.cpp2
-rw-r--r--src/mbgl/storage/local_file_source.hpp2
-rw-r--r--src/mbgl/style/source_observer.hpp2
-rw-r--r--src/mbgl/style/sources/geojson_source_impl.cpp4
-rw-r--r--src/mbgl/style/style.cpp6
-rw-r--r--src/mbgl/style/tile_source_impl.hpp2
-rw-r--r--src/mbgl/text/glyph_set.cpp24
-rw-r--r--src/mbgl/tile/geojson_tile.cpp2
-rw-r--r--src/mbgl/tile/geojson_tile.hpp2
-rw-r--r--src/mbgl/tile/tile_id.hpp4
-rw-r--r--src/mbgl/util/chrono.cpp2
-rw-r--r--src/mbgl/util/http_header.cpp4
-rw-r--r--src/mbgl/util/http_header.hpp2
-rw-r--r--src/mbgl/util/http_timeout.cpp4
20 files changed, 37 insertions, 37 deletions
diff --git a/src/mbgl/annotation/annotation_manager.cpp b/src/mbgl/annotation/annotation_manager.cpp
index f8c1c3adf7..fbc0469c21 100644
--- a/src/mbgl/annotation/annotation_manager.cpp
+++ b/src/mbgl/annotation/annotation_manager.cpp
@@ -90,7 +90,7 @@ void AnnotationManager::add(const AnnotationID& id, const StyleSourcedAnnotation
Update AnnotationManager::update(const AnnotationID& id, const SymbolAnnotation& annotation, const uint8_t maxZoom) {
Update result = Update::Nothing;
-
+
auto it = symbolAnnotations.find(id);
if (it == symbolAnnotations.end()) {
assert(false); // Attempt to update a non-existent symbol annotation
diff --git a/src/mbgl/gl/debugging.cpp b/src/mbgl/gl/debugging.cpp
index f99308de7e..5ce3e606ee 100644
--- a/src/mbgl/gl/debugging.cpp
+++ b/src/mbgl/gl/debugging.cpp
@@ -132,7 +132,7 @@ void enable() {
}
// This will enable all messages including performance hints
- //MBGL_CHECK_ERROR(DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE));
+ // MBGL_CHECK_ERROR(DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE));
// This will only enable high and medium severity messages
MBGL_CHECK_ERROR(DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, nullptr, GL_TRUE));
diff --git a/src/mbgl/gl/vertex_array.hpp b/src/mbgl/gl/vertex_array.hpp
index 6215e56f21..6b6e11324f 100644
--- a/src/mbgl/gl/vertex_array.hpp
+++ b/src/mbgl/gl/vertex_array.hpp
@@ -11,4 +11,4 @@ extern ExtensionFunction<void(GLsizei n, const GLuint* arrays)> DeleteVertexArra
extern ExtensionFunction<void(GLsizei n, GLuint* arrays)> GenVertexArrays;
} // namespace gl
-} // namespace mbgl \ No newline at end of file
+} // namespace mbgl
diff --git a/src/mbgl/layout/symbol_layout.hpp b/src/mbgl/layout/symbol_layout.hpp
index c89b791ccc..3430b937e9 100644
--- a/src/mbgl/layout/symbol_layout.hpp
+++ b/src/mbgl/layout/symbol_layout.hpp
@@ -92,7 +92,7 @@ private:
GlyphRangeSet ranges;
std::vector<SymbolInstance> symbolInstances;
std::vector<SymbolFeature> features;
-
+
BiDi bidi; // Consider moving this up to geometry tile worker to reduce reinstantiation costs; use of BiDi/ubiditransform object must be constrained to one thread
};
diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp
index e5aae24997..85902d3351 100644
--- a/src/mbgl/programs/program.hpp
+++ b/src/mbgl/programs/program.hpp
@@ -16,7 +16,7 @@ public:
Program(gl::Context& context, const ProgramParameters& programParameters)
: ParentType(context, vertexSource(programParameters), fragmentSource(programParameters))
{}
-
+
static std::string pixelRatioDefine(const ProgramParameters& parameters) {
std::ostringstream pixelRatioSS;
pixelRatioSS.imbue(std::locale("C"));
diff --git a/src/mbgl/renderer/circle_bucket.cpp b/src/mbgl/renderer/circle_bucket.cpp
index ba2285c4eb..d3ce8405d0 100644
--- a/src/mbgl/renderer/circle_bucket.cpp
+++ b/src/mbgl/renderer/circle_bucket.cpp
@@ -20,7 +20,7 @@ void CircleBucket::upload(gl::Context& context) {
}
void CircleBucket::render(Painter& painter,
- PaintParameters& parameters,
+ PaintParameters& parameters,
const Layer& layer,
const RenderTile& tile) {
painter.renderCircle(parameters, *this, *layer.as<CircleLayer>(), tile);
diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp
index 505007304d..2e16777cdb 100644
--- a/src/mbgl/renderer/painter.cpp
+++ b/src/mbgl/renderer/painter.cpp
@@ -94,7 +94,7 @@ Painter::Painter(gl::Context& context_, const TransformState& state_, float pixe
ProgramParameters programParameters{ pixelRatio, false };
programs = std::make_unique<Programs>(context, programParameters);
#ifndef NDEBUG
-
+
ProgramParameters programParametersOverdraw{ pixelRatio, true };
overdrawPrograms = std::make_unique<Programs>(context, programParametersOverdraw);
#endif
diff --git a/src/mbgl/storage/local_file_source.hpp b/src/mbgl/storage/local_file_source.hpp
index 5d665c3848..43319bc06e 100644
--- a/src/mbgl/storage/local_file_source.hpp
+++ b/src/mbgl/storage/local_file_source.hpp
@@ -14,7 +14,7 @@ public:
~LocalFileSource() override;
std::unique_ptr<AsyncRequest> request(const Resource&, Callback) override;
-
+
static bool acceptsURL(const std::string& url);
private:
diff --git a/src/mbgl/style/source_observer.hpp b/src/mbgl/style/source_observer.hpp
index dcbcaeabaf..9be7c67960 100644
--- a/src/mbgl/style/source_observer.hpp
+++ b/src/mbgl/style/source_observer.hpp
@@ -20,7 +20,7 @@ public:
virtual void onSourceAttributionChanged(Source&, const std::string&) {}
virtual void onSourceError(Source&, std::exception_ptr) {}
- //Source description needs to be reloaded
+ // Source description needs to be reloaded
virtual void onSourceDescriptionChanged(Source&) {}
virtual void onTileChanged(Source&, const OverscaledTileID&) {}
diff --git a/src/mbgl/style/sources/geojson_source_impl.cpp b/src/mbgl/style/sources/geojson_source_impl.cpp
index 3f3bc879f7..c7c3753076 100644
--- a/src/mbgl/style/sources/geojson_source_impl.cpp
+++ b/src/mbgl/style/sources/geojson_source_impl.cpp
@@ -39,7 +39,7 @@ GeoJSONSource::Impl::~Impl() = default;
void GeoJSONSource::Impl::setURL(std::string url_) {
url = std::move(url_);
- //Signal that the source description needs a reload
+ // Signal that the source description needs a reload
if (loaded || req) {
loaded = false;
req.reset();
@@ -57,7 +57,7 @@ void GeoJSONSource::Impl::setGeoJSON(const GeoJSON& geoJSON) {
_setGeoJSON(geoJSON);
}
-//Private implementation
+// Private implementation
void GeoJSONSource::Impl::_setGeoJSON(const GeoJSON& geoJSON) {
double scale = util::EXTENT / util::tileSize;
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 0b516f7b9f..d6a525f502 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -134,12 +134,12 @@ void Style::setJSON(const std::string& json) {
spriteAtlas->load(parser.spriteURL, fileSource);
loaded = true;
-
+
observer->onStyleLoaded();
}
void Style::addSource(std::unique_ptr<Source> source) {
- //Guard against duplicate source ids
+ // Guard against duplicate source ids
auto it = std::find_if(sources.begin(), sources.end(), [&](const auto& existing) {
return existing->getID() == source->getID();
});
@@ -667,7 +667,7 @@ void Style::onLayerLayoutPropertyChanged(Layer& layer, const char * property) {
auto update = Update::Layout;
- //Recalculate the style for certain properties
+ // Recalculate the style for certain properties
bool needsRecalculation = strcmp(property, "icon-size") == 0 || strcmp(property, "text-size") == 0;
if (needsRecalculation) {
update |= Update::RecalculateStyle;
diff --git a/src/mbgl/style/tile_source_impl.hpp b/src/mbgl/style/tile_source_impl.hpp
index 366e0b60a2..2b17872d2b 100644
--- a/src/mbgl/style/tile_source_impl.hpp
+++ b/src/mbgl/style/tile_source_impl.hpp
@@ -33,7 +33,7 @@ public:
const variant<std::string, Tileset>& getURLOrTileset() const {
return urlOrTileset;
}
-
+
optional<std::string> getAttribution() const override;
protected:
diff --git a/src/mbgl/text/glyph_set.cpp b/src/mbgl/text/glyph_set.cpp
index f9a90f9bb0..b4b3195486 100644
--- a/src/mbgl/text/glyph_set.cpp
+++ b/src/mbgl/text/glyph_set.cpp
@@ -114,7 +114,7 @@ float GlyphSet::determineAverageLineWidth(const std::u16string& logicalInput,
int32_t targetLineCount = std::fmax(1, std::ceil(totalWidth / maxWidth));
return totalWidth / targetLineCount;
}
-
+
float calculateBadness(const float lineWidth, const float targetWidth, const float penalty, const bool isLastBreak) {
const float raggedness = std::pow(lineWidth - targetWidth, 2);
if (isLastBreak) {
@@ -130,7 +130,7 @@ float calculateBadness(const float lineWidth, const float targetWidth, const flo
}
return raggedness + std::pow(penalty, 2);
}
-
+
float calculatePenalty(char16_t codePoint, char16_t nextCodePoint) {
float penalty = 0;
// Force break on newline
@@ -146,28 +146,28 @@ float calculatePenalty(char16_t codePoint, char16_t nextCodePoint) {
if (nextCodePoint == 0x29 || nextCodePoint == 0xff09) {
penalty += 50;
}
-
+
return penalty;
}
-
+
struct PotentialBreak {
PotentialBreak(const std::size_t p_index, const float p_x, const PotentialBreak* p_priorBreak, const float p_badness)
: index(p_index), x(p_x), priorBreak(p_priorBreak), badness(p_badness)
{}
-
+
const std::size_t index;
const float x;
const PotentialBreak* priorBreak;
const float badness;
};
-
+
PotentialBreak evaluateBreak(const std::size_t breakIndex, const float breakX, const float targetWidth, const std::list<PotentialBreak>& potentialBreaks, const float penalty, const bool isLastBreak) {
// We could skip evaluating breaks where the line length (breakX - priorBreak.x) > maxWidth
// ...but in fact we allow lines longer than maxWidth (if there's no break points)
// ...and when targetWidth and maxWidth are close, strictly enforcing maxWidth can give
// more lopsided results.
-
+
const PotentialBreak* bestPriorBreak = nullptr;
float bestBreakBadness = calculateBadness(breakX, targetWidth, penalty, isLastBreak);
for (const auto& potentialBreak : potentialBreaks) {
@@ -182,7 +182,7 @@ PotentialBreak evaluateBreak(const std::size_t breakIndex, const float breakX, c
return PotentialBreak(breakIndex, breakX, bestPriorBreak, bestBreakBadness);
}
-
+
std::set<std::size_t> leastBadBreaks(const PotentialBreak& lastLineBreak) {
std::set<std::size_t> leastBadBreaks = { lastLineBreak.index };
const PotentialBreak* priorBreak = lastLineBreak.priorBreak;
@@ -206,9 +206,9 @@ std::set<std::size_t> GlyphSet::determineLineBreaks(const std::u16string& logica
if (logicalInput.empty()) {
return {};
}
-
+
const float targetWidth = determineAverageLineWidth(logicalInput, spacing, maxWidth);
-
+
std::list<PotentialBreak> potentialBreaks;
float currentX = 0;
@@ -218,7 +218,7 @@ std::set<std::size_t> GlyphSet::determineLineBreaks(const std::u16string& logica
if (it != sdfs.end() && !boost::algorithm::is_any_of(u" \t\n\v\f\r")(codePoint)) {
currentX += it->second.metrics.advance + spacing;
}
-
+
// Ideographic characters, spaces, and word-breaking punctuation that often appear without
// surrounding spaces.
if ((i < logicalInput.size() - 1) &&
@@ -274,7 +274,7 @@ void GlyphSet::shapeLines(Shaping& shaping,
if (shaping.positionedGlyphs.size() != lineStartIndex) {
float lineLength = x - spacing; // Don't count trailing spacing
maxLineLength = util::max(lineLength, maxLineLength);
-
+
justifyLine(shaping.positionedGlyphs, sdfs, lineStartIndex,
shaping.positionedGlyphs.size() - 1, justify);
}
diff --git a/src/mbgl/tile/geojson_tile.cpp b/src/mbgl/tile/geojson_tile.cpp
index 61437b79b1..db2f37f96c 100644
--- a/src/mbgl/tile/geojson_tile.cpp
+++ b/src/mbgl/tile/geojson_tile.cpp
@@ -80,7 +80,7 @@ GeoJSONTile::GeoJSONTile(const OverscaledTileID& overscaledTileID,
const style::UpdateParameters& parameters)
: GeometryTile(overscaledTileID, sourceID_, parameters) {
}
-
+
void GeoJSONTile::updateData(const mapbox::geometry::feature_collection<int16_t>& features) {
setData(std::make_unique<GeoJSONTileData>(features));
}
diff --git a/src/mbgl/tile/geojson_tile.hpp b/src/mbgl/tile/geojson_tile.hpp
index 2880408736..6ddc6ea482 100644
--- a/src/mbgl/tile/geojson_tile.hpp
+++ b/src/mbgl/tile/geojson_tile.hpp
@@ -16,7 +16,7 @@ public:
const style::UpdateParameters&);
void updateData(const mapbox::geometry::feature_collection<int16_t>&);
-
+
void setNecessity(Necessity) final;
};
diff --git a/src/mbgl/tile/tile_id.hpp b/src/mbgl/tile/tile_id.hpp
index 6415debfdc..1ce3eea98e 100644
--- a/src/mbgl/tile/tile_id.hpp
+++ b/src/mbgl/tile/tile_id.hpp
@@ -252,7 +252,7 @@ template <> struct hash<mbgl::CanonicalTileID> {
return seed;
}
};
-
+
template <> struct hash<mbgl::UnwrappedTileID> {
size_t operator()(const mbgl::UnwrappedTileID &id) const {
std::size_t seed = 0;
@@ -261,7 +261,7 @@ template <> struct hash<mbgl::UnwrappedTileID> {
return seed;
}
};
-
+
template <> struct hash<mbgl::OverscaledTileID> {
size_t operator()(const mbgl::OverscaledTileID &id) const {
std::size_t seed = 0;
diff --git a/src/mbgl/util/chrono.cpp b/src/mbgl/util/chrono.cpp
index f338f524b9..5c8fd3c0ff 100644
--- a/src/mbgl/util/chrono.cpp
+++ b/src/mbgl/util/chrono.cpp
@@ -33,7 +33,7 @@ std::string iso8601(Timestamp timestamp) {
Timestamp parseTimestamp(const char* timestamp) {
return std::chrono::time_point_cast<Seconds>(std::chrono::system_clock::from_time_t(parse_date(timestamp)));
}
-
+
Timestamp parseTimestamp(const int32_t timestamp) {
return std::chrono::time_point_cast<Seconds>(std::chrono::system_clock::from_time_t(timestamp));
}
diff --git a/src/mbgl/util/http_header.cpp b/src/mbgl/util/http_header.cpp
index e337d4c8ab..40711232ff 100644
--- a/src/mbgl/util/http_header.cpp
+++ b/src/mbgl/util/http_header.cpp
@@ -28,7 +28,7 @@ CacheControl CacheControl::parse(const std::string& value) {
optional<Timestamp> CacheControl::toTimePoint() const {
return maxAge ? util::now() + Seconds(*maxAge) : optional<Timestamp>{};
}
-
+
optional<Timestamp> parseRetryHeaders(const optional<std::string>& retryAfter,
const optional<std::string>& xRateLimitReset) {
if (retryAfter) {
@@ -45,7 +45,7 @@ optional<Timestamp> parseRetryHeaders(const optional<std::string>& retryAfter,
return {};
}
}
-
+
return {};
}
diff --git a/src/mbgl/util/http_header.hpp b/src/mbgl/util/http_header.hpp
index fa76cb724e..23da2c9ea4 100644
--- a/src/mbgl/util/http_header.hpp
+++ b/src/mbgl/util/http_header.hpp
@@ -17,7 +17,7 @@ public:
optional<Timestamp> toTimePoint() const;
};
-
+
optional<Timestamp> parseRetryHeaders(const optional<std::string>& retryAfter,
const optional<std::string>& xRateLimitReset);
diff --git a/src/mbgl/util/http_timeout.cpp b/src/mbgl/util/http_timeout.cpp
index ded0128ac9..ca9a93498f 100644
--- a/src/mbgl/util/http_timeout.cpp
+++ b/src/mbgl/util/http_timeout.cpp
@@ -17,7 +17,7 @@ Duration errorRetryTimeout(Response::Error::Reason failedRequestReason, uint32_t
if (retryAfter) {
return *retryAfter - util::now();
} else {
- //Default
+ // Default
return Seconds(util::DEFAULT_RATE_LIMIT_TIMEOUT);
}
} else {
@@ -34,7 +34,7 @@ Duration expirationTimeout(optional<Timestamp> expires, uint32_t expiredRequests
} else {
return Duration::max();
}
-}
+}
} // namespace http
} // namespace mbgl