summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-03-25 08:04:27 +0200
committerTor Lillqvist <tml@iki.fi>2013-03-26 19:06:44 +0200
commit92b973fadcf63409026237884e81a1e3f3e62660 (patch)
tree1b5b608801f69ba2568e2ffdb416b319e3c32dd1
parent99a6a8d1bddc11097ff1bf386eb31132dbcdf311 (diff)
Use an 8bpp virtual device (instead of a 1bpp one) in sw and sc for iOS
The reason why a 1bpp virtual device is used in these two places in sc and sw is unclear to me. It causes complications on iOS as such a bitmap gets passed to CGBitmapContextCreate() which does not accept 1bpp bitmaps. But let's keep the 1bpp for other platforms. Change-Id: Ia34927cf728d4be05a31e88b7da78200d0b799ba
-rw-r--r--sc/source/core/data/documen8.cxx4
-rw-r--r--sw/source/core/doc/docnew.cxx4
-rw-r--r--vcl/inc/vcl/virdev.hxx28
-rw-r--r--vcl/source/gdi/virdev.cxx6
4 files changed, 35 insertions, 7 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index f5352356a250..9a6c0fb3ab2a 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -207,7 +207,11 @@ VirtualDevice* ScDocument::GetVirtualDevice_100th_mm()
{
if (!pVirtualDevice_100th_mm)
{
+#ifdef IOS
+ pVirtualDevice_100th_mm = new VirtualDevice( 8 );
+#else
pVirtualDevice_100th_mm = new VirtualDevice( 1 );
+#endif
pVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::REFDEV_MODE_MSO1);
MapMode aMapMode( pVirtualDevice_100th_mm->GetMapMode() );
aMapMode.SetMapUnit( MAP_100TH_MM );
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 7ffacc346c34..c978716d4f1b 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -698,7 +698,11 @@ SwDoc::~SwDoc()
VirtualDevice& SwDoc::CreateVirtualDevice_() const
{
+#ifdef IOS
+ VirtualDevice* pNewVir = new VirtualDevice( 8 );
+#else
VirtualDevice* pNewVir = new VirtualDevice( 1 );
+#endif
pNewVir->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
diff --git a/vcl/inc/vcl/virdev.hxx b/vcl/inc/vcl/virdev.hxx
index 9c8c4edc67d3..5d8a70e8f3dc 100644
--- a/vcl/inc/vcl/virdev.hxx
+++ b/vcl/inc/vcl/virdev.hxx
@@ -65,23 +65,41 @@ private:
SAL_DLLPRIVATE bool ForceZeroExtleadBug() const
{ return ((meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD) != 0); }
public:
+ /** Create a virtual device of size 1x1
+
+ @param nBitCount
+ Bit depth of the generated virtual device. Use 0 here, to
+ indicate: take default screen depth. Only 0, 1 and 8
+ are allowed here, with 1 denoting binary mask and 8 a graylevel mask.
+ */
VirtualDevice( sal_uInt16 nBitCount = 0 );
+
+ /** Create a virtual device of size 1x1
+
+ @param rCompDev
+ The generated vdev will be compatible to this device.
+
+ @param nBitCount
+ Bit depth of the generated virtual device. Use 0 here, to
+ indicate: take default screen depth. Only 0 and 1
+ are allowed here, with 1 denoting binary mask.
+ */
VirtualDevice( const OutputDevice& rCompDev,
sal_uInt16 nBitCount = 0 );
- /** Create a virtual device with alpha channel
+
+ /** Create a virtual device of size 1x1 with alpha channel
@param rCompDev
- The generated vdev will be compatible to this device. By
- default, Application::GetDefaultDevice() is used here.
+ The generated vdev will be compatible to this device.
@param nBitCount
Bit depth of the generated virtual device. Use 0 here, to
- indicate: take default screen depth. Currently, only 0 and 1
+ indicate: take default screen depth. Only 0 and 1
are allowed here, with 1 denoting binary mask.
@param nAlphaBitCount
Bit depth of the generated virtual device. Use 0 here, to
- indicate: take default screen depth. Currently, only 0 and 1
+ indicate: take default screen depth. Only 0 and 1
are allowed here, with 1 denoting binary mask.
*/
VirtualDevice( const OutputDevice& rCompDev,
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index 87a74878f439..35595507ea9c 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -39,6 +39,8 @@ using namespace ::com::sun::star::uno;
void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
{
+ SAL_INFO( "vcl.virdev", "ImplInitVirDev(" << nDX << "," << nDY << "," << nBitCount << ")" );
+
if ( nDX < 1 )
nDX = 1;
@@ -126,8 +128,8 @@ VirtualDevice::VirtualDevice( sal_uInt16 nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
- SAL_WARN_IF( nBitCount > 1, "vcl.gdi",
- "VirtualDevice::VirtualDevice(): Only 0 or 1 is for BitCount allowed" );
+ SAL_WARN_IF( (nBitCount > 1 && nBitCount != 8), "vcl.gdi",
+ "VirtualDevice::VirtualDevice(): Only 0, 1 or 8 allowed for BitCount" );
SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << " )" );
ImplInitVirDev( Application::GetDefaultDevice(), 1, 1, nBitCount );