- Notifications
You must be signed in to change notification settings - Fork3.9k
Closed
Description
When I wrotescale_by andsmoothscale_by, I made them call the correspondingscale andsmoothscale by creating a python arguments tuple in the c code, and then calling the other function in C code.
It would likely be faster to not have to convert from Python args to C variables back to Python args back to C variables, rather parsing into C once and staying at that level.
Relevant code:https://github.com/pygame/pygame/blob/main/src_c/transform.c#L524-L625,https://github.com/pygame/pygame/blob/main/src_c/transform.c#L1471-L1585
Basically the idea is to make a C function common backend (takes two surfaces and a size probably?) that bothscale_by andscale can send C arguments too, which should speed upscale_by. (Same with smoothscale)