diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2016-12-31 18:01:14 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-01-30 05:23:16 +0000 |
commit | 8145a80868aeb2d81abdeb2918942911c6d128f4 (patch) | |
tree | cf281a96e835ffc2923385111a8c560cc1c79444 /vcl | |
parent | 11a979cb8a750f2820a0d7947a47e830a1a0b335 (diff) |
tdf#104693: screenshot: fix mirrored mac screenshots
Change-Id: Ie13689d7e15bf8dee6f21e6f5e7d75c9e53e931b
Reviewed-on: https://gerrit.libreoffice.org/32543
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/quartz/salbmp.h | 2 | ||||
-rw-r--r-- | vcl/quartz/salbmp.cxx | 10 | ||||
-rw-r--r-- | vcl/quartz/salgdicommon.cxx | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/vcl/inc/quartz/salbmp.h b/vcl/inc/quartz/salbmp.h index ae384c9bee4b..5fe1294c41cf 100644 --- a/vcl/inc/quartz/salbmp.h +++ b/vcl/inc/quartz/salbmp.h @@ -88,7 +88,7 @@ private: sal_uInt16 nSrcBits, sal_uInt32 nSrcBytesPerRow, const BitmapPalette& rSrcPalette, sal_uInt8* pSrcData ); public: - bool Create( CGLayerRef xLayer, int nBitCount, int nX, int nY, int nWidth, int nHeight ); + bool Create( CGLayerRef xLayer, int nBitCount, int nX, int nY, int nWidth, int nHeight, bool bFlipped ); public: CGImageRef CreateWithMask( const QuartzSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const; diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index dc9b6834586d..014dd34259d9 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -107,7 +107,7 @@ QuartzSalBitmap::~QuartzSalBitmap() } bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits, - int nX, int nY, int nWidth, int nHeight ) + int nX, int nY, int nWidth, int nHeight, bool bFlipped ) { SAL_WARN_IF( !xLayer, "vcl", "QuartzSalBitmap::Create() from non-layered context" ); @@ -146,6 +146,14 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits, if(mxGraphicContext) // remove warning { SAL_INFO("vcl.cg", "CGContextDrawLayerAtPoint(" << mxGraphicContext << "," << aSrcPoint << "," << xLayer << ")" ); + if( bFlipped ) + { + SAL_INFO( "vcl.cg", "CGContextTranslateCTM(" << mxGraphicContext << ",0," << mnHeight << ")" ); + CGContextTranslateCTM( mxGraphicContext, 0, +mnHeight ); + SAL_INFO( "vcl.cg", "CGContextScaleCTM(" << mxGraphicContext << ",+1,-1)" ); + CGContextScaleCTM( mxGraphicContext, +1, -1 ); + } + CGContextDrawLayerAtPoint( mxGraphicContext, aSrcPoint, xLayer ); } return true; diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 2222e062b54e..0d213da72cdf 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -1448,7 +1448,7 @@ SalBitmap* AquaSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY ApplyXorContext(); QuartzSalBitmap* pBitmap = new QuartzSalBitmap; - if( !pBitmap->Create( mxLayer, mnBitmapDepth, nX, nY, nDX, nDY) ) + if( !pBitmap->Create( mxLayer, mnBitmapDepth, nX, nY, nDX, nDY, IsFlipped()) ) { delete pBitmap; pBitmap = nullptr; |