[Libreoffice-commits] core.git: ios/UnitTest vcl/quartz
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 2 18:11:59 UTC 2018
ios/UnitTest/UnitTest/ViewController.mm | 2 +-
vcl/quartz/salvd.cxx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit baddd90d4ac0af1efe8bd09f3993d2b2f48d62b6
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Oct 2 17:41:26 2018 +0300
Commit: Tor Lillqvist <tml at iki.fi>
CommitDate: Tue Oct 2 21:10:48 2018 +0300
LibreOfficeKit wants the tile pixmap bytes to be in BGRA order in memory
To get that with CoreGraphics on iOS we need to use also
kCGImageByteOrder32Little in the CGBitmapContextCreate() call,
otherwise the bytes will be in ARGB order in memory.
(Not touching the macOS code here.)
Change-Id: I3c2dd94feb1c6bf46c5b335f5901b29e5fe1e7fb
diff --git a/ios/UnitTest/UnitTest/ViewController.mm b/ios/UnitTest/UnitTest/ViewController.mm
index a955812d6f3c..c79c003547c8 100644
--- a/ios/UnitTest/UnitTest/ViewController.mm
+++ b/ios/UnitTest/UnitTest/ViewController.mm
@@ -43,7 +43,7 @@ static unsigned char *lo_ios_app_get_cgcontext_for_buffer(unsigned char *buffer,
{
assert(cgc == nullptr);
- cgc = CGBitmapContextCreate(buffer, width, height, 8, width*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst);
+ cgc = CGBitmapContextCreate(buffer, width, height, 8, width*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little);
CGContextTranslateCTM(cgc, 0, height);
CGContextScaleCTM(cgc, 1, -1);
diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 84f3ee8b9631..4f7c41acc38e 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -304,7 +304,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
}
#endif
mxBitmapContext = CGBitmapContextCreate( pRawData, nDX, nDY,
- 8, nBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst );
+ 8, nBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little );
SAL_INFO( "vcl.cg", "CGBitmapContextCreate(" << nDX << "x" << nDY << "x32) = " << mxBitmapContext );
xCGContext = mxBitmapContext;
#endif
More information about the Libreoffice-commits
mailing list