[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - desktop/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Nov 5 12:20:12 UTC 2018
desktop/source/lib/init.cxx | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
New commits:
commit 1100b05c15591d2c47e092835c354b6edd5a9598
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Sat Nov 3 01:44:16 2018 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Nov 5 13:19:30 2018 +0100
Create a CG bitmap context in doc_paintWindow(), too, for iOS
Just like in doc_paintTile().
Now at least some of the dialogs work in the iOS app, yay.
Change-Id: I10c7eeb1f121ba68a1af723d45575890b1d598da
Reviewed-on: https://gerrit.libreoffice.org/62871
Reviewed-by: Tor Lillqvist <tml at collabora.com>
Tested-by: Tor Lillqvist <tml at collabora.com>
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8c540eff4923..376caead288d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2138,6 +2138,9 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
#ifdef IOS
+// This function is separate only to be used by LibreOfficeLight. If that app can be retired, this
+// function's code can be inlined into the iOS part of doc_paintTile().
+
static void doc_paintTileToCGContext(LibreOfficeKitDocument* pThis,
void* rCGContext,
const int nCanvasWidth, const int nCanvasHeight,
@@ -3553,6 +3556,33 @@ static void doc_paintWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWind
return;
}
+#if defined(IOS)
+
+ CGContextRef cgc = CGBitmapContextCreate(pBuffer, nWidth, nHeight, 8, nWidth*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little);
+
+ CGContextTranslateCTM(cgc, 0, nHeight);
+ CGContextScaleCTM(cgc, 1, -1);
+
+ SystemGraphicsData aData;
+ aData.rCGContext = cgc;
+
+ ScopedVclPtrInstance<VirtualDevice> pDevice(&aData, Size(1, 1), DeviceFormat::DEFAULT);
+ pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+
+ pDevice->SetOutputSizePixel(Size(nWidth, nHeight));
+
+ MapMode aMapMode(pDevice->GetMapMode());
+ aMapMode.SetOrigin(Point(-nX, -nY));
+ pDevice->SetMapMode(aMapMode);
+
+ comphelper::LibreOfficeKit::setDialogPainting(true);
+ pWindow->PaintToDevice(pDevice.get(), Point(0, 0), Size());
+ comphelper::LibreOfficeKit::setDialogPainting(false);
+
+ CGContextRelease(cgc);
+
+#else
+
ScopedVclPtrInstance<VirtualDevice> pDevice(nullptr, Size(1, 1), DeviceFormat::DEFAULT);
pDevice->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
@@ -3565,6 +3595,8 @@ static void doc_paintWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWind
comphelper::LibreOfficeKit::setDialogPainting(true);
pWindow->PaintToDevice(pDevice.get(), Point(0, 0), Size());
comphelper::LibreOfficeKit::setDialogPainting(false);
+
+#endif
}
static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nAction)
More information about the Libreoffice-commits
mailing list