[Libreoffice-commits] core.git: vcl/inc vcl/quartz
Thorsten Behrens
Thorsten.Behrens at CIB.de
Mon Jan 30 05:23:45 UTC 2017
vcl/inc/quartz/salbmp.h | 2 +-
vcl/quartz/salbmp.cxx | 10 +++++++++-
vcl/quartz/salgdicommon.cxx | 2 +-
3 files changed, 11 insertions(+), 3 deletions(-)
New commits:
commit 8145a80868aeb2d81abdeb2918942911c6d128f4
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date: Sat Dec 31 18:01:14 2016 +0100
tdf#104693: screenshot: fix mirrored mac screenshots
Change-Id: Ie13689d7e15bf8dee6f21e6f5e7d75c9e53e931b
Reviewed-on: https://gerrit.libreoffice.org/32543
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/vcl/inc/quartz/salbmp.h b/vcl/inc/quartz/salbmp.h
index ae384c9..5fe1294 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 dc9b683..014dd34 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 2222e06..0d213da 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;
More information about the Libreoffice-commits
mailing list