Commit 937f7056 authored by Cyril Deguet's avatar Cyril Deguet

* ft2_bitmap.cpp: committed my changes again (yes x11 skins were broken!)

* win32_graphics.cpp: so it should work on win32 too, now...
parent 62171bcd
......@@ -60,9 +60,9 @@ void FT2Bitmap::draw( const FT_Bitmap &rBitmap, int left, int top,
{
// The buffer in FT_Bitmap contains alpha values
uint8_t val = *(pBuf++);
*(pData++) = blue;
*(pData++) = green;
*(pData++) = red;
*(pData++) = (blue * val) >> 8;
*(pData++) = (green * val) >> 8;
*(pData++) = (red * val) >> 8;
*(pData++) = val;
}
}
......
......@@ -136,12 +136,8 @@ void Win32Graphics::drawBitmap( const GenericBitmap &rBitmap,
uint8_t a = *(pBmpData++);
// Draw the pixel
// Note: the colours are multiplied by a/255, because of the
// algorithm used by Windows for the AlphaBlending
((UINT32 *)pBits)[x + y * width] =
(a << 24) | (((r * a) >> 8) << 16) |
(((g * a) >> 8) << 8) |
((b * a) >> 8);
(a << 24) | (r << 16) | (g << 8) | b;
if( a > 0 )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment