| Summary: | Software renderer SDL_RenderCopyEx blits corrupt image under certain cases | ||
|---|---|---|---|
| Product: | SDL | Reporter: | duckgrease |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz, sylvain.becker |
| Version: | 2.0.8 | ||
| Hardware: | x86_64 | ||
| OS: | All | ||
| Attachments: |
corrupt SDL_RenderCopyEx example code
patch patch v2 |
||
Created attachment 3355 [details] patch You're right. This has never worked perfectly. Last commit was almost fine https://hg.libsdl.org/SDL/rev/1e1ce9f6d215 bug #3029 This patch fixes rotations 0/90/180/270 with/out flip (0, Vertical,Horizontal,Both). Patch added, thanks! https://hg.libsdl.org/SDL/rev/b19b09eb9e6d Created attachment 3381 [details] patch v2 Re-opening this issue. It fixes the test-case, but it introduces a regression with another bug (bug #4313). So here's a new patch that activate cropping of the source surface to solve the issue. It also reverts the wrong changeset. It prevents unneeded colorkey error message. marked as reopened Sam: Do we need this for 2.0.9 ? Oops, I forgot to activate you. Yep you really want this. It fixes my regression and the bug. Patch added, thanks! https://hg.libsdl.org/SDL/rev/bced4041fcc0 |
Created attachment 3255 [details] corrupt SDL_RenderCopyEx example code SDL_RenderCopyEx blits wrong image (in some cases it's bunch of alternating horizontal lines, some cases it's image from the wrong coordinate, and in some cases it's just a bunch of garbled pixels), when the following conditions are met: - Use software renderer. - Enable either horizontal or vertical flip. - source and destination rectangles must have same width and height, and must be smaller than the size of the texture. - source rectangle's X and Y coordinates must be 0. I was able to reproduce this problem on both Windows 10 and Linux 64 bit, from version 2.0.3 to latest 2.0.8. Attached an example (modified from the 2D software rendering example code). Go to line 62 and disable flip and you'll see non-corrupt image.