Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

fix really overscaled lines #16045

Merged
merged 3 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
This patch introduces batch conversion between LatLng and ScreenCoordinate in Gl-Native core, so for multiple conversions with single point/latLng previously now it can be done with invoking one function call by passing vector of points/latLngs.

### Bug fixes
- [core] Fix really overscaled lines ([#16045](https://github.com/mapbox/mapbox-gl-native/pull/16045))

We resample lines after sharp corners in some situations. When tiles were really overscaled, sometimes we didn't have enough precision to represent the resampled vertex because it was too close. Disabling this after a certain point prevents this ([#16018](https://github.com/mapbox/mapbox-gl-native/issues/16018)).

- [core] Don't use signed int type for anchor segment ([#16008](https://github.com/mapbox/mapbox-gl-native/pull/16008))

Erroneous signed to unsigned implicit conversion was used when PlacedSymbol(s) were created in SymbolLayout and signed values were used as indexes in a few other places.
Expand Down
1 change: 0 additions & 1 deletion metrics/ignores/platform-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
"render-tests/regressions/mapbox-gl-js#7708": "skip - js specific",
"render-tests/regressions/mapbox-gl-js#8026": "skip - js specific",
"render-tests/regressions/mapbox-gl-js#8817": "skip - https://github.com/mapbox/mapbox-gl-native/issues/15737",
"render-tests/regressions/mapbox-gl-js#9009": "https://github.com/mapbox/mapbox-gl-native/issues/16018",
"render-tests/regressions/mapbox-gl-native#7357": "https://github.com/mapbox/mapbox-gl-native/issues/7357",
"render-tests/runtime-styling/image-add-remove-add": "skip - https://github.com/mapbox/mapbox-gl-native/issues/16021",
"render-tests/runtime-styling/pattern-add-remove-add": "skip - https://github.com/mapbox/mapbox-gl-native/issues/16021",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
32768
],
[
28042,
28042
28078,
28078
],
[
48928,
48928
48976,
48976
]
]
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"network": [
[
"probeNetwork - default - end",
0,
0
],
[
"probeNetwork - default - start",
0,
0
]
],
"gfx": [
[
"probeGFX - default - end",
8,
9,
13,
1,
[
131072,
131072
],
[
214,
214
],
[
384,
384
]
]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
32768
],
[
28042,
28042
28078,
28078
],
[
48928,
48928
48976,
48976
]
]
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"network": [
[
"probeNetwork - default - end",
0,
0
],
[
"probeNetwork - default - start",
0,
0
]
],
"gfx": [
[
"probeGFX - default - end",
8,
9,
13,
1,
[
131072,
131072
],
[
214,
214
],
[
384,
384
]
]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
32768
],
[
28042,
28042
28078,
28078
],
[
48928,
48928
48976,
48976
]
]
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"network": [
[
"probeNetwork - default - end",
0,
0
],
[
"probeNetwork - default - start",
0,
0
]
],
"gfx": [
[
"probeGFX - default - end",
8,
9,
13,
1,
[
131072,
131072
],
[
214,
214
],
[
384,
384
]
]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
32768
],
[
28042,
28042
28078,
28078
],
[
48928,
48928
48976,
48976
]
]
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"network": [
[
"probeNetwork - default - end",
0,
0
],
[
"probeNetwork - default - start",
0,
0
]
],
"gfx": [
[
"probeGFX - default - end",
8,
9,
13,
1,
[
131072,
131072
],
[
214,
214
],
[
384,
384
]
]
]
}
13 changes: 7 additions & 6 deletions src/mbgl/renderer/buckets/line_bucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,19 @@ void LineBucket::addGeometry(const GeometryCoordinates& coordinates, const Geome
total_length += util::dist<double>(coordinates[i], coordinates[i + 1]);
}

lineDistances = Distances{*numericValue<double>(clip_start_it->second),
*numericValue<double>(clip_end_it->second),
total_length};
lineDistances = Distances{
*numericValue<double>(clip_start_it->second), *numericValue<double>(clip_end_it->second), total_length};
}

const LineJoinType joinType = layout.evaluate<LineJoin>(zoom, feature);

const float miterLimit = joinType == LineJoinType::Bevel ? 1.05f : float(layout.get<LineMiterLimit>());

const double sharpCornerOffset = overscaling == 0 ?
SHARP_CORNER_OFFSET * (float(util::EXTENT) / util::tileSize) :
SHARP_CORNER_OFFSET * (float(util::EXTENT) / (util::tileSize * overscaling));
const double sharpCornerOffset =
overscaling == 0
? SHARP_CORNER_OFFSET * (float(util::EXTENT) / util::tileSize)
: (overscaling <= 16.0 ? SHARP_CORNER_OFFSET * (float(util::EXTENT) / (util::tileSize * overscaling))
: 0.0f);

const GeometryCoordinate firstCoordinate = coordinates[first];
const LineCapType beginCap = layout.get<LineCap>();
Expand Down