This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Restore ring start point after wagyu #15309
Draft
astojilj
wants to merge
2
commits into
master
Choose a base branch
from
astojilj-15286
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
astojilj
force-pushed
the
astojilj-15286
branch
from
August 5, 2019 05:37
2d93e32
to
3ea378d
Compare
astojilj
added
Core
The cross-platform C++ core, aka mbgl
GL JS parity
For feature parity with Mapbox GL JS
labels
Aug 5, 2019
wagyu algorithm setup and checking if polygon fixup is required is expensive as much as fixing it - so we continue running wagyu for all geojson and, if attempt to restore original point order after wagyu. Even with no polygon fixup, starting point in rings is changed. This causes a disparity between GL-JS and GL-native, visible in implementation of fill-extrusion pattern. Fixes: #15268
astojilj
force-pushed
the
astojilj-15286
branch
4 times, most recently
from
August 6, 2019 12:43
b884a94
to
0690b1b
Compare
…r-tests run on linux
astojilj
force-pushed
the
astojilj-15286
branch
from
August 6, 2019 12:59
0690b1b
to
e4d35d8
Compare
alexshalamov
reviewed
Aug 6, 2019
return std::move(rings); | ||
} | ||
|
||
int i = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::size_t, int overflows and [i++]
would terminate
alexshalamov
reviewed
Aug 6, 2019
@@ -36,6 +36,27 @@ static GeometryCollection toGeometryCollection(MultiPolygon<int16_t>&& multipoly | |||
return result; | |||
} | |||
|
|||
// Attempts to restore original point order in rings: | |||
// see https://github.com/mapbox/mapbox-gl-native/issues/15268. | |||
static GeometryCollection restorePointOrder(GeometryCollection&& rings, const GeometryCollection& originalRings) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GeometryCollection rings
and then just return, without move to avoid disabling NRVO
pozdnyakov
reviewed
Aug 6, 2019
@@ -36,6 +36,27 @@ static GeometryCollection toGeometryCollection(MultiPolygon<int16_t>&& multipoly | |||
return result; | |||
} | |||
|
|||
// Attempts to restore original point order in rings: | |||
// see https://github.com/mapbox/mapbox-gl-native/issues/15268. | |||
static GeometryCollection restorePointOrder(GeometryCollection&& rings, const GeometryCollection& originalRings) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nameless namespace instead of static
pozdnyakov
reviewed
Aug 6, 2019
|
||
int i = 0; | ||
for (auto& ring : rings) { | ||
const auto originalRing = originalRings[i++]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const auto& ?
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Restore point order in polygons after polygon fixup.
Algorithm setup and checking if polygon fixup is required would be as expensive as fixing it. So, we don't introduce another step checking if fixup is needed but continue running wagyu for all geojson and, make an attempt to restore original point order in rings, after wagyu. Having a change in starting point of rings caused a disparity between GL-JS and GL-native, visible in implementation of fill-extrusion pattern.
Fixes: #15268