summaryrefslogtreecommitdiff
path: root/vcl/headless/svpbmp.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-06-07 21:43:36 +0300
committerTor Lillqvist <tlillqvist@suse.com>2012-06-07 21:54:19 +0300
commit323f137631da53d4fbb057c1a3847c6b8aa69ab2 (patch)
treed7118338063a7fb56b40676d6d6a51eaf3b2cc48 /vcl/headless/svpbmp.cxx
parentfd3c83d5f2414b2bba7b941609b59452a6d5b1e8 (diff)
Use the new THIRTYTWO_BIT_TC_MASK_RGBA format for Android and iOS
Change-Id: I7cc8c5943454edea7fdef50b125d0baa95fc3f8b
Diffstat (limited to 'vcl/headless/svpbmp.cxx')
-rw-r--r--vcl/headless/svpbmp.cxx38
1 files changed, 34 insertions, 4 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index f1d8d49f6c66..da56217c61d8 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -59,8 +59,11 @@ bool SvpSalBitmap::Create( const Size& rSize,
case 16: nFormat = Format::SIXTEEN_BIT_LSB_TC_MASK; break;
#endif
case 24: nFormat = Format::TWENTYFOUR_BIT_TC_MASK; break;
- // FIXME: Should this for Android be THIRTYTWO_BIT_TC_MASK_ARGB?
+#if defined(ANDROID) || defined(IOS)
+ case 32: nFormat = Format::THIRTYTWO_BIT_TC_MASK_RGBA; break;
+#else
case 32: nFormat = Format::THIRTYTWO_BIT_TC_MASK; break;
+#endif
}
B2IVector aSize( rSize.Width(), rSize.Height() );
if( aSize.getX() == 0 )
@@ -199,13 +202,40 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool )
nBitCount = 24;
pBuf->mnFormat = BMP_FORMAT_24BIT_TC_BGR;
break;
- case Format::THIRTYTWO_BIT_TC_MASK:
+ case Format::THIRTYTWO_BIT_TC_MASK_BGRA:
+ nBitCount = 32;
+ pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK;
+#ifdef OSL_BIGENDIAN
+ pBuf->maColorMask = ColorMask( 0x0000ff00, 0x00ff0000, 0xff000000 );
+#else
+ pBuf->maColorMask = ColorMask( 0x00ff0000, 0x0000ff00, 0x000000ff );
+#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 );
+#else
+ pBuf->maColorMask = ColorMask( 0x0000ff00, 0x00ff0000, 0xff000000 );
+#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 );
+#else
+ pBuf->maColorMask = ColorMask( 0xff000000, 0x00ff0000, 0x0000ff00 );
+#endif
+ break;
+ case Format::THIRTYTWO_BIT_TC_MASK_RGBA:
nBitCount = 32;
pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK;
#ifdef OSL_BIGENDIAN
- pBuf->maColorMask = ColorMask( 0x0000ff, 0x00ff00, 0xff0000 );
+ pBuf->maColorMask = ColorMask( 0xff000000, 0x00ff0000, 0x0000ff00 );
#else
- pBuf->maColorMask = ColorMask( 0xff0000, 0x00ff00, 0x0000ff );
+ pBuf->maColorMask = ColorMask( 0x000000ff, 0x0000ff00, 0x00ff0000 );
#endif
break;