Commit f129dbb
committed
Use HasColorKey instead of GetColorKey in pgSurface_Blit
This routine doesn't use the value of GetColorKey, it just wants to know whether the surface has one.
Internally, this was setting a bunch of SDL errors ("surf doesn't have colorkey"-esque), which became much more expensive in SDL 2.29.3 because of a new logging feature.
Therefore lets replace it with HasColorKey (a newer function, the code was originally written before this existed). This fixes the performance regression here and even makes the performance slightly better than it was before, at least in my test scenario.
Credit to itzpr for narrowing this down to SDL_GetColorKey1 parent 7d73fc8 commit f129dbb
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3822 | 3822 | | |
3823 | 3823 | | |
3824 | 3824 | | |
3825 | | - | |
3826 | 3825 | | |
3827 | 3826 | | |
3828 | 3827 | | |
| |||
3860 | 3859 | | |
3861 | 3860 | | |
3862 | 3861 | | |
3863 | | - | |
| 3862 | + | |
3864 | 3863 | | |
3865 | 3864 | | |
3866 | 3865 | | |
| |||
3916 | 3915 | | |
3917 | 3916 | | |
3918 | 3917 | | |
3919 | | - | |
3920 | | - | |
| 3918 | + | |
3921 | 3919 | | |
3922 | 3920 | | |
3923 | 3921 | | |
| |||
0 commit comments