Kaydet (Commit) 0353d0e5 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

use CGContextHolder in copyBits

Change-Id: I98f1723da170712e2f2c2a846e02954381376c7e
Reviewed-on: https://gerrit.libreoffice.org/72441
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 368eb33b
......@@ -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 );
}
......
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