Simple Directmedia Layer
Go to file
Sam Lantinga 89bc80f1ae Fixed alpha blending for the MMX blit functions
I see the Remarks of function SDL_BlitSurface shows that "when SDL_BLENDMODE_BLEND, we have dstA = srcA + (dstA * (1-srcA))". however, I tested some pictures but the result implies "dstA=arcA" actually. I stepped into the source code, and found after I set SDL_BLENDMODE_BLEND for the source surface, the final blit function is BlitRGBtoRGBPixelAlphaMMX when I use SDL_BlitSurface on my computer. And I found these codes:

    else if (alpha == amask) {
    /* opaque alpha -- copy RGB, keep dst alpha */
    *dstp = (*srcp & chanmask) | (*dstp & ~chanmask);

The same code is used in BlitRGBtoRGBPixelAlphaMMX3DNOW and BlitRGBtoRGBPixelAlpha. So I think they still keep dst alpha.

Best regards,
Jianyu Guan
2013-08-16 06:59:19 -07:00
acinclude Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
android-project Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
build-scripts Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
cmake Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
debian Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
include Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
src Fixed alpha blending for the MMX blit functions 2013-08-16 06:59:19 -07:00
test Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency 2013-08-14 23:30:10 -07:00
VisualC Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency 2013-08-14 23:30:10 -07:00
Xcode Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
Xcode-iOS Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
.hgignore Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
Android.mk Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
autogen.sh Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
BUGS.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
CMakeLists.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
configure Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
configure.in Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
COPYING.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
CREDITS.txt Added Julian Winter to the credits for the SDL 2.0 website. 2013-08-12 08:45:37 -07:00
INSTALL.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
Makefile.in Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
Makefile.minimal Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
Makefile.pandora Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
Makefile.psp Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
Makefile.wiz Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-android.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-cmake.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-directfb.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-gesture.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-hg.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-ios.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-macosx.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-pandora.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-platforms.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-porting.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-psp.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-SDL.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-touch.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README-wince.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
README.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
sdl2-config.in Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
sdl2.m4 Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
sdl2.pc.in Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
SDL2.spec.in Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
TODO.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
VisualC.html Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00
WhatsNew.txt Fixes #2022, do not resume on Android when surfaceChanged 2013-08-12 11:13:50 -03:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
http://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
Support for other platforms may be found in the source code.

SDL is written in C, works natively with C++, and there are bindings 
available for several other languages, including C# and Python.

This library is distributed under the zlib license, which can be found
in the file "COPYING.txt".

The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation and FAQs are available online at:
	http://wiki.libsdl.org/

If you need help with the library, or just want to discuss SDL related
issues, you can join the developers mailing list:
	http://www.libsdl.org/mailing-list.php

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)