Open
Conversation
Added an SDL_Surface as a cache for the bitmap so that pixels can be transfered all at once to the GPU
Speed tests were already partly implemented, but conditionals for selecting the tests based on input from the user must have been accidentally removed during rebase from v4 branch to devel.
As bitmaps now always have an allocated surface, there is no need to ensure the surface exists. Surfaces are now also always drawable (which means that bitmap_be.drawable is probably no longer needed. This was done because it seemed the only reason surfaces were not drawable because of images that had been loaded from file which needed to be kept in sync with their textures. My modifications now no longer make this a problem as data will always be synced between surfaces when different drawing operations call for it.
All bitmaps should have a surface, otherwise there will be serious issues when trying to draw to the surface, or sync the surface to it's corresponding texture. Thus this function has been made redundant and has been optimised out.
The image is opened through a read only surface, then copied to a newly created bitmap. This properly frees image surface after copying it to the bitmap.
Bitmaps no longer need to know if they're drawable as their SDL_Surface is always drawable and always exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request is in reference to issue #36