summaryrefslogtreecommitdiff
path: root/src/mbgl/layout
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-27 18:30:35 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-04-17 13:36:50 +0300
commitdffe00feeade4d65d10deecdc196add14b791c11 (patch)
treec0b834bf8e6f44e37b5d01af87c044bdf91c7079 /src/mbgl/layout
parent2eebd7170aa72168df1d963422d256411fc4f5ef (diff)
downloadqtlocation-mapboxgl-dffe00feeade4d65d10deecdc196add14b791c11.tar.gz
[core] Fix readability-avoid-const-params-in-decls errors in header files
As reported by clang-tidy-8.
Diffstat (limited to 'src/mbgl/layout')
-rw-r--r--src/mbgl/layout/clip_lines.hpp4
-rw-r--r--src/mbgl/layout/layout.hpp4
-rw-r--r--src/mbgl/layout/symbol_instance.hpp24
-rw-r--r--src/mbgl/layout/symbol_layout.hpp14
-rw-r--r--src/mbgl/layout/symbol_projection.hpp36
5 files changed, 44 insertions, 38 deletions
diff --git a/src/mbgl/layout/clip_lines.hpp b/src/mbgl/layout/clip_lines.hpp
index c1cfd4bbb9..9c6ebbddfd 100644
--- a/src/mbgl/layout/clip_lines.hpp
+++ b/src/mbgl/layout/clip_lines.hpp
@@ -8,9 +8,7 @@
namespace mbgl {
namespace util {
-
-GeometryCollection clipLines(const GeometryCollection &lines,
- const int16_t x1, const int16_t y1, const int16_t x2, const int16_t y2);
+GeometryCollection clipLines(const GeometryCollection &lines, int16_t x1, int16_t y1, int16_t x2, int16_t y2);
} // end namespace util
} // end namespace mbgl
diff --git a/src/mbgl/layout/layout.hpp b/src/mbgl/layout/layout.hpp
index ae0eb5d5f3..aaa4d4b8e1 100644
--- a/src/mbgl/layout/layout.hpp
+++ b/src/mbgl/layout/layout.hpp
@@ -20,8 +20,8 @@ public:
virtual void createBucket(const ImagePositions&,
std::unique_ptr<FeatureIndex>&,
std::unordered_map<std::string, LayerRenderData>&,
- const bool,
- const bool,
+ bool,
+ bool,
const CanonicalTileID&) = 0;
virtual void prepareSymbols(const GlyphMap&, const GlyphPositions&, const ImageMap&, const ImagePositions&){};
diff --git a/src/mbgl/layout/symbol_instance.hpp b/src/mbgl/layout/symbol_instance.hpp
index fa05affc13..b10a3acaee 100644
--- a/src/mbgl/layout/symbol_instance.hpp
+++ b/src/mbgl/layout/symbol_instance.hpp
@@ -29,7 +29,7 @@ struct SymbolInstanceSharedData {
const optional<PositionedIcon>& shapedIcon,
const optional<PositionedIcon>& verticallyShapedIcon,
const style::SymbolLayoutProperties::Evaluated& layout,
- const style::SymbolPlacementType textPlacement,
+ style::SymbolPlacementType textPlacement,
const std::array<float, 2>& textOffset,
const ImageMap& imageMap,
float iconRotation,
@@ -54,23 +54,23 @@ public:
const ShapedTextOrientations& shapedTextOrientations,
const optional<PositionedIcon>& shapedIcon,
const optional<PositionedIcon>& verticallyShapedIcon,
- const float textBoxScale,
- const float textPadding,
- const style::SymbolPlacementType textPlacement,
+ float textBoxScale,
+ float textPadding,
+ style::SymbolPlacementType textPlacement,
const std::array<float, 2>& textOffset,
- const float iconBoxScale,
- const float iconPadding,
+ float iconBoxScale,
+ float iconPadding,
const std::array<float, 2>& iconOffset,
const IndexedSubfeature& indexedFeature,
- const std::size_t layoutFeatureIndex,
- const std::size_t dataFeatureIndex,
+ std::size_t layoutFeatureIndex,
+ std::size_t dataFeatureIndex,
std::u16string key,
- const float overscaling,
- const float iconRotation,
- const float textRotation,
+ float overscaling,
+ float iconRotation,
+ float textRotation,
const std::array<float, 2>& variableTextOffset,
bool allowVerticalPlacement,
- const SymbolContent iconType = SymbolContent::None);
+ SymbolContent iconType = SymbolContent::None);
optional<size_t> getDefaultHorizontalPlacedTextIndex() const;
const GeometryCoordinates& line() const;
diff --git a/src/mbgl/layout/symbol_layout.hpp b/src/mbgl/layout/symbol_layout.hpp
index a1c0b86fd9..915a2ae924 100644
--- a/src/mbgl/layout/symbol_layout.hpp
+++ b/src/mbgl/layout/symbol_layout.hpp
@@ -39,8 +39,8 @@ public:
void createBucket(const ImagePositions&,
std::unique_ptr<FeatureIndex>&,
std::unordered_map<std::string, LayerRenderData>&,
- const bool firstLoad,
- const bool showCollisionBoxes,
+ bool firstLoad,
+ bool showCollisionBoxes,
const CanonicalTileID& canonical) override;
bool hasSymbolInstances() const override;
@@ -65,7 +65,7 @@ public:
static std::vector<float> calculateTileDistances(const GeometryCoordinates& line, const Anchor& anchor);
private:
- void addFeature(const size_t,
+ void addFeature(size_t,
const SymbolFeature&,
const ShapedTextOrientations& shapedTextOrientations,
optional<PositionedIcon> shapedIcon,
@@ -73,22 +73,22 @@ private:
std::array<float, 2> textOffset,
float layoutTextSize,
float layoutIconSize,
- const SymbolContent iconType);
+ SymbolContent iconType);
- bool anchorIsTooClose(const std::u16string& text, const float repeatDistance, const Anchor&);
+ bool anchorIsTooClose(const std::u16string& text, float repeatDistance, const Anchor&);
std::map<std::u16string, std::vector<Anchor>> compareText;
void addToDebugBuffers(SymbolBucket&);
// Adds placed items to the buffer.
size_t addSymbol(SymbolBucket::Buffer&,
- const Range<float> sizeData,
+ Range<float> sizeData,
const SymbolQuad&,
const Anchor& labelAnchor,
PlacedSymbol& placedSymbol,
float sortKey);
size_t addSymbols(SymbolBucket::Buffer&,
- const Range<float> sizeData,
+ Range<float> sizeData,
const SymbolQuads&,
const Anchor& labelAnchor,
PlacedSymbol& placedSymbol,
diff --git a/src/mbgl/layout/symbol_projection.hpp b/src/mbgl/layout/symbol_projection.hpp
index d9c80df418..e04f8908b6 100644
--- a/src/mbgl/layout/symbol_projection.hpp
+++ b/src/mbgl/layout/symbol_projection.hpp
@@ -38,30 +38,38 @@ namespace mbgl {
};
float evaluateSizeForFeature(const ZoomEvaluatedSize& zoomEvaluatedSize, const PlacedSymbol& placedSymbol);
- mat4 getLabelPlaneMatrix(const mat4& posMatrix, const bool pitchWithMap, const bool rotateWithMap, const TransformState& state, const float pixelsToTileUnits);
- mat4 getGlCoordMatrix(const mat4& posMatrix, const bool pitchWithMap, const bool rotateWithMap, const TransformState& state, const float pixelsToTileUnits);
-
+ mat4 getLabelPlaneMatrix(const mat4& posMatrix,
+ bool pitchWithMap,
+ bool rotateWithMap,
+ const TransformState& state,
+ float pixelsToTileUnits);
+ mat4 getGlCoordMatrix(const mat4& posMatrix,
+ bool pitchWithMap,
+ bool rotateWithMap,
+ const TransformState& state,
+ float pixelsToTileUnits);
+
using PointAndCameraDistance = std::pair<Point<float>,float>;
PointAndCameraDistance project(const Point<float>& point, const mat4& matrix);
void reprojectLineLabels(gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>&, const std::vector<PlacedSymbol>&,
const mat4& posMatrix, bool pitchWithMap, bool rotateWithMap, bool keepUpright,
const RenderTile&, const SymbolSizeBinder& sizeBinder, const TransformState&);
-
- optional<std::pair<PlacedGlyph, PlacedGlyph>> placeFirstAndLastGlyph(const float fontScale,
- const float lineOffsetX,
- const float lineOffsetY,
- const bool flip,
- const Point<float>& anchorPoint,
- const Point<float>& tileAnchorPoint,
- const PlacedSymbol& symbol,
- const mat4& labelPlaneMatrix,
- const bool returnTileDistance);
+
+ optional<std::pair<PlacedGlyph, PlacedGlyph>> placeFirstAndLastGlyph(float fontScale,
+ float lineOffsetX,
+ float lineOffsetY,
+ bool flip,
+ const Point<float>& anchorPoint,
+ const Point<float>& tileAnchorPoint,
+ const PlacedSymbol& symbol,
+ const mat4& labelPlaneMatrix,
+ bool returnTileDistance);
void hideGlyphs(std::size_t numGlyphs,
gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray);
void addDynamicAttributes(const Point<float>& anchorPoint,
- const float angle,
+ float angle,
gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray);
} // end namespace mbgl