Updated blend semantics so blending uses the following formula:

dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
    dstA = srcA + (dstA * (1-srcA))
This allows proper compositing semantics without requiring premultiplied alpha.

Needs full unit test coverage and bug fixes!
This commit is contained in:
Sam Lantinga 2013-07-23 08:06:49 -07:00
parent a99edf3519
commit 32188834b5
17 changed files with 362 additions and 1001 deletions

View file

@ -82,7 +82,7 @@ sub open_file {
/* DO NOT EDIT! This file is generated by sdlgenblit.pl */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2013 Sam Lantinga <slouken\@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -241,6 +241,7 @@ __EOF__
${d}R = ${s}R + ((255 - ${s}A) * ${d}R) / 255;
${d}G = ${s}G + ((255 - ${s}A) * ${d}G) / 255;
${d}B = ${s}B + ((255 - ${s}A) * ${d}B) / 255;
${d}A = ${s}A + ((255 - ${s}A) * ${d}A) / 255;
break;
case SDL_COPY_ADD:
${d}R = ${s}R + ${d}R; if (${d}R > 255) ${d}R = 255;