We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3350

Summary: GL renderers don't need to flip rows after reading back pixels from the target texture
Product: SDL Reporter: Simon Hug <chli.hug>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: All   
Attachments: Patch that fixes upside down target textures when using ReadPixels and GL renderers.

Description Simon Hug 2016-05-28 20:13:46 UTC
Created attachment 2472 [details]
Patch that fixes upside down target textures when using ReadPixels and GL renderers.

All OpenGL renderers always flip the rows of the pixels that come from glReadPixels. This is unnecessary for target textures since these are already top down.

Also, the rect->y value can be used directly for target textures for the same reason. I don't see any code that would handle the logical render size for target textures. Or am I missing something?

The attached patch makes the renderers only the flip rows if the data comes from the default framebuffer.
Comment 1 Sam Lantinga 2016-10-01 18:34:23 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/b8ca95a8eea9