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 2708 - SDL_SetWindowShape can produce strange results
Summary: SDL_SetWindowShape can produce strange results
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.3
Hardware: All Windows 7
: P2 major
Assignee: Jørgen Tjernø
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-28 00:31 UTC by Jørgen Tjernø
Modified: 2015-05-26 16:17 UTC (History)
2 users (show)

See Also:


Attachments
Window shape bitmap (11.02 KB, image/bmp)
2014-08-28 00:31 UTC, Jørgen Tjernø
Details
Shaped window screenshot (721 bytes, image/png)
2014-08-28 00:33 UTC, Jørgen Tjernø
Details
Image causing SDL_SetWindowShape to render the Window shape incorectly (378.88 KB, image/bmp)
2015-04-28 23:18 UTC, Michel Courtine
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jørgen Tjernø 2014-08-28 00:31:22 UTC
Created attachment 1854 [details]
Window shape bitmap

Some SDL_Surfaces passed to SDL_SetWindowShape will produce strange results. Tested on Windows 7.

The attached window_shape.bmp can be passed to test_shape, and will produce strange artifacts.
Comment 1 Jørgen Tjernø 2014-08-28 00:33:27 UTC
Created attachment 1855 [details]
Shaped window screenshot

Attached is a screenshot of test_shape.exe on the previously attached window_shape.bmp, running on a white background. Artifacts are obviously visible.
Comment 2 Jørgen Tjernø 2014-08-28 18:40:06 UTC
I have a fix for this locally, I'll push it on Monday or Tuesday. The shape tree building code only works properly on power-of-two images, on other images it skips some pixels. On Windows, this turns into blank spaces, since the Windows shaping code builds up a region of all the opaque spaces.
Comment 3 Jørgen Tjernø 2014-09-02 21:16:15 UTC
Should be fixed in https://hg.libsdl.org/SDL/rev/cd6696d55781
Comment 4 Michel Courtine 2015-04-28 23:18:49 UTC
Created attachment 2139 [details]
Image causing SDL_SetWindowShape to render the Window shape incorectly
Comment 5 Michel Courtine 2015-04-28 23:22:33 UTC
This bug is not fixed for me. I just attached a bmp that renders the window shape very strangely. Skipping some pixels again. If I resize it to a power of 2 resolution, the shape is rendered correctly.
Comment 6 Michel Courtine 2015-04-28 23:30:36 UTC
I was using the prebuilt .lib & .dll from the download page (https://www.libsdl.org/download-2.0.php).
Tried rebuilding SDL from source and the issue is indeed fixed but the binaries distribution would probably need to be refreshed.
Comment 7 Jørgen Tjernø 2015-05-04 23:19:20 UTC
This is fixed, it is just that the last release (2.0.3) came out on 2014-03-15. 2.0.4 will contains this fix.
Comment 8 Ryan C. Gordon 2015-05-26 16:17:21 UTC
(In reply to Jørgen Tjernø from comment #7)
> This is fixed, it is just that the last release (2.0.3) came out on
> 2014-03-15. 2.0.4 will contains this fix.

(and we're working on wrapping up 2.0.4 right now.)

--ryan.