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

Add Surface::get_pixel and remove special case from blit code #828

Merged
merged 4 commits into from
Jul 17, 2023

Conversation

Daft-Freak
Copy link
Collaborator

After repeating my "blit that is actually a fill" optimisation for the third time, I worked out a way to avoid it entirely and improve TileMap perf a bit. Also adds a useful get_pixel method to Surface (returns the pixel converted to a Pen).

I haven't benchmarked the change to stretch_blit, but I'd expect a similar effect there.

(Making the blit code smaller is also a good thing for the firmware)

…step

This is a few ms faster in tilemap-test on PicoSystem/Vision (and a _tiny_ bit faster on stm32)
and should allow removing all the step==0 special cases in the blend code
Same logic should apply as TileMap, haven't checked perf yet
@Gadgetoid Gadgetoid merged commit eed9a43 into 32blit:master Jul 17, 2023
8 checks passed
@Gadgetoid
Copy link
Contributor

Wow, I can't even wrap my brain around what the edge case was doing and why, but it was... janky 😬

Thanks!

@Daft-Freak Daft-Freak deleted the get_pixel-tilemap-blend branch July 17, 2023 15:07
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