summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-10-31 13:59:46 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-11-01 22:59:04 +0100
commite0d68da3ff3ae81e35f4e7393fb998a41886831d (patch)
treef39404e9b7757b18638fa58b35c492d9a04aefad /desktop
parent50ffbe8557dbecda187cd6d9c93c2fdf916a6f75 (diff)
android: don't use alpha VDev when painting tiles on Android
Improves tile rendering speed. Change-Id: I6a4b87fbc1d9ed284f5c4a781d769eeacd9bc2ca
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx34
1 files changed, 24 insertions, 10 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d9a3fdd42425..9999acd93fb1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -774,7 +774,30 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
#if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS)
-#ifndef IOS
+#if defined(IOS)
+ SystemGraphicsData aData;
+ aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer);
+ // the Size argument is irrelevant, I hope
+ ScopedVclPtrInstance<VirtualDevice> pDevice(&aData, Size(1, 1), (sal_uInt16)0);
+
+ pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
+ nTilePosX, nTilePosY, nTileWidth, nTileHeight);
+#elif defined(ANDROID)
+ InitSvpForLibreOfficeKit();
+
+ ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), (sal_uInt16)32) ;
+
+ boost::shared_array<sal_uInt8> aBuffer(pBuffer, NoDelete< sal_uInt8 >());
+
+ boost::shared_array<sal_uInt8> aAlphaBuffer;
+
+ pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
+ Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
+ aBuffer, aAlphaBuffer, true);
+
+ pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
+ nTilePosX, nTilePosY, nTileWidth, nTileHeight);
+#else
InitSvpForLibreOfficeKit();
ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), (sal_uInt16)32) ;
@@ -807,15 +830,6 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
pBuffer[nOffset * 4 +3] = 0xff - aAlpha[nOffset];
}
}
-
-#else
- SystemGraphicsData aData;
- aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer);
- // the Size argument is irrelevant, I hope
- ScopedVclPtrInstance<VirtualDevice> pDevice(&aData, Size(1, 1), (sal_uInt16)0);
-
- pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
- nTilePosX, nTilePosY, nTileWidth, nTileHeight);
#endif
static bool bDebug = getenv("LOK_DEBUG") != 0;