Commit Graph

10 Commits

Author SHA1 Message Date
Sylvain Becker
b458d7a28f Readability: remove redundant cast to the same type 2019-10-30 15:13:55 +01:00
Sam Lantinga
5e13087b0f Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Sam Lantinga
e3cc5b2c6b Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
74ca16547c Fixed bug 3699 - Shaped windows are distorted unless width is divisible by 8
Bogomancer

On X11, windows created using the shaped window API appear distorted unless the width of the shape surface is divisible by 8.

Steps to reproduce:

    1) Use your favorite image editor to resize one of the images in test/shapes/ to a width that's not a multiple of 8.
    2) Compile and run test/testshape.c on the image you edited.
    3) The shaped window will appear twisted and distorted.

It appears the bug was not caught sooner because all the test images are either 640 or 256 pixels wide.

I tracked down the bug to SDL_CalculateShapeBitmap() in SDL_shape.c. The shape surface is reduced to a 1-bit-per-pixel mask, but the original code doesn't take into account that X11 apparently wants each scanline to begin on a new byte.
2017-07-11 08:16:00 -07:00
Philipp Wiesemann
00394996eb Fixed crash if calling SDL_CreateShapedWindow() on unsupported platforms. 2017-06-02 22:15:12 +02:00
Ryan C. Gordon
d526b8a1e9 Some patches to make SDL compile with armcc (ARM's C compiler). 2017-03-02 13:33:04 -05:00
Sam Lantinga
45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Ryan C. Gordon
e93e91f0b5 Pacify some GCC strict-aliasing compiler warnings. 2016-11-23 21:52:48 -05:00
Sam Lantinga
42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann
0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00