summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorPatrick Luby <plubius@neooffice.org>2023-07-12 13:08:29 -0400
committerPatrick Luby <plubius@neooffice.org>2023-07-12 22:14:58 +0200
commitdd1d74281a119f076e58598c8e022ee30232e5bf (patch)
tree850ed7441653b6eb7c882b98e8bb28e25f2bebc6 /desktop/source
parent5079e7937ef471a44dcf119dc6ae0a334d9c6adc (diff)
Natively draw to pixel buffer with RBGA pixel format in iOS app
Change-Id: I31917f914ed22bebffc52777cb974224d08bed83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154367 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 272de6ec30021fdbda38a1bd84a3036a0afc73d6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154325 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index dbd236858ce8..99ba738c17d5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3964,9 +3964,11 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
#if defined(IOS)
double fDPIScale = 1.0;
+ // Onine uses the LOK_TILEMODE_RGBA by default so flip the normal flags
+ // to kCGImageAlphaPremultipliedLast | kCGImageByteOrder32Big
CGContextRef pCGContext = CGBitmapContextCreate(pBuffer, nCanvasWidth, nCanvasHeight, 8,
nCanvasWidth * 4, CGColorSpaceCreateDeviceRGB(),
- kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little);
+ kCGImageAlphaPremultipliedLast | kCGImageByteOrder32Big);
CGContextTranslateCTM(pCGContext, 0, nCanvasHeight);
CGContextScaleCTM(pCGContext, fDPIScale, -fDPIScale);
@@ -4234,7 +4236,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis,
static int doc_getTileMode(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
{
SetLastExceptionMsg();
-#if ENABLE_CAIRO_RGBA
+#if ENABLE_CAIRO_RGBA || defined IOS
return LOK_TILEMODE_RGBA;
#else
return LOK_TILEMODE_BGRA;
@@ -6613,8 +6615,9 @@ static void doc_paintWindowForView(LibreOfficeKitDocument* pThis, unsigned nLOKW
comphelper::LibreOfficeKit::setDPIScale(fDPIScale);
#if defined(IOS)
-
- CGContextRef cgc = CGBitmapContextCreate(pBuffer, nWidth, nHeight, 8, nWidth*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little);
+ // Onine uses the LOK_TILEMODE_RGBA by default so flip the normal flags
+ // to kCGImageAlphaNoneSkipLast | kCGImageByteOrder32Big
+ CGContextRef cgc = CGBitmapContextCreate(pBuffer, nWidth, nHeight, 8, nWidth*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipLast | kCGImageByteOrder32Big);
CGContextTranslateCTM(cgc, 0, nHeight);
CGContextScaleCTM(cgc, fDPIScale, -fDPIScale);