Kaydet (Commit) 8145a808 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

tdf#104693: screenshot: fix mirrored mac screenshots

Change-Id: Ie13689d7e15bf8dee6f21e6f5e7d75c9e53e931b
Reviewed-on: https://gerrit.libreoffice.org/32543Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 11a979cb
...@@ -88,7 +88,7 @@ private: ...@@ -88,7 +88,7 @@ private:
sal_uInt16 nSrcBits, sal_uInt32 nSrcBytesPerRow, const BitmapPalette& rSrcPalette, sal_uInt8* pSrcData ); sal_uInt16 nSrcBits, sal_uInt32 nSrcBytesPerRow, const BitmapPalette& rSrcPalette, sal_uInt8* pSrcData );
public: 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: public:
CGImageRef CreateWithMask( const QuartzSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const; CGImageRef CreateWithMask( const QuartzSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const;
......
...@@ -107,7 +107,7 @@ QuartzSalBitmap::~QuartzSalBitmap() ...@@ -107,7 +107,7 @@ QuartzSalBitmap::~QuartzSalBitmap()
} }
bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits, 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" ); SAL_WARN_IF( !xLayer, "vcl", "QuartzSalBitmap::Create() from non-layered context" );
...@@ -146,6 +146,14 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits, ...@@ -146,6 +146,14 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
if(mxGraphicContext) // remove warning if(mxGraphicContext) // remove warning
{ {
SAL_INFO("vcl.cg", "CGContextDrawLayerAtPoint(" << mxGraphicContext << "," << aSrcPoint << "," << xLayer << ")" ); 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 ); CGContextDrawLayerAtPoint( mxGraphicContext, aSrcPoint, xLayer );
} }
return true; return true;
......
...@@ -1448,7 +1448,7 @@ SalBitmap* AquaSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY ...@@ -1448,7 +1448,7 @@ SalBitmap* AquaSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY
ApplyXorContext(); ApplyXorContext();
QuartzSalBitmap* pBitmap = new QuartzSalBitmap; 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; delete pBitmap;
pBitmap = nullptr; pBitmap = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment