Blame SOURCES/0251-android-don-t-use-alpha-VDev-when-painting-tiles-on-.patch

f325b2
From 8e257245396ec0f9edde494904a1c7d9835535bd Mon Sep 17 00:00:00 2001
f325b2
From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= <tomaz.vajngerl@collabora.com>
f325b2
Date: Sat, 31 Oct 2015 13:59:46 +0100
f325b2
Subject: [PATCH 251/398] android: don't use alpha VDev when painting tiles on
f325b2
 Android
f325b2
f325b2
Improves tile rendering speed.
f325b2
f325b2
Change-Id: I6a4b87fbc1d9ed284f5c4a781d769eeacd9bc2ca
f325b2
(cherry picked from commit e0d68da3ff3ae81e35f4e7393fb998a41886831d)
f325b2
---
f325b2
 desktop/source/lib/init.cxx | 34 ++++++++++++++++++++++++----------
f325b2
 1 file changed, 24 insertions(+), 10 deletions(-)
f325b2
f325b2
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
f325b2
index 6785ae2328d4..98747ea62e3a 100644
f325b2
--- a/desktop/source/lib/init.cxx
f325b2
+++ b/desktop/source/lib/init.cxx
f325b2
@@ -773,7 +773,30 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
f325b2
 
f325b2
 #if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS)
f325b2
 
f325b2
-#ifndef IOS
f325b2
+#if defined(IOS)
f325b2
+    SystemGraphicsData aData;
f325b2
+    aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer);
f325b2
+    // the Size argument is irrelevant, I hope
f325b2
+    ScopedVclPtrInstance<VirtualDevice> pDevice(&aData, Size(1, 1), (sal_uInt16)0);
f325b2
+
f325b2
+    pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
f325b2
+                    nTilePosX, nTilePosY, nTileWidth, nTileHeight);
f325b2
+#elif defined(ANDROID)
f325b2
+    InitSvpForLibreOfficeKit();
f325b2
+
f325b2
+    ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), (sal_uInt16)32) ;
f325b2
+
f325b2
+    boost::shared_array<sal_uInt8> aBuffer(pBuffer, NoDelete< sal_uInt8 >());
f325b2
+
f325b2
+    boost::shared_array<sal_uInt8> aAlphaBuffer;
f325b2
+
f325b2
+    pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
f325b2
+                Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
f325b2
+                aBuffer, aAlphaBuffer, true);
f325b2
+
f325b2
+    pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
f325b2
+                    nTilePosX, nTilePosY, nTileWidth, nTileHeight);
f325b2
+#else
f325b2
     InitSvpForLibreOfficeKit();
f325b2
 
f325b2
     ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), (sal_uInt16)32) ;
f325b2
@@ -806,15 +829,6 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
f325b2
             pBuffer[nOffset * 4 +3] = 0xff - aAlpha[nOffset];
f325b2
         }
f325b2
     }
f325b2
-
f325b2
-#else
f325b2
-    SystemGraphicsData aData;
f325b2
-    aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer);
f325b2
-    // the Size argument is irrelevant, I hope
f325b2
-    ScopedVclPtrInstance<VirtualDevice> pDevice(&aData, Size(1, 1), (sal_uInt16)0);
f325b2
-
f325b2
-    pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
f325b2
-                    nTilePosX, nTilePosY, nTileWidth, nTileHeight);
f325b2
 #endif
f325b2
 
f325b2
     static bool bDebug = getenv("LOK_DEBUG") != 0;
f325b2
-- 
f325b2
2.12.0
f325b2