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 1346 - SDL_DisplayFormatAlpha uses incorrect format in windowed mode
Summary: SDL_DisplayFormatAlpha uses incorrect format in windowed mode
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: x86 Mac OS X (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-19 20:43 UTC by alarantalara
Modified: 2011-12-29 01:58 UTC (History)
1 user (show)

See Also:


Attachments
patch correcting problem (416 bytes, application/octet-stream)
2011-12-19 20:43 UTC, alarantalara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alarantalara 2011-12-19 20:43:13 UTC
Created attachment 738 [details]
patch correcting problem

On little endian systems using the Quartz code, an unusual set of RBGA masks is used when using the windowed video mode.
This set is not taken into account in SDL_DisplayFormatAlpha and so it converts the supplied surface to a format that does not match the video surface, preventing fast blitting.

This was observed in recent builds of Battle for Wesnoth when SDL was updated to cover the problem when switching to full screen in Lion (https://gna.org/bugs/?18319).

You can observe the performance issue if you download Wesnoth 1.9.13 for OS X at
http://sourceforge.net/projects/wesnoth/files/wesnoth/wesnoth-1.9.13/Wesnoth_1.9.13.dmg/download
and replace the included SDL library with any build of SDL 1.2.14 or later. (I have already patched the included version, so the problem is not observable without replacement.)

A patch resolving the issue is attached.
Comment 1 Sam Lantinga 2011-12-29 01:58:09 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/2280c0954104