Should fix drawing on systems with alpha mask.

svn-id: r22773
This commit is contained in:
Johannes Schickel 2006-05-30 16:48:15 +00:00
parent 0612e74116
commit 94272b6ba8

View File

@ -1638,6 +1638,7 @@ inline OverlayColor getColorAlphaImpl(OverlayColor col1, OverlayColor col2, int
output |= ((alpha * ((col1 & T::kRedMask) - (col2 & T::kRedMask)) >> 8) + (col2 & T::kRedMask)) & T::kRedMask;
output |= ((alpha * ((col1 & T::kGreenMask) - (col2 & T::kGreenMask)) >> 8) + (col2 & T::kGreenMask)) & T::kGreenMask;
output |= ((alpha * ((col1 & T::kBlueMask) - (col2 & T::kBlueMask)) >> 8) + (col2 & T::kBlueMask)) & T::kBlueMask;
output |= ~(T::kRedMask | T::kGreenMask | T::kBlueMask);
return output;
}
@ -1648,6 +1649,7 @@ inline OverlayColor getColorAlphaImp2(OverlayColor col1, OverlayColor col2, int
output |= ((alpha * ((~col1 & T::kRedMask) - (col2 & T::kRedMask)) >> 8) + (col2 & T::kRedMask)) & T::kRedMask;
output |= ((alpha * ((~col1 & T::kGreenMask) - (col2 & T::kGreenMask)) >> 8) + (col2 & T::kGreenMask)) & T::kGreenMask;
output |= ((alpha * ((~col1 & T::kBlueMask) - (col2 & T::kBlueMask)) >> 8) + (col2 & T::kBlueMask)) & T::kBlueMask;
output |= ~(T::kRedMask | T::kGreenMask | T::kBlueMask);
return output;
}
@ -1673,6 +1675,7 @@ inline OverlayColor calcGradient(OverlayColor start, OverlayColor end, int pos)
output |= (start + ((((end & T::kRedMask) - (start & T::kRedMask))) * pos >> 12)) & T::kRedMask;
output |= (start + ((((end & T::kGreenMask) - (start & T::kGreenMask))) * pos >> 12)) & T::kGreenMask;
output |= (start + ((((end & T::kBlueMask) - (start & T::kBlueMask))) * pos >> 12)) & T::kBlueMask;
output |= ~(T::kRedMask | T::kGreenMask | T::kBlueMask);
return output;
}