diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-05-16 21:18:58 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-05-18 09:00:06 +0200 |
commit | 0353d0e5cdfd2847f1d30c629ce19aa202e43c40 (patch) | |
tree | 221ed32bcf1e1969e2af4a309f312c70f71c28fa /vcl/quartz | |
parent | 368eb33bf21e2537410bf45171f56ad1dc668b99 (diff) |
use CGContextHolder in copyBits
Change-Id: I98f1723da170712e2f2c2a846e02954381376c7e
Reviewed-on: https://gerrit.libreoffice.org/72441
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/salgdicommon.cxx | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 11fc42fc6cfc..dd35917cd949 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -358,37 +358,35 @@ void AquaSalGraphics::copyBits( const SalTwoRect& rPosAry, SalGraphics *pSrcGrap { // in XOR mode the drawing context is redirected to the XOR mask // if source and target are identical then copyBits() paints onto the target context though - CGContextRef xCopyContext = maContextHolder.get(); + CGContextHolder aCopyContext = maContextHolder; if( mpXorEmulation && mpXorEmulation->IsEnabled() ) { if( pSrcGraphics == this ) { - xCopyContext = mpXorEmulation->GetTargetContext(); + aCopyContext.set(mpXorEmulation->GetTargetContext()); } } - SAL_INFO( "vcl.cg", "CGContextSaveGState(" << xCopyContext << ")" ); - CGContextSaveGState( xCopyContext ); + aCopyContext.saveState(); const CGRect aDstRect = CGRectMake(rPosAry.mnDestX, rPosAry.mnDestY, rPosAry.mnDestWidth, rPosAry.mnDestHeight); - SAL_INFO( "vcl.cg", "CGContextClipToRect(" << xCopyContext << "," << aDstRect << ")" ); - CGContextClipToRect( xCopyContext, aDstRect ); + SAL_INFO( "vcl.cg", "CGContextClipToRect(" << aCopyContext.get() << "," << aDstRect << ")" ); + CGContextClipToRect(aCopyContext.get(), aDstRect); // draw at new destination // NOTE: flipped drawing gets disabled for this, else the subimage would be drawn upside down if( pSrc->IsFlipped() ) { - SAL_INFO( "vcl.cg", "CGContextTranslateCTM(" << xCopyContext << ",0," << mnHeight << ")" ); - CGContextTranslateCTM( xCopyContext, 0, +mnHeight ); - SAL_INFO( "vcl.cg", "CGContextScaleCTM(" << xCopyContext << ",+1,-1)" ); - CGContextScaleCTM( xCopyContext, +1, -1 ); + SAL_INFO( "vcl.cg", "CGContextTranslateCTM(" << aCopyContext.get() << ",0," << mnHeight << ")" ); + CGContextTranslateCTM( aCopyContext.get(), 0, +mnHeight ); + SAL_INFO( "vcl.cg", "CGContextScaleCTM(" << aCopyContext.get() << ",+1,-1)" ); + CGContextScaleCTM( aCopyContext.get(), +1, -1 ); } // TODO: pSrc->size() != this->size() - SAL_INFO( "vcl.cg", "CGContextDrawLayerAtPoint(" << xCopyContext << "," << aDstPoint << "," << pSrc->maLayer.get() << ")"); - CGContextDrawLayerAtPoint(xCopyContext, aDstPoint, pSrc->maLayer.get()); + SAL_INFO("vcl.cg", "CGContextDrawLayerAtPoint(" << aCopyContext.get() << "," << aDstPoint << "," << pSrc->maLayer.get() << ")"); + CGContextDrawLayerAtPoint(aCopyContext.get(), aDstPoint, pSrc->maLayer.get()); - SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << xCopyContext << ")" ); - CGContextRestoreGState( xCopyContext ); + aCopyContext.restoreState(); // mark the destination rectangle as updated RefreshRect( aDstRect ); } |