Take the source alpha into account when doing a B_OP_INVERT so that drawing

bitmaps in B_OP_INVERT mode does not affect pixels where the source bitmap
was transparent, as noted in the BeBook. Not really sure I'm doing that right
though and probably needs looking into for B_OP_ERASE and B_OP_SELECT too.
Fixes bug #2421 though.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26067 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2008-06-21 19:38:56 +00:00
parent 50450a0053
commit efec339946
@@ -133,7 +133,7 @@ blend_color_hspan_invert(int x, int y, unsigned len,
if (covers) {
// non-solid opacity
do {
if (*covers) {
if (*covers && colors->a > 0) {
if (*covers == 255) {
ASSIGN_INVERT(p);
} else {
@@ -142,22 +142,23 @@ blend_color_hspan_invert(int x, int y, unsigned len,
}
covers++;
p += 4;
// ++colors;
++colors;
} while(--len);
} else {
// solid full opcacity
if (cover == 255) {
do {
ASSIGN_INVERT(p);
if (colors->a > 0) {
ASSIGN_INVERT(p);
}
p += 4;
// ++colors;
++colors;
} while(--len);
// solid partial opacity
} else if (cover) {
do {
BLEND_INVERT(p, cover);
p += 4;
// ++colors;
} while(--len);
}
}