]> git.sesse.net Git - vlc/commitdiff
* ft2_bitmap.cpp: committed my changes again (yes x11 skins were broken!)
authorCyril Deguet <asmax@videolan.org>
Sat, 14 May 2005 23:50:13 +0000 (23:50 +0000)
committerCyril Deguet <asmax@videolan.org>
Sat, 14 May 2005 23:50:13 +0000 (23:50 +0000)
* win32_graphics.cpp: so it should work on win32 too, now...

modules/gui/skins2/src/ft2_bitmap.cpp
modules/gui/skins2/win32/win32_graphics.cpp

index ebd7e5466490c4b240789e64222edb9b2f5b110a..c2de698b29b80716d41af663309babc4d856022b 100644 (file)
@@ -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;
         }
     }
index 43fbe2d4018a4f28a4f7dac3d35c04b772b7fa2b..a66bee55a26a98edb85a98770fbf6fd21a265846 100644 (file)
@@ -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 )
             {