-
-
Notifications
You must be signed in to change notification settings - Fork 860
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
feat: optimization of "solid" polygon/polyline display #1876
Conversation
Impacted files: * `polygon_layer/painter.dart`: minor refactoring * `polyline_layer/painter.dart`: minor refactoring * `pixel_hiker.dart`: optimized the "solid pixel hiker" relying on `addPolygon` instead of numerous `moveTo`/`lineTo`
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.
Hey @monsieurtanuki,
Thanks for continuing to work on this! I've been testing this PR and have noticed that there's an issue on the master branch and on this PR, that could be related. Not sure whether it's worth fixing in a different PR, or this PR, but needs to be fixed for sure.
It looks like the culling algortihm no longer accounts for the radius of the line, so it's possible to see the radius of the curve at the edges of the viewport.
Hi @JaffaKetchup! Probably not related to culling, but to drawing segments clipped to screen rectangle instead of a continuous polygon. |
Hi @JaffaKetchup!
|
I'll try to review this tomorrow :) |
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.
LGTM I think! Thanks once again :)
Thank you @JaffaKetchup for your reviews and feedbacks! |
What
Optimized the algorithm for "solid" polygon/polyline display.
The trick is to use
addPolygon
instead of numerousmoveTo
/lineTo
. It looked like removing redundantmoveTo
s was quite effective, too.Following are some perf tests. We're getting closer to the old solid algorithm (that we had to dismiss because of bugs in 25+ zooms).
Impacted files
polygon_layer/painter.dart
: minor refactoringpolyline_layer/painter.dart
: minor refactoringpixel_hiker.dart
: optimized the "solid pixel hiker" relying onaddPolygon
instead of numerousmoveTo
/lineTo
Screenshots