summaryrefslogtreecommitdiff
path: root/vcl/headless
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-12-09 21:53:23 +0200
committerTor Lillqvist <tml@collabora.com>2013-12-14 01:42:02 +0200
commit6265876ae9f1bb862440182d2d2c9b9b5b322668 (patch)
treecb64f9a87dd4a98556c2708be0ff8dbfd152ce58 /vcl/headless
parentf279acd3678d014d9d5dafe41971e0da4dec7b6c (diff)
iOS tiled rendering work
Possibly quite broken intermediate commit. But anyway, now it is possible to render the tile diretly to a CGContext. Can be seen in the MobileLibreOffice app when build in the Debug_tile_tester configuration. See touch_lo_draw_tile() in viewsh.cxx. Unfortunately the old plain LibreOffice test app is now broken, though, and displays nothing at all. This refactoring and hacking in vcl was done in a quite ugly fashion, with ifdefs etc. But trust me, I did try, several times, for many days, to get where I wanted in an elegant and clean fashion. But doing it cleanly meant not being able to actually build it for days while trying to figure ut which bits go where and which class should be split into what base and derived class(es), and it was too much for my limited brain capacity. I just couldn't juggle all the vcl class structure in my head, especially as I don't have any good understanding of the general design of it all. Change-Id: Ia59d6a9cce15a63e63f94e8d8574bef21993fb1f
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/svpgdi.cxx8
-rw-r--r--vcl/headless/svpinst.cxx28
2 files changed, 34 insertions, 2 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 2a1035fab25a..0917f9e9826b 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -286,6 +286,10 @@ bool SvpSalGraphics::isClippedSetup( const basegfx::B2IBox &aRange, SvpSalGraphi
// bitmapdevice instead.
bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
{
+#ifdef IOS
+ if (mbForeignContext)
+ return true;
+#endif
m_aClipRegion = i_rClip;
m_aClipMap.reset();
if( i_rClip.IsEmpty() )
@@ -314,6 +318,8 @@ bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
return true;
}
+#ifndef IOS
+
void SvpSalGraphics::SetLineColor()
{
m_bUseLineColor = false;
@@ -677,6 +683,8 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh
return pBitmap;
}
+#endif
+
SalColor SvpSalGraphics::getPixel( long nX, long nY )
{
basebmp::Color aColor( m_aOrigDevice->getPixel( basegfx::B2IPoint( nX, nY ) ) );
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 340f4f4601a1..7a43eb1f326c 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -30,6 +30,12 @@
#include "headless/svpframe.hxx"
#include "headless/svpdummies.hxx"
#include "headless/svpvd.hxx"
+#ifdef IOS
+#include "headless/svpgdi.hxx"
+#include "quartz/salbmp.h"
+#include "quartz/salgdi.h"
+#include "quartz/salvd.h"
+#endif
#include "headless/svpbmp.hxx"
#include <salframe.hxx>
@@ -211,13 +217,27 @@ void SvpSalInstance::DestroyObject( SalObject* pObject )
delete pObject;
}
-SalVirtualDevice* SvpSalInstance::CreateVirtualDevice( SalGraphics*,
+SalVirtualDevice* SvpSalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- sal_uInt16 nBitCount, const SystemGraphicsData* )
+ sal_uInt16 nBitCount,
+ const SystemGraphicsData* pData )
{
+#ifdef IOS
+ if( pData )
+ return new AquaSalVirtualDevice( static_cast< AquaSalGraphics* >( pGraphics ), nDX, nDY, nBitCount, pData );
+ else
+ {
+ SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice( nBitCount );
+ pNew->SetSize( nDX, nDY );
+ return pNew;
+ }
+#else
+ (void) pGraphics;
+ (void) pData;
SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice( nBitCount );
pNew->SetSize( nDX, nDY );
return pNew;
+#endif
}
void SvpSalInstance::DestroyVirtualDevice( SalVirtualDevice* pDevice )
@@ -242,7 +262,11 @@ SalSystem* SvpSalInstance::CreateSalSystem()
SalBitmap* SvpSalInstance::CreateSalBitmap()
{
+#ifdef IOS
+ return new QuartzSalBitmap();
+#else
return new SvpSalBitmap();
+#endif
}
void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )