Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:core:add clipping to polygons with holes #870

Merged
merged 2 commits into from
Sep 13, 2019
Merged

Conversation

metalstrolch
Copy link
Contributor

As some simple graphics like SDL or windows CE do not clip on drawing, the rendering performance of huge (not necessary in node count but on screen) polygons with holes cause poor drawing performance even if only small portions of those polygons are on screen.

To fix this we clip polygons with holes before calling back end to draw like done with traditional polygons as well.

metalstrolch and others added 2 commits September 10, 2019 10:56
This commit extracts the polygon clipping into its own function to be
re used for polygon with holes clipping.
While this helps drawing for limited graphics like SDL or WindowsCE,
it will slightly slow down on graphics that do clipping themselves like
qt5. As this is done for polygons already, we do this for polygons with
holes as well.
@metalstrolch
Copy link
Contributor Author

I will ignore CodeFactor once more, as it is totally stupid to implement, and test code, and then on creating the pull request being told by CodeFactor it was too complex. I will not rewrite tested code because of this. It's hard to guess the metric of CodeFactor applies.

@metalstrolch
Copy link
Contributor Author

Confirmed working in #869 by @gefin

@metalstrolch
Copy link
Contributor Author

Merging this as confirmed to be fine in #869

@metalstrolch metalstrolch merged commit 1d364ed into trunk Sep 13, 2019
@metalstrolch metalstrolch deleted the polygon_clipping branch September 13, 2019 12:43
viktorgino pushed a commit that referenced this pull request Sep 22, 2020
* fix:core:refactor polygon clipping

This commit extracts the polygon clipping into its own function to be
re used for polygon with holes clipping.

* fix:core:Clip polygons with holes prior drawing.

While this helps drawing for limited graphics like SDL or WindowsCE,
it will slightly slow down on graphics that do clipping themselves like
qt5. As this is done for polygons already, we do this for polygons with
holes as well.
jkoan pushed a commit to jkoan/navit that referenced this pull request Jun 30, 2021
…avit-gps#869)

* fix:core:refactor polygon clipping

This commit extracts the polygon clipping into its own function to be
re used for polygon with holes clipping.

* fix:core:Clip polygons with holes prior drawing.

While this helps drawing for limited graphics like SDL or WindowsCE,
it will slightly slow down on graphics that do clipping themselves like
qt5. As this is done for polygons already, we do this for polygons with
holes as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant