diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-06-11 13:39:56 +0100 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-06-25 13:04:30 +0100 |
commit | cd1f3480a6ebff075f243bde5891a3e8f3c9533c (patch) | |
tree | e2724c4adf77abfa12c5cfc78544ef71114878cb /vcl | |
parent | Add base value to set alpha channel for 32 bit colourspaces. (diff) | |
download | core-cd1f3480a6ebff075f243bde5891a3e8f3c9533c.tar.gz core-cd1f3480a6ebff075f243bde5891a3e8f3c9533c.zip |
Fill the alpha channel by default for vcl 32-bit bitmaps too.
Otherwise the alpha channel for bitmaps created directly is empty,
indicating a transparent bitmap (although we don't actually handle
transparency). This complements hardcoding of the alpha channel
in basebmp. VCL bitmaps can be copied bit-for-bit directly into
a basebmp bitmap, hence it's important to make sure we fill the
alpha channel in vcl too.
Conflicts:
include/vcl/salbtype.hxx
Change-Id: Icb2fa417db6625a6ffa6bd82eb5773ff75be5a3c
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/svpbmp.cxx | 16 | ||||
-rw-r--r-- | vcl/source/gdi/bmpacc2.cxx | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index 0a81fdc94b90..3920aea25f2d 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -188,36 +188,36 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool ) nBitCount = 32; pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK; #ifdef OSL_BIGENDIAN - pBuf->maColorMask = ColorMask( 0x0000ff00, 0x00ff0000, 0xff000000 ); + pBuf->maColorMask = ColorMask( 0x0000ff00, 0x00ff0000, 0xff000000, 0x000000ff ); #else - pBuf->maColorMask = ColorMask( 0x00ff0000, 0x0000ff00, 0x000000ff ); + pBuf->maColorMask = ColorMask( 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 ); #endif break; case FORMAT_THIRTYTWO_BIT_TC_MASK_ARGB: nBitCount = 32; pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK; #ifdef OSL_BIGENDIAN - pBuf->maColorMask = ColorMask( 0x00ff0000, 0x0000ff00, 0x000000ff ); + pBuf->maColorMask = ColorMask( 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 ); #else - pBuf->maColorMask = ColorMask( 0x0000ff00, 0x00ff0000, 0xff000000 ); + pBuf->maColorMask = ColorMask( 0x0000ff00, 0x00ff0000, 0xff000000, 0x000000ff ); #endif break; case FORMAT_THIRTYTWO_BIT_TC_MASK_ABGR: nBitCount = 32; pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK; #ifdef OSL_BIGENDIAN - pBuf->maColorMask = ColorMask( 0x000000ff, 0x0000ff00, 0x00ff0000 ); + pBuf->maColorMask = ColorMask( 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 ); #else - pBuf->maColorMask = ColorMask( 0xff000000, 0x00ff0000, 0x0000ff00 ); + pBuf->maColorMask = ColorMask( 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff ); #endif break; case FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA: nBitCount = 32; pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK; #ifdef OSL_BIGENDIAN - pBuf->maColorMask = ColorMask( 0xff000000, 0x00ff0000, 0x0000ff00 ); + pBuf->maColorMask = ColorMask( 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff ); #else - pBuf->maColorMask = ColorMask( 0x000000ff, 0x0000ff00, 0x00ff0000 ); + pBuf->maColorMask = ColorMask( 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 ); #endif break; diff --git a/vcl/source/gdi/bmpacc2.cxx b/vcl/source/gdi/bmpacc2.cxx index bf1d54037b6b..12b0c1d1d617 100644 --- a/vcl/source/gdi/bmpacc2.cxx +++ b/vcl/source/gdi/bmpacc2.cxx @@ -179,7 +179,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _32BIT_TC_ABGR ) IMPL_FORMAT_SETPIXEL_NOMASK( _32BIT_TC_ABGR ) { - *( pScanline = pScanline + ( nX << 2 ) )++ = 0; + *( pScanline = pScanline + ( nX << 2 ) )++ = 0xFF; *pScanline++ = rBitmapColor.GetBlue(); *pScanline++ = rBitmapColor.GetGreen(); *pScanline = rBitmapColor.GetRed(); @@ -198,7 +198,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _32BIT_TC_ARGB ) IMPL_FORMAT_SETPIXEL_NOMASK( _32BIT_TC_ARGB ) { - *( pScanline = pScanline + ( nX << 2 ) )++ = 0; + *( pScanline = pScanline + ( nX << 2 ) )++ = 0xFF; *pScanline++ = rBitmapColor.GetRed(); *pScanline++ = rBitmapColor.GetGreen(); *pScanline = rBitmapColor.GetBlue(); @@ -220,7 +220,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _32BIT_TC_BGRA ) *( pScanline = pScanline + ( nX << 2 ) )++ = rBitmapColor.GetBlue(); *pScanline++ = rBitmapColor.GetGreen(); *pScanline++ = rBitmapColor.GetRed(); - *pScanline = 0; + *pScanline = 0xFF; } IMPL_FORMAT_GETPIXEL_NOMASK( _32BIT_TC_RGBA ) @@ -239,7 +239,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _32BIT_TC_RGBA ) *( pScanline = pScanline + ( nX << 2 ) )++ = rBitmapColor.GetRed(); *pScanline++ = rBitmapColor.GetGreen(); *pScanline++ = rBitmapColor.GetBlue(); - *pScanline = 0; + *pScanline = 0xFF; } IMPL_FORMAT_GETPIXEL( _32BIT_TC_MASK ) |