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
Merge Render.blit, absolute_blit and relative_blit #4427
Comments
I'm not sure what the benefit of a change that goes from three blit methods to three blit methods is. It seems like we'd be doing a lot of work for not a lot of improvement. |
The benefits would be twofold : one, clarify what function does what, two, add the What's more, I suspect the functions called by these blit methods don't actually care about the type of the values, and only consider them as absolute number of pixels. If that's confirmed, then all three existing methods actually do the same thing and could be merged into one |
The proposed changes add additional lookups, conditionals and/or frames to the stack for both |
The second version with I think we're a bit in the fog until we know for sure whether passing an int or a float/absolute with an integer value actually makes any difference. |
Given how the methods are used in internal code, I propose the following architecture.
_blit
orraw_blit
- implements the behavior common to all three former methods, without doing anything to the type ofpos
integer_blit
oriblit
- does what the currentblit
does : rounds (down ?) the pos values to integers and passes them to_blit
. Used instead ofblit
in existing internal code.absolute_blit
- does the same as the formerabsolute_blit
andsubpixel_blit
, kept for compatibility with internal code.blit
- exposed as part of the public CDD Render API for creators to use, does a compated typechech on the pos values : if the compat disables it, callsinteger_blit
, otherwise treats them as positions (multiply pure floats with the size of the Render) and pass it to_blit
.Feedback on this is appreciated.
The text was updated successfully, but these errors were encountered: