desktop/source/lib/init.cxx |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

New commits:
commit f575cf3320684efe7db9844da89a5ebdb3083498
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Sat Nov 3 01:44:16 2018 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Sat Nov 3 15:33:19 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/62800
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2496f9285c05..cc49f86e6d85 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2159,6 +2159,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,
@@ -3572,6 +3575,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(COL_TRANSPARENT));
 
@@ -3584,6 +3614,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)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to