summaryrefslogtreecommitdiff
path: root/vcl/headless
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
parentfd3c83d5f2414b2bba7b941609b59452a6d5b1e8 (diff)
Use the new THIRTYTWO_BIT_TC_MASK_RGBA format for Android and iOS
Change-Id: I7cc8c5943454edea7fdef50b125d0baa95fc3f8b
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/svpbmp.cxx38
-rw-r--r--vcl/headless/svpelement.cxx5
-rw-r--r--vcl/headless/svpgdi.cxx5
-rw-r--r--vcl/headless/svpvd.cxx2
4 files changed, 43 insertions, 7 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;
diff --git a/vcl/headless/svpelement.cxx b/vcl/headless/svpelement.cxx
index 80a47fec5f2f..0a623c637782 100644
--- a/vcl/headless/svpelement.cxx
+++ b/vcl/headless/svpelement.cxx
@@ -279,7 +279,10 @@ sal_uInt32 SvpElement::getBitCountFromScanlineFormat( sal_Int32 nFormat )
case Format::TWENTYFOUR_BIT_TC_MASK:
nBitCount = 24;
break;
- case Format::THIRTYTWO_BIT_TC_MASK:
+ case Format::THIRTYTWO_BIT_TC_MASK_BGRA:
+ case Format::THIRTYTWO_BIT_TC_MASK_ARGB:
+ case Format::THIRTYTWO_BIT_TC_MASK_ABGR:
+ case Format::THIRTYTWO_BIT_TC_MASK_RGBA:
nBitCount = 32;
break;
default:
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 1d07a2fbeee3..cb88e7ef95c6 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -116,7 +116,10 @@ void SvpSalGraphics::setDevice( basebmp::BitmapDeviceSharedPtr& rDevice )
case basebmp::Format::SIXTEEN_BIT_LSB_TC_MASK:
case basebmp::Format::SIXTEEN_BIT_MSB_TC_MASK:
case basebmp::Format::TWENTYFOUR_BIT_TC_MASK:
- case basebmp::Format::THIRTYTWO_BIT_TC_MASK:
+ case basebmp::Format::THIRTYTWO_BIT_TC_MASK_BGRA:
+ case basebmp::Format::THIRTYTWO_BIT_TC_MASK_ARGB:
+ case basebmp::Format::THIRTYTWO_BIT_TC_MASK_ABGR:
+ case basebmp::Format::THIRTYTWO_BIT_TC_MASK_RGBA:
m_eTextFmt = basebmp::Format::EIGHT_BIT_GREY;
break;
default:
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx
index 285eeafc9b15..fb752e6f0f57 100644
--- a/vcl/headless/svpvd.cxx
+++ b/vcl/headless/svpvd.cxx
@@ -83,7 +83,7 @@ sal_Bool SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
case 24: nFormat = Format::TWENTYFOUR_BIT_TC_MASK; break;
case 32: nFormat = Format::THIRTYTWO_BIT_TC_MASK; break;
#if defined(ANDROID) || defined(IOS)
- case 0: nFormat = Format::THIRTYTWO_BIT_TC_MASK; break;
+ case 0: nFormat = Format::THIRTYTWO_BIT_TC_MASK_RGBA; break;
#else
case 0: nFormat = Format::TWENTYFOUR_BIT_TC_MASK; break;
#endif