Optimise fillEllipse function. ~36% faster #478
Merged
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.
Made a change to the fillEllipse function so that the horizontal lines are only drawn when they're at their longest. This eliminates instances of a longer horizontal line being drawn over a shorter one by only drawing the longer line.
This results in a 36% speed increase when tested on drawing 1000 filled ellipses on an ESP32 with a SH110x display.
No known limitations, the only changes made are to the Adafruit_GFX.cpp file. I just moved the drawLine calls so that they're only called when we move to the next line vertically.