summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-04-19 10:10:48 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-04-21 11:01:56 -0700
commita14f0d2eddd4d9eb1bbf33fed3bfffe2329acf5e (patch)
treec731d8b96616fc333d550bf5ac78ab9db564ccbf
parent4e04a107e85a2118df12415cc661b8edb1fa36f4 (diff)
downloadqtlocation-mapboxgl-a14f0d2eddd4d9eb1bbf33fed3bfffe2329acf5e.tar.gz
[core] CapType ⇢ LineCapType
-rw-r--r--include/mbgl/style/types.hpp10
-rw-r--r--src/mbgl/layer/line_layer.hpp2
-rw-r--r--src/mbgl/renderer/line_bucket.cpp12
-rw-r--r--src/mbgl/renderer/painter_line.cpp4
-rw-r--r--src/mbgl/style/function.cpp4
-rw-r--r--src/mbgl/style/property_parsing.cpp8
-rw-r--r--src/mbgl/util/interpolate.hpp2
7 files changed, 21 insertions, 21 deletions
diff --git a/include/mbgl/style/types.hpp b/include/mbgl/style/types.hpp
index 97a648210a..31be19cdc6 100644
--- a/include/mbgl/style/types.hpp
+++ b/include/mbgl/style/types.hpp
@@ -56,16 +56,16 @@ MBGL_DEFINE_ENUM_CLASS(VisibilityTypeClass, VisibilityType, {
// -------------------------------------------------------------------------------------------------
-enum class CapType : uint8_t {
+enum class LineCapType : uint8_t {
Round,
Butt,
Square,
};
-MBGL_DEFINE_ENUM_CLASS(CapTypeClass, CapType, {
- { CapType::Round, "round" },
- { CapType::Butt, "butt" },
- { CapType::Square, "square" },
+MBGL_DEFINE_ENUM_CLASS(LineCapTypeClass, LineCapType, {
+ { LineCapType::Round, "round" },
+ { LineCapType::Butt, "butt" },
+ { LineCapType::Square, "square" },
});
// -------------------------------------------------------------------------------------------------
diff --git a/src/mbgl/layer/line_layer.hpp b/src/mbgl/layer/line_layer.hpp
index 200541c620..0aa8d3af8e 100644
--- a/src/mbgl/layer/line_layer.hpp
+++ b/src/mbgl/layer/line_layer.hpp
@@ -9,7 +9,7 @@ namespace mbgl {
class LineLayoutProperties {
public:
- LayoutProperty<CapType> cap { CapType::Butt };
+ LayoutProperty<LineCapType> cap { LineCapType::Butt };
LayoutProperty<JoinType> join { JoinType::Miter };
LayoutProperty<float> miterLimit { 2.0f };
LayoutProperty<float> roundLimit { 1.0f };
diff --git a/src/mbgl/renderer/line_bucket.cpp b/src/mbgl/renderer/line_bucket.cpp
index 83a14acbc1..2ae2998b92 100644
--- a/src/mbgl/renderer/line_bucket.cpp
+++ b/src/mbgl/renderer/line_bucket.cpp
@@ -80,8 +80,8 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) {
return;
}
- const CapType beginCap = layout.cap;
- const CapType endCap = closed ? CapType::Butt : CapType(layout.cap);
+ const LineCapType beginCap = layout.cap;
+ const LineCapType endCap = closed ? LineCapType::Butt : LineCapType(layout.cap);
double distance = 0;
bool startOfLine = true;
@@ -173,7 +173,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) {
// The join if a middle vertex, otherwise the cap
const bool middleVertex = prevVertex && nextVertex;
JoinType currentJoin = layout.join;
- const CapType currentCap = nextVertex ? beginCap : endCap;
+ const LineCapType currentCap = nextVertex ? beginCap : endCap;
if (middleVertex) {
if (currentJoin == JoinType::Round) {
@@ -279,7 +279,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) {
false, startVertex, triangleStore);
}
- } else if (!middleVertex && currentCap == CapType::Butt) {
+ } else if (!middleVertex && currentCap == LineCapType::Butt) {
if (!startOfLine) {
// Close previous segment with a butt
addCurrentVertex(currentVertex, distance, prevNormal, 0, 0, false,
@@ -292,7 +292,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) {
startVertex, triangleStore);
}
- } else if (!middleVertex && currentCap == CapType::Square) {
+ } else if (!middleVertex && currentCap == LineCapType::Square) {
if (!startOfLine) {
// Close previous segment with a square cap
addCurrentVertex(currentVertex, distance, prevNormal, 1, 1, false,
@@ -308,7 +308,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) {
startVertex, triangleStore);
}
- } else if (middleVertex ? currentJoin == JoinType::Round : currentCap == CapType::Round) {
+ } else if (middleVertex ? currentJoin == JoinType::Round : currentCap == LineCapType::Round) {
if (!startOfLine) {
// Close previous segment with a butt
addCurrentVertex(currentVertex, distance, prevNormal, 0, 0, false,
diff --git a/src/mbgl/renderer/painter_line.cpp b/src/mbgl/renderer/painter_line.cpp
index 13515c5ced..1ea5e932e0 100644
--- a/src/mbgl/renderer/painter_line.cpp
+++ b/src/mbgl/renderer/painter_line.cpp
@@ -78,8 +78,8 @@ void Painter::renderLine(LineBucket& bucket, const LineLayer& layer, const TileI
linesdfShader->u_blur = blur;
linesdfShader->u_color = color;
- LinePatternPos posA = lineAtlas->getDashPosition(properties.dasharray.value.from, layout.cap == CapType::Round, glObjectStore);
- LinePatternPos posB = lineAtlas->getDashPosition(properties.dasharray.value.to, layout.cap == CapType::Round, glObjectStore);
+ LinePatternPos posA = lineAtlas->getDashPosition(properties.dasharray.value.from, layout.cap == LineCapType::Round, glObjectStore);
+ LinePatternPos posB = lineAtlas->getDashPosition(properties.dasharray.value.to, layout.cap == LineCapType::Round, glObjectStore);
const float widthA = posA.width * properties.dasharray.value.fromScale * properties.dashLineWidth;
const float widthB = posB.width * properties.dasharray.value.toScale * properties.dashLineWidth;
diff --git a/src/mbgl/style/function.cpp b/src/mbgl/style/function.cpp
index 16af9c8fc8..501f27fcad 100644
--- a/src/mbgl/style/function.cpp
+++ b/src/mbgl/style/function.cpp
@@ -19,7 +19,7 @@ template <> inline std::array<float, 2> defaultStopsValue() { return {{ 0, 0 }};
template <> inline std:: string defaultStopsValue() { return {}; }
template <> inline TranslateAnchorType defaultStopsValue() { return {}; };
template <> inline RotateAnchorType defaultStopsValue() { return {}; };
-template <> inline CapType defaultStopsValue() { return {}; };
+template <> inline LineCapType defaultStopsValue() { return {}; };
template <> inline JoinType defaultStopsValue() { return {}; };
template <> inline PlacementType defaultStopsValue() { return {}; };
template <> inline TextAnchorType defaultStopsValue() { return {}; };
@@ -84,7 +84,7 @@ template class Function<std::array<float, 2>>;
template class Function<std::string>;
template class Function<TranslateAnchorType>;
template class Function<RotateAnchorType>;
-template class Function<CapType>;
+template class Function<LineCapType>;
template class Function<JoinType>;
template class Function<PlacementType>;
template class Function<TextAnchorType>;
diff --git a/src/mbgl/style/property_parsing.cpp b/src/mbgl/style/property_parsing.cpp
index bdeb04c286..056c78bcfc 100644
--- a/src/mbgl/style/property_parsing.cpp
+++ b/src/mbgl/style/property_parsing.cpp
@@ -101,13 +101,13 @@ optional<RotateAnchorType> parseProperty<RotateAnchorType>(const char* name, con
}
template <>
-optional<CapType> parseProperty<CapType>(const char* name, const JSValue& value) {
+optional<LineCapType> parseProperty<LineCapType>(const char* name, const JSValue& value) {
if (!value.IsString()) {
Log::Warning(Event::ParseStyle, "value of '%s' must be a string", name);
return {};
}
- return { CapTypeClass({ value.GetString(), value.GetStringLength() }) };
+ return { LineCapTypeClass({ value.GetString(), value.GetStringLength() }) };
}
template <>
@@ -322,8 +322,8 @@ template <> optional<Function<RotateAnchorType>> parseProperty(const char* name,
return parseFunction<RotateAnchorType>(name, value);
}
-template <> optional<Function<CapType>> parseProperty(const char* name, const JSValue& value) {
- return parseFunction<CapType>(name, value);
+template <> optional<Function<LineCapType>> parseProperty(const char* name, const JSValue& value) {
+ return parseFunction<LineCapType>(name, value);
}
template <> optional<Function<JoinType>> parseProperty(const char* name, const JSValue& value) {
diff --git a/src/mbgl/util/interpolate.hpp b/src/mbgl/util/interpolate.hpp
index 03d401c350..499783342f 100644
--- a/src/mbgl/util/interpolate.hpp
+++ b/src/mbgl/util/interpolate.hpp
@@ -38,7 +38,7 @@ template<> inline std::vector<float> interpolate(const std::vector<float> a, con
template<> inline std::string interpolate(const std::string a, const std::string, const double) { return a; }
template<> inline TranslateAnchorType interpolate(const TranslateAnchorType a, const TranslateAnchorType, const double) { return a; }
template<> inline RotateAnchorType interpolate(const RotateAnchorType a, const RotateAnchorType, const double) { return a; }
-template<> inline CapType interpolate(const CapType a, const CapType, const double) { return a; }
+template<> inline LineCapType interpolate(const LineCapType a, const LineCapType, const double) { return a; }
template<> inline JoinType interpolate(const JoinType a, const JoinType, const double) { return a; }
template<> inline PlacementType interpolate(const PlacementType a, const PlacementType, const double) { return a; }
template<> inline TextAnchorType interpolate(const TextAnchorType a, const TextAnchorType, const double) { return a; }