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

menu: faster background drawing using FastHLines #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hervenicol
Copy link
Contributor

I improved menu's background drawing by using a customized version of FilledTriangle, which relies on DrawFastHLine rather than pixel-by-pixel line drawing.

I have mixed feelings:

  • it would be better to do this in tinydraw
  • but I think not all drivers support DrawFastHLine
  • that is why I copied FilledTriangle here, but if you have a better solution I'd love to hear about.

I'm a beginner with go, so there may be a trick I don't know 😉
The aim of this PR is mostly to have your feedback.

Overall there's a lot of potential in performance improvement with batching pixel drawings and using driver-specific functions when available, but I guess if there was an easy way to do it it would already be done 🤷

@conejoninja
Copy link
Member

Shouldn't this be in tinydraw instead? I'm ok for merging but maybe it's time to extend displayer interface and add Hline/Vline functions... what do you think?

@doniacld could you test this issue on your badge? If you ok'd it I'll merge it.

@hervenicol
Copy link
Contributor Author

Shouldn't this be in tinydraw instead? I'm ok for merging but maybe it's time to extend displayer interface and add Hline/Vline functions... what do you think?

💯 agree.
The thing is I don't know how to do this in tinydraw and ensure it works with all graphics drivers.
Once I understand how to do that, I think there's a lot of easy performance improvements.

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.

2 participants